温馨提示: 定期 清理浏览器缓存,可以获得最佳浏览体验。
Stata Blog 更新了一条新的博客,介绍了一个将 Stata 表格导入 Excel 或 Word 快捷命令,效果不错!
Home[1] > Data Management > Export tabulation results to Excel—Update
7 June 2018 Kevin Crow, Senior Software Developer[2] || Go to comments
It’s summer time, which means we have interns working at StataCorp again. Our newest intern, Chris Hassell, was tasked with updating my community-contributed command tab2xl with most of the suggestions that blog readers left in the comments. Chris updated tab2xl and wrote tab2docx, which writes a tabulation table to a Word file using the putdocx command.
To install or update your tab2xl command, type
net install http://www.stata.com/users/kcrow/tab2xl, replace
To install the new tab2docx command, type
net install http://www.stata.com/users/kcrow/tab2docx
tab2xl now allows weights, if, in, formatting of the cells, and two-way tabulations. Once installed, you can type
. sysuse auto, clear
(1978 Automobile Data)
. tab2xl rep78 foreign in 1/50 [fweight=mpg] using testfile, col(1) row(1)
file testfile.xlsx saved
to produce
To write the table to a Word document, you must first open a .docx file using the command putdocx begin, type your tab2docx command to append the table to your file, and then save the document using putdocx save filename. For example, typing
. sysuse auto, clear
(1978 Automobile Data)
. putdocx begin
. tab2docx rep78 in 1/50 [fweight=mpg]
. putdocx save testfile.docx
will produce
Chris did an excellent job updating tab2xl and coding tab2docx, making it easier for you to create tables for inclusion in a Word file.
连享会-直播课 上线了!
http://lianxh.duanshu.com
免费公开课:
直击面板数据模型 - 连玉君,时长:1小时40分钟 Stata 33 讲 - 连玉君, 每讲 15 分钟. 部分直播课 课程资料下载 (PPT,dofiles等)
支持回看,所有课程可以随时购买观看。
专题 | 嘉宾 | 直播/回看视频 |
---|---|---|
⭐ 最新专题 ⭐ | DSGE, 因果推断, 空间计量等 | |
⭕ Stata数据清洗 | 游万海 | 直播, 2 小时,已上线 |
研究设计 | 连玉君 | 我的特斯拉-实证研究设计,-幻灯片- |
面板模型 | 连玉君 | 动态面板模型,-幻灯片- |
面板模型 | 连玉君 | 直击面板数据模型 [免费公开课,2小时] |
Note: 部分课程的资料,PPT 等可以前往 连享会-直播课 主页查看,下载。
关于我们
课程, 直播, 视频, 客服, 模型设定, 研究设计, stata, plus, 绘图, 编程, 面板, 论文重现, 可视化, RDD, DID, PSM, 合成控制法
等
连享会小程序:扫一扫,看推文,看视频……
扫码加入连享会微信群,提问交流更方便
✏ 连享会学习群-常见问题解答汇总:
✨ https://gitee.com/arlionn/WD
Go to homepage: https://blog.stata.com/
[2]Posts by Kevin Crow, Senior Software Developer: https://blog.stata.com/author/kcrow/