0

这是一项 2 臂随机对照试验。在我的回归输出中,我想评估治疗组中疾病风险的相对降低。为了使评估更容易,我想将因变量控制均值添加到回归表输出的底部。我目前正在estadd使用estout. 下面是我的代码,它显示了因变量的平均值,但是我找不到任何选项estadd,estpost等允许我限制仅研究的一个臂(即控制臂)的 depvar 平均值计算。

    eststo, title(" "): xi: quietly reg X `covariates' if survid==1, vce(cluster id1)
    estadd ysumm
    estout using $outdir\results.txt, replace ///
      cells("b(fmt(3) label (Coeff.))  se(fmt(3) star label (s.e.))") /// 
      drop(_Itt* _cons)     ///
      starlevels(+ 0.10 * 0.05) ///
      stats(N ymean, labels ("N. of obs." "Control Mean"))            ///               
      label legend 
4

1 回答 1

3

您被 , 等提供的奇妙功能宠坏了estadd:) eststo。这个怎么样:

xi: quietly reg X `covariates' if survid==1, vce(cluster id1)
   // two prefixes in the same command is like a sentence with three subordinate clauses
   // that just rolls from one line to the next without giving you a chance to 
   // catch a breath and really understand what is going on in this sentence,
   // which is a sign of poor writing skills, unless you are Dostoevsky, which I am not.
estimates store CtrlArm
   // it is also a good idea to be specific about what it is that you want to output.
   // Thus I have the -estimates store- on a separate line with a specific name for your results.
summarize X if survid==1
estadd scalar ymean = r(mean) 
estout CtrlArm using $outdir\results.txt, ...

estadd并且estout是不可避免的。但是,您eststo带有空标题的首字母只会占用空间,并且无济于事。

于 2011-10-19T15:01:24.130 回答