楼主: PINJUN12123
892 5

[数据管理求助] 求助:stata中使用什么代码可以获得这样的表格 [推广有奖]

  • 0关注
  • 0粉丝

小学生

71%

还不是VIP/贵宾

-

威望
0
论坛币
10 个
通用积分
0.1500
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
46 点
帖子
4
精华
0
在线时间
10 小时
注册时间
2021-11-3
最后登录
2023-4-13

楼主
PINJUN12123 学生认证  发表于 2021-11-3 17:12:40 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
不太懂
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Stata tata stata

微信截图_20211103170911.png (131.42 KB)

微信截图_20211103170911.png

沙发
917968079 发表于 2021-11-3 18:39:25
应该是自己手动调的

藤椅
6513 在职认证  发表于 2021-11-5 13:17:26
这个很简单啊,不就是做个均值,标准差的输出表格吗,sum2docx就可以实现,然后调整一下就行

  sysuse auto, clear

    Report summary statistics for variable mpg weight length rep78 and foreign

    sum2docx mpg weight length rep78 foreign using d:/temp1.docx, replace
        stats(N mean(%9.2f) sd min(%9.0g) median(%9.0g) max(%9.0g))

    Add table title

    sum2docx mpg weight length rep78 foreign using d:/temp2.docx, replace
        stats(N mean sd min median max) title("this is the summary
        statistics")

    Add notes

    sum2docx mpg weight length rep78 foreign using d:/temp3.docx, replace
        stats(N mean(%9.2f) sd min(%9.0g) median(%9.0g) max(%9.0g))
        title("this is the summary statistics") note("Data source: auto.dta")

    Use wild card

    sum2docx *n* m?g using d:/temp4.docx, replace stats(N mean(%9.2f) sd
        min(%9.0g) median(%9.0g) max(%9.0g)) title("Table 1: this is the
        summary statistics")

    Use all variables

    drop make

    sum2docx _all using d:/temp5.docx, replace stats(N mean(%9.2f) sd
        min(%9.0g) median(%9.0g) max(%9.0g)) title("Table 1: this is the
        summary statistics")

    Append all files together

    putdocx append d:/temp1.docx d:/temp2.docx d:/temp3.docx d:/temp4.docx
        d:/temp5.docx, saving(d:/mytable.docx,replace)

    We can also use the option append to append the output to an existing file

    sum2docx mpg weight length rep78 foreign using d:/mytable.docx, append
        stats(N mean(%9.2f) sd min(%9.0g) median(%9.0g) max(%9.0g))
        title("this is the summary statistics")

板凳
sinokoo 发表于 2021-11-5 14:31:18
sum2docx或者自己调都可以啊,自己调更方便些

报纸
NaomiZhang99 发表于 2021-12-15 15:55:14
不太会

地板
小胡胡呀 发表于 2021-12-15 18:44:55
sum一下就可以,后期自己绘制

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-29 04:35