Hi,
I am trying to construct a table by stacking stored -tabstat- tables using -estpost- command.
I am doing so because I want to display rows of stats for several variables in groups that are not mutually excludable.
So far, my code reads like this
local colvars X1 X2 X3 X4 X5 X6
estpost tabstat `colvars' , s(mean p50 sd) columns(v) by(laborstate) nototal
esttab . using "tab1.tex", cells("`colvars'") replace noobs
estpost tabstat `colvars' , s(mean p50 sd) columns(v) by(educgroup) nototal
esttab . using "tab1.tex", cells("`colvars'") append noobs
estpost tabstat `colvars' , s(mean p50 sd) columns(v) by(region)
esttab . using "tab1.tex", cells("`colvars'") append
Problem 1: Each categorical variable laborstate, educgroup, region take a set of discrete values that are labeled. However, in this example, the value of the categorical is listed at the left extreme of each row, so I cannot include labels in the table. How can I do so?
Problem 2: The table I get lists the variable names as headings of each column (X1, X2,...,X6), instead of the labels for those variables. How can I include these labels in the table?
Is my approach correct here? Is there any other wayto do this?
I'd appreciate your help a lot
Best
I am trying to construct a table by stacking stored -tabstat- tables using -estpost- command.
I am doing so because I want to display rows of stats for several variables in groups that are not mutually excludable.
So far, my code reads like this
local colvars X1 X2 X3 X4 X5 X6
estpost tabstat `colvars' , s(mean p50 sd) columns(v) by(laborstate) nototal
esttab . using "tab1.tex", cells("`colvars'") replace noobs
estpost tabstat `colvars' , s(mean p50 sd) columns(v) by(educgroup) nototal
esttab . using "tab1.tex", cells("`colvars'") append noobs
estpost tabstat `colvars' , s(mean p50 sd) columns(v) by(region)
esttab . using "tab1.tex", cells("`colvars'") append
Problem 1: Each categorical variable laborstate, educgroup, region take a set of discrete values that are labeled. However, in this example, the value of the categorical is listed at the left extreme of each row, so I cannot include labels in the table. How can I do so?
Problem 2: The table I get lists the variable names as headings of each column (X1, X2,...,X6), instead of the labels for those variables. How can I include these labels in the table?
Is my approach correct here? Is there any other wayto do this?
I'd appreciate your help a lot
Best
Comment