Stata - 如何让 Indicator Variable Indicators (Yes/No) 出现在 esttab LaTeX 输出中

Stata - How to get Indicator Variable Indicators (Yes/No) to Appear in esttab LaTeX Output

假设我使用这个数据集:

sysuse nlsw88, clear

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

reg wage grade i.industry i.occupation, robust

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

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

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 平方下方?

您可以使用 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"))