Hi,
I am using Esttab in State 14.2 to export tables to Latex with my regression results in Stata. For the most part, that works well, but I have an issue: Using the Stats command, I am able to display N and N_clust, but not r2. I have also been unable to display the two Estadd-created strings dum and con (coded "Yes" or "No"), but after updating to the latest version of Estout, that was resolved, while the R2 issue, which is most important, was not. In place of the R2 values, I get zeroes. How can I solve this?
This is the relevant code, somewhat shortened by removing controls:
Thank you in advance!
I am using Esttab in State 14.2 to export tables to Latex with my regression results in Stata. For the most part, that works well, but I have an issue: Using the Stats command, I am able to display N and N_clust, but not r2. I have also been unable to display the two Estadd-created strings dum and con (coded "Yes" or "No"), but after updating to the latest version of Estout, that was resolved, while the R2 issue, which is most important, was not. In place of the R2 values, I get zeroes. How can I solve this?
This is the relevant code, somewhat shortened by removing controls:
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input double(girlshare StudentAge girl) float(newlyArr intGirlNew intGirlShare intNewShare intGirlNewShare) double SchoolID
.5714285714285714 10.42 1 0 0 .5714286 0 0 1
.6190476190476191 12.92 0 1 0 0 .6190476 0 1
.6190476190476191 10.67 0 0 0 0 0 0 1
.5714285714285714 10.92 1 0 0 .5714286 0 0 1
.5714285714285714 10.92 1 0 0 .5714286 0 0 1
.5714285714285714 10.42 1 0 0 .5714286 0 0 1
.6190476190476191 10.67 0 0 0 0 0 0 1
.5714285714285714 10.92 1 0 0 .5714286 0 0 1
.5714285714285714 10.67 1 0 0 .5714286 0 0 1
.5714285714285714 10.42 1 0 0 .5714286 0 0 1
.6190476190476191 10.92 0 0 0 0 0 0 1
.5714285714285714 10.67 1 0 0 .5714286 0 0 1
.5714285714285714 11.08 1 0 0 .5714286 0 0 1
.3684210526315789 10.75 0 0 0 0 0 0 1
.3157894736842105 10.75 1 0 0 .3157895 0 0 1
.3684210526315789 11.08 0 . . 0 . . 1
.3684210526315789 11.08 0 0 0 0 0 0 1
.3684210526315789 11.17 0 0 0 0 0 0 1
.3157894736842105 10.92 1 0 0 .3157895 0 0 1
.3684210526315789 11.58 0 . . 0 . . 1
.3684210526315789 11.25 0 . . 0 . . 1
.3684210526315789 10.67 0 0 0 0 0 0 1
.3684210526315789 10.75 0 . . 0 . . 1
.3157894736842105 11.92 1 . . .3157895 . . 1
.3684210526315789 11.42 0 1 0 0 .36842105 0 1
.6046511627906976 10.42 0 0 0 0 0 0 2
.6046511627906976 10.42 0 0 0 0 0 0 2
.6046511627906976 11.08 0 0 0 0 0 0 2
.6046511627906976 11.08 0 0 0 0 0 0 2
.5813953488372093 10.83 1 0 0 .5813953 0 0 2
.5813953488372093 10.83 1 0 0 .5813953 0 0 2
.5813953488372093 10.58 1 0 0 .5813953 0 0 2
.5813953488372093 10.58 1 0 0 .5813953 0 0 2
.5813953488372093 10.58 1 . . .5813953 . . 2
.5813953488372093 10.25 1 0 0 .5813953 0 0 2
.5813953488372093 10.25 1 0 0 .5813953 0 0 2
.6 10.33 1 0 0 .6 0 0 2
.6 10.25 1 0 0 .6 0 0 2
.65 10.92 0 0 0 0 0 0 2
.6 10.92 1 0 0 .6 0 0 2
.65 10.67 0 . . 0 . . 2
.6 10.42 1 0 0 .6 0 0 2
.65 10.25 0 0 0 0 0 0 2
.6 11.08 1 0 0 .6 0 0 2
.65 11.17 0 0 0 0 0 0 2
end
label values StudentAge ASDAGE
label values girl girl
label def girl 0 "Male", modify
label def girl 1 "Female", modify
label values newlyArr newlyArr
label def newlyArr 0 "No", modify
label def newlyArr 1 "Yes", modify
label values SchoolID IDSCHOOL
#delimit ;
local controls2 "StudentAge girl newlyArr intGirlNew";
#delimit cr
reg mathscore girlshare intGirlShare intNewShare intGirlNewShare, cluster(SchoolID)
eststo est1, refresh
estadd local dum "No", replace
estadd local con "No", replace
reg mathscore girlshare intGirlShare intNewShare intGirlNewShare i.(SchoolID), cluster(SchoolID)
eststo est2, refresh
estadd local dum "Yes", replace
estadd local con "No", replace
reg mathscore girlshare intGirlShare intNewShare intGirlNewShare `controls2' i.(SchoolID), cluster(SchoolID)
eststo est3, refresh
estadd local dum "Yes", replace
estadd local con "Yes", replace
#d ;
esttab est1 est2 est3 using Table2.tex, replace
style(tex) keep(girlshare intGirlShare intNewShare intGirlNewShare)
starlevels(* 0.10 ** 0.05 *** 0.01)
cells(b(fmt(%8.3f) star) se(fmt(%8.3f) par))
stats(dum con N N_clust r2, fmt(0 0 0 0 0)
labels("School dummies" "Controls" "Number of observations" "Number of classroom clusters" "R2"))
label
title("Regression of share of girls in the classroom on math scores by group")
numbers
mlabels( ,none) collabels( ,none)
addnotes("Robust standard errors, adjusted for clustering at the school level, are presented in parentheses." "*** Significant at the 1\% level; ** Significant at the 5\% level; * Significant at the 10\% level")
legend
;
#d cr

Comment