全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
12573 9
2019-07-21
爬虫俱乐部发布的sum2docx命令介绍如下: 1.png
2.png

人大经济论坛有位答疑的好人也在类似的问题里提到过使用sum2docx之前需要先建立一个文档: 3.png
我卡在这一步:
4.png
不建立文档直接使用sum2docx出现的也是路径无法使用。
希望了解的大佬解惑,万分感谢
二维码

扫码加我 拉你入群

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

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

全部回复
2019-7-22 13:35:50
  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")
二维码

扫码加我 拉你入群

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

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

2019-7-22 13:58:10
6513 发表于 2019-7-22 13:35
sysuse auto, clear

    Report summary statistics for variable mpg weight length rep78 and
一使用sum2docx就显示stacktrace not available
failed to create document
二维码

扫码加我 拉你入群

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

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

2019-7-22 14:01:32
6513 发表于 2019-7-22 13:35
sysuse auto, clear

    Report summary statistics for variable mpg weight length rep78 and
看了下你空间,你发的那个中介效应的帖子我也进去看过,都是苦哈哈的学术数据狗啊。
二维码

扫码加我 拉你入群

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

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

2019-7-24 14:27:57
450667569 发表于 2019-7-22 14:01
看了下你空间,你发的那个中介效应的帖子我也进去看过,都是苦哈哈的学术数据狗啊。
我自己用了,没有任何问题,你的是不是数据问题
二维码

扫码加我 拉你入群

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

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

2019-7-24 15:10:05
6513 发表于 2019-7-24 14:27
我自己用了,没有任何问题,你的是不是数据问题
我之前是stata14,用这个命令显示"无法使用该命令,该命令属于stata15版本",我就下载了15版stata。运行后出现路径不可用,查询论坛告诉我需要提前设置封面文档
cap mkdir E:docx
cd E:docx
! taskkill/F/IM WINWORD.EXE/T
putdocx begin\\这一步就是设置封面文档,卡在这一步依然是路径不可用,无法创造文件
二维码

扫码加我 拉你入群

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

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

点击查看更多内容…
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群