在Stata中自定义表格 [英] Customizing tables in Stata

查看:476
本文介绍了在Stata中自定义表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在windows上使用 Stata14 ,我想知道如何从几个回归结果中构建自定义表格。这是一个例子。我们有

  reg y,x1 
预测resid1,residuals
汇总resid1
code


其中:

 变量| Obs Mean Std。开发。 Min Max 
------------- + ------------------------------ ---------------------------
resid1 | 5,708,529 4.83e-11 .7039736 -3.057633 3.256382

运行另一个回归,同样得到残差: / b>

  reg y,x2 
预测渣油2,残差

我想创建一个具有两个残差的两个标准偏差的表格,并将其最优地输出到 latex 。我熟悉 esttab estout 命令用于将回归结果输出到 latex ,但这些不适用于上面示例中的自定义表格。

解决方案

您需要使用 estpost

  sysuse auto,清除
回归价格权重
预测error1,残差
regress price trunk
预测error2,残差

eststo清除
estpost汇总错误1错误2
eststo
esttab,cells(count mean sd min max)noobs nonum
esttab使用so.tex,cells(count mean sd min max)noobs nonum替换

更多此处


Using Stata14 on windows, I am wondering how to build customized tables from several regression results. Here is an example. We have

reg y, x1
predict resid1, residuals
summarize resid1

Which gives:

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      resid1 |  5,708,529    4.83e-11    .7039736  -3.057633   3.256382

And run another regrerssion and similarly obtain the residuals:

reg y, x2
predict resid2, residuals

I would like to create a table which has the two standard deviations of the two residuals, and optimally output it to latex. I am familiar with the esttab and estout commands for outputting regression results to latex, but these do not work for customized tables as in the above example.

解决方案

You need to use estpost. This should get you started.

sysuse auto, clear
regress price weight
predict error1, residuals
regress price trunk
predict error2, residuals

eststo clear
estpost summarize error1 error2
eststo
esttab, cells("count mean sd min max") noobs nonum
esttab using so.tex, cells("count mean sd min max") noobs nonum replace

More here.

这篇关于在Stata中自定义表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆