楼主: 匿名
67739 23

[Stata] [Stata]报表呈现(2):描述性统计   [推广有奖]

11
niuniuyiwan 在职认证  发表于 2015-9-14 21:00:51
  1. //使用statsmat命令_可使用xpose将矩阵转换
  2. ssc install statsmat
  3. use http://www.ats.ucla.edu/stat/data/hsb2, clear
  4. statsmat science, by(female) f(%9.0f) s(n min q max) matrix(m1)
  5. statsmat science, by(female) f(%9.0f) s(n min q max) xpose matrix(m2)
  6. //宽型------->长型
复制代码

1.PNG



12
niuniuyiwan 在职认证  发表于 2015-9-14 21:24:50
  1. //追加tabstat实例
  2. use http://www.ats.ucla.edu/stat/data/hsb2, clear
  3. tabstat read write math science, stats(mean med sd min max) format(%9.2f)
复制代码

1.PNG


  1. //长------>宽
  2. tabstat read write math science, stats(mean med sd min max) format(%9.2f) ///
  3. col(stats)
复制代码

2.PNG


  1. //分组描述
  2. tabstat read write math science, stats(mean med sd min max) format(%9.2f) ///
  3. by(female) col(stats)
复制代码

3.PNG





13
niuniuyiwan 在职认证  发表于 2015-9-15 09:11:22
  1. //使用estpost

  2. sysuse auto

  3. estpost summarize price weight rep78 mpg
复制代码

捕获.PNG



14
niuniuyiwan 在职认证  发表于 2015-9-15 21:45:00
  1. sysuse auto, clear
  2. ssc inst tabplot
  3. set scheme s1color

  4. tabplot headroom rep78, showval
复制代码

Graph.png



15
niuniuyiwan 在职认证  发表于 2015-9-17 20:45:12

1.PNG


29.gif


调整页边距_窄


2.PNG

如需转化pdf:

  1. ssc install markdoc
  2. markdocwkhtmltopdf
复制代码



16
sunshine15 发表于 2016-11-22 16:05:24
你太厉害了!

17
akikoyu 发表于 2017-3-1 08:28:51
学习了

18
litianszg 发表于 2017-5-5 20:31:46


19
therealair 发表于 2017-5-29 21:41:10
niuniuyiwan 发表于 2015-9-14 21:24
您好,

谢谢您提供的code,非常有用。
  1. tabstat audit_fee ln_AF total_asset ln_TA net_income ln_NI busy chTA, stats(mean med sd ) format(%9.2f) by(big_4) row(stats)
复制代码
我现在有一份数据需要做相似的分析,我输入了一下代码,但是 Stata 显示:“: required”,
忽略了by(big_4)的分类。不知道这个问题您知道怎么解决么?


万分感谢!

20
helen1wendy 学生认证  发表于 2018-3-7 20:47:13
niuniuyiwan 发表于 2015-9-14 20:53
怎么把这个矩阵转置啊

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-8 09:17