【问题标题】:Stata - How to get Indicator Variable Indicators (Yes/No) to Appear in esttab LaTeX OutputStata - 如何让指标变量指标(是/否)出现在 esttab LaTeX 输出中
【发布时间】:2015-12-15 19:18:12
【问题描述】:

假设我使用这个数据集:

sysuse nlsw88, clear

我想运行回归并使用 esttab 将其保存到 .tex 文件中。回归是这样的:

reg wage grade i.industry i.occupation, robust

重要的是,我想表明我使用的是行业和职业虚拟变量,但我不希望任何系数出现在表格中。

一种方法是硬编码行业和职业指标:

eststo clear
eststo: reg wage grade, robust
estadd local industry "No"
estadd local occupation "No"
eststo: reg wage grade i.industry i.occupation, robust
estadd local industry "Yes"
estadd local occupation "Yes"
esttab est* using "${path}/regress_wage.tex", r2 ar2 b(3) se label booktabs ///
    replace nodepvars nomtitles drop(*industry *occupation) ///
    scalars("industry Industry" "occupation Occupation") 

但我真的不想手动输入这些。我发现了有关指示 option 的信息,但我无法让它与 i. 变量一起使用。我试过了:

eststo clear
eststo: reg wage grade, robust
eststo: reg wage grade i.industry i.occupation, robust
esttab est* using "${path}/regress_wage.tex", r2 ar2 b(3) se label booktabs ///
    replace nodepvars nomtitles drop(*industry *occupation) ///
    indicate(Industry = *industry*)

我也尝试将最后一行换成:

    indicate(Industry = _Iindustry*)
    indicate(Industry = industry*)  
    indicate(Industry = *industry)

但是没有任何效果。怎么办?

另外,有没有办法让IndustryOccupation 指标出现在常数下方而不是调整后的 R 平方下方?

【问题讨论】:

    标签: label latex regression stata


    【解决方案1】:

    您可以使用coefl 选项查看系数是如何命名的,这对于在indicate() 中引用它们很有用:

    sysuse nlsw88, clear
    reg wage grade i.industry i.occupation, robust coefl
    esttab, indicate("Industry = *.industry" "Occupation = *.occupation")
    esttab, indicate("Industry = *.industry" "Occupation = *.occupation", labels("In"))
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-01
      • 2022-09-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多