Hi there!
I want to check whether a treatment effect differs across population subgroups. To this aim, I estimate several models that include an interaction terms and store their results in a matrix. Since I want to show the estimates for the interaction terms and the subgroup indicator in a joint row, I use the matrix-approach instead of exporting stored estimation results direclty with esttab, which would put the estimates for every variable in a new row. While this is neat in most situtations, I need a more condensed table that shows the estimation results for every subgroup in a new column.
But there are a few details that I haven't yet figured out:
Best wishes,
Kaja
I want to check whether a treatment effect differs across population subgroups. To this aim, I estimate several models that include an interaction terms and store their results in a matrix. Since I want to show the estimates for the interaction terms and the subgroup indicator in a joint row, I use the matrix-approach instead of exporting stored estimation results direclty with esttab, which would put the estimates for every variable in a new row. While this is neat in most situtations, I need a more condensed table that shows the estimation results for every subgroup in a new column.
But there are a few details that I haven't yet figured out:
- How can I add significance stars to the table?
- Is there an automatic way to put parentheses around the standard errors?
- I would prefer the second, fourth and last row to have no labels and put a respective explanation on the standard errors in the footnote instead. How can I do that?
Best wishes,
Kaja
Code:
*MWE
use http://www.stata.com/data/jwooldridge/eacsap/nls81_87
*prepare matrix:
cap qui mat drop Mat
mat Mat = J(6, 2,.)
matrix colnames Mat = "Black" "In Manufacturing"
mat rownames Mat = "Work experience" " " "Subgroup effect" " " "Interaction effect" " "
mat list Mat
*estimate whether treatment effect differs for specific population subgroups:
areg wage c.exper##i.black i.year, absorb(id)
matrix Mat[1,1]=e(b)[1,1] //b
matrix Mat[2,1]=r(table)[2,1] //se
*subgroup:
matrix Mat[3,1]=r(table)[1,3] //b
matrix Mat[4,1]=r(table)[2,3] //se
*interaction:
matrix Mat[5,1]=r(table)[1,5] //b
matrix Mat[6,1]=r(table)[2,5] //se
areg wage c.exper##i.manuf i.year, absorb(id)
matrix Mat[1,2]=e(b)[1,1] //b
matrix Mat[2,2]=r(table)[2,1] //se
*subgroup:
matrix Mat[3,2]=r(table)[1,3] //b
matrix Mat[4,2]=r(table)[2,3] //se
*interaction:
matrix Mat[5,2]=r(table)[1,5] //b
matrix Mat[6,2]=r(table)[2,5] //se
*export table:
estout matrix(Mat, fmt(%9.2fc)) using "MWE.tex", replace ///
style(tex) label mlabels(,none) collabels("Black" "In manufacturing")

Comment