You can use either summarize or mean, but just define the p values matrix for one set of results and not the other.
Res.:
Code:
sysuse auto, clear estimates clear eststo v1: mean weight price if foreign eststo v2: mean weight price if !foreign mat pval= r(table)["pvalue", 1...] estadd mat pval=pval esttab v*, cells(b(fmt(3) star pval(pval)) se(par fmt(2))) /// mlab(Domestic Foreign, lhs(Variables)) collab(none) nonumb /// addnote("Standard errors in parentheses." "Significance stars only shown for foreign cars.")
Code:
. esttab v*, cells(b(fmt(3) star pval(pval)) se(par fmt(2))) /// > mlab(Domestic Foreign, lhs(Variables)) collab(none) nonumb /// > addnote("Standard errors in parentheses." "Significance stars only shown for foreign cars.") -------------------------------------------- Variables Domestic Foreign -------------------------------------------- weight 2315.909 3317.115*** (92.32) (96.43) price 6384.682 6072.423*** (558.99) (429.49) -------------------------------------------- N 22 52 -------------------------------------------- Standard errors in parentheses. Significance stars only shown for foreign cars.
Comment