Hello,
I am practicing how to create customised LaTex regression results tables in STATA. However, when I try compiling the LaTex results tables into pdf, Latex gives me an error message that reads "LaTex Error: Environment Table Undefined". Could there be a problem with the STATA code I wrote to create the tables? Here is the STATA code I wrote:
use wagepan, clear
xtset nr year
gen lhour = ln(hour)
levelsof year, loc(yr)
loc nyr: word count `yr'
di "NOTE: This is an `nyr' panel data"
forval i = 1/`nyr' {
loc ny: word `i' of `yr'
quietly {
reg lwage lhour educ if year == `ny'
margins, dyex(educ)
matrix eta = r(b)
matrix s2eta = r(V)
matrix list eta
matrix list s2eta
eststo, add(eta_educ eta[1, 1] s_educ sqrt(s2eta[1, 1]))
reg lwage lhour educ black hisp if year == `ny'
margins, dyex(educ)
matrix eta = r(b)
matrix s2eta = r(V)
matrix list eta
matrix list s2eta
eststo, add(eta_educ eta[1, 1] s_educ sqrt(s2eta[1, 1]))
reg lwage lhour educ c.exper##c.exper black hisp if year == `ny'
margins, dyex(educ exper)
matrix eta = r(b)
matrix s2eta = r(V)
matrix list eta
matrix list s2eta
eststo, add(eta_educ eta[1, 1] s_educ sqrt(s2eta[1, 1]) eta_exper eta[1, 2] s_exper sqrt(s2eta[1, 2]))
}
esttab _all using lwage`ny'.tex, replace ti("Wage Equation Estimation for `ny'") ///
label nomtitle nodepvars not se noobs ar2 booktabs ///
scalar(eta_educ s_educ eta_exper s_exper) ///
addnotes("$\eta$: Semi-elasticity of lwage with respect to educ, exper" ///
"$\eta_{se}$: Standard errors of the semi-elasticity") ///
substitute("_cons" "Constant" "eta_educ" "$\eta_{educ}$" "s_educ" ///
"$\eta_{se}$" "eta_exper" "$\eta_{exper}$" "s_exper" "$\eta_{se}$" ///
"c.exper#c.exper" "Experience$^2$")
}
I NEED HELP PLEASE
Related Posts with Difficulty in accessing my results tables via LaTex
Count number of cases if dates are within a certain range (a la statsby)Greetings all, I have single line per observation survival data (4 million lines). Here is a simpli…
Generate balance tableHi, I'm trying to replicate this balance table (as in the picture) using some of the example dataset…
extract variable labels for new variable namesHi there I try to automate my programming as much as possible and one challenge I've come up agains…
Manually installing Blindschemes by Daniel BischofDear Statalisters I admit this is a bit of a non-problem, but I'd like to find a solution nonethele…
Multinomial logit with sample selectionDear everyone, I am looking for something similar to Heckman selection model/svysemlog with a modi…
Subscribe to:
Post Comments (Atom)
0 Response to Difficulty in accessing my results tables via LaTex
Post a Comment