Hi everyone,
I'm here to ask your help as I'm having a hard time replicating the following table: https://i.imgur.com/AbDL7IR.png
In order to do so, I thought about storing a tabstat and a ttest command:
But as you can see, the result is not really the same. I can manage to place the tabstat statistics and the mean difference of the t-test on the same line, but as I try to add the p-value beneath the mean difference (and ONLY beneath it, not under the other stats) the lines get messed up. Substantially, my question is: is there a way to work with cells() in such a way I can place p-values under only a column's value?
Thank you in advance.
I'm here to ask your help as I'm having a hard time replicating the following table: https://i.imgur.com/AbDL7IR.png
In order to do so, I thought about storing a tabstat and a ttest command:
Code:
​sysuse auto, clear eststo a: quietly estpost tabstat price - gear_ratio, stat(count mean sd p25 median p75) columns(stat) eststo diff: quietly estpost ttest price - gear_ratio, by(foreign) unequal esttab a diff, cells("count (pattern(1 0) fmt(0)) mean(pattern(1 0) fmt(2)) sd(pattern(1 0)fmt(2)) p25(pattern(1 0) fmt(2)) p50(pattern(1 0)fmt(2)) p75(pattern(1 0) fmt(2)) b( pattern(0 1)fmt(2))" p(par pattern(0 1)fmt(2))) /// nonumbers noobs
Thank you in advance.
Comment