美文网首页stata连享会
Stata新命令:Export tabulation resul

Stata新命令:Export tabulation resul

作者: stata连享会 | 来源:发表于2018-06-08 11:28 被阅读342次

Stata连享会 精彩推文1 || 精彩推文2


Stata Blog 更新了一条新的博客,介绍了一个将 Stata 表格导入 Excel 或 Word 快捷命令,效果不错!

Source: Export tabulation results to Excel—Update


Home > Data Management > Export tabulation results to Excel—Update

Export tabulation results to Excel—Update

7 June 2018 Kevin Crow, Senior Software Developer || Go to comments

Tweet

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.

Stata连享会 精彩推文1 || 精彩推文2

关于我们

  • Stata 连享会(公众号:StataChina)】由中山大学连玉君老师团队创办,旨在定期与大家分享 Stata 应用的各种经验和技巧。
  • 公众号推文同步发布于 【简书-Stata连享会】【知乎-连玉君Stata专栏】。可以在简书知乎中搜索关键词StataStata连享会后关注我们。
  • 点击推文底部【阅读原文】可以查看推文中的链接并下载相关资料。

Stata连享会 精彩推文1 || 精彩推文2

联系我们

  • 欢迎赐稿: 欢迎将您的文章或笔记投稿至Stata连享会(公众号: StataChina),我们会保留您的署名;录用稿件达五篇以上,即可免费获得 Stata 现场培训 (初级或高级选其一) 资格。
  • 意见和资料: 欢迎您的宝贵意见,您也可以来信索取推文中提及的程序和数据。
  • 招募英才: 欢迎加入我们的团队,一起学习 Stata。合作编辑或撰写稿件五篇以上,即可免费获得 Stata 现场培训 (初级或高级选其一) 资格。
  • 联系邮件: StataChina@163.com

往期精彩推文

Stata连享会推文列表

Stata连享会 精彩推文1 || 精彩推文2


欢迎加入Stata连享会(公众号: StataChina)

相关文章

  • Stata新命令:Export tabulation resul

    Stata连享会 精彩推文1 || 精彩推文2 Stata Blog 更新了一条新的博客,介绍了一个将 Stat...

  • Stata 转 Excel —— export excel 命令

    作者:李刚 (中南财经政法大学)邮箱:gang.li.0814@gmail.com   Stata连享会   计量...

  • stata命令详解-import(export) excel

    1. 前言 在目前工作中,用stata清洗及分析数据,感觉很顺滑。无奈不少同学因为help文件里的英文望而却步。带...

  • STATA新命令收集

    缺失值 mdesc -- Displays the number and proportion of missin...

  • react学习笔记2

    export/import导出/导入模块 模块功能主要由两个命令构成:export和import。export命令...

  • shell与export命令

    围绕以下几个问题来学习export命令: 1.什么是export命令? 2.为什么要用export命令? 3.怎么...

  • Moudel语法

    exprot命令 模块功能主要由两个命令构成:export和import。export命令用于规定模块的对外接口,...

  • JavaScript (module)体系

    模块功能主要由两个命令构成:export和import。 export命令用于规定模块的对外接口,import命令...

  • export 命令

    modify by nochardel coldel 0X0F 行分隔符 列分隔符

  • ES6 Module 的语法

    目录 1、概述 2、export命令 3、import命令 4、模块的整体加载 5、export 与 defaul...

网友评论

    本文标题:Stata新命令:Export tabulation resul

    本文链接:https://www.haomeiwen.com/subject/hpgosftx.html