自动化生成报告
我们每月使用 Stata 来合并和分析一个地区所有机构的数据。我想以某种方式自动为这些月度报告创建数据分析报告。该报告包括报告指标的汇总表、关键指标的几个图形以及显示数据组中统计上显着差异的分析表。我希望这些内容为 PDF 格式并自动通过电子邮件发送给各机构。关于我可以用来自动化此操作的软件有什么想法吗?
We are using Stata to combine and analyze data for all of our agencies in a district each month. I'd like to somehow create reports of the data analysis automatically for these monthly reports. The report includes a summary table of the reported indicators, a couple of graphics of the key indicators, and an analysis table showing statistically significant differences in the data groups. I'd like these to be in pdf and automatically emailed out to the agencies. Any ideas on software I can use to automate this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于您使用 Stata 进行分析,因此您也可以让它完成报告自动化的繁重工作。
诀窍是使用 Stata 包(如 -rtfutil-)将您描述的表格和图形导出到单个文档。此时,您需要先将其转换为 pdf,然后再通过电子邮件发送。
一些使用 -rtfutil- 在 RTF 文档中自动创建一个文档的示例代码,包括一个表格和两个图形(加上一些文本段落)(以系统数据集“auto.dta”为例):
这里有 您在 RTF 文档中询问的所有元素(从网页复制/粘贴此代码时请注意包装此代码的任何问题)。
在您的问题中,您还提到想要在此过程中创建 PDF。这里你需要去使用一些非Stata的解决方案。如果您使用的是 Mac OSX,则可以使用 Terminal -convert- 实用程序或自动程序来执行此操作,或者这里有一些其他解决方案:http://codesnippets.joyent.com/posts/show/1601
我不使用 Windows,所以我不确定该操作系统的解决方案。祝你好运。
Since you're using Stata to do the analysis, you can let it do the heavy lifting of the report automation as well.
The trick is using a Stata package like -rtfutil- to export the tables and graphics you describe to a single document. At that point you'll need to convert that to pdf before emailing it.
Here some sample code for using -rtfutil- automate the creation of a document including a table and two graphics (plus some paragraphs of text) in a RTF document(using the system dataset "auto.dta" as an example):
This will put all the elements you asked about into a RTF document (be careful with any issues with wrapping of this code when copy/paste it from the webpage).
In your question, you also mentioned wanting to create a PDF during this process. Here you'll need to go to use some non-Stata solution. If you're using Mac OSX you can use the Terminal -convert- utility or automator to do this, or here are some other solutions: http://codesnippets.joyent.com/posts/show/1601
I don't use windows so I'm not sure about solutions with that OS. Good luck.