Hello everyone,
I’m using estout from SSC.
Stata ver. 18
I would like to create a table where I can have two sets of significance "stars" for two different p-values and use this table in a LaTeX environment.
One group of significance "stars" would be for the differences between two categories for the same gender group (***), and another one for the differences between gender (+++).
I've been searching for solutions but haven't have a lot of luck so far. I would appreciate it if anyone has any tips to reach this result.
I've been using esttab to generate all of my tables.
I'm attaching an example of how my code looks so far by using the bplong dataset.
My goal would be to add another comparison between both genders with bp == 1 and between those with bp == 2.
So, difference between male and female with bp == 1; and difference between male and female with bp == 2 and add the significance levels with +, ++, +++ while keeping the current ones (*, **, ***).
.
I’m using estout from SSC.
Stata ver. 18
I would like to create a table where I can have two sets of significance "stars" for two different p-values and use this table in a LaTeX environment.
One group of significance "stars" would be for the differences between two categories for the same gender group (***), and another one for the differences between gender (+++).
I've been searching for solutions but haven't have a lot of luck so far. I would appreciate it if anyone has any tips to reach this result.
I've been using esttab to generate all of my tables.
I'm attaching an example of how my code looks so far by using the bplong dataset.
My goal would be to add another comparison between both genders with bp == 1 and between those with bp == 2.
So, difference between male and female with bp == 1; and difference between male and female with bp == 2 and add the significance levels with +, ++, +++ while keeping the current ones (*, **, ***).
Code:
. sysuse bplong (Fictional blood-pressure data) . . eststo m1: mean bp if sex == 0 & when == 1 Mean estimation Number of obs = 60 -------------------------------------------------------------- | Mean Std. err. [95% conf. interval] -------------+------------------------------------------------ bp | 159.2667 1.473469 156.3183 162.2151 -------------------------------------------------------------- . . eststo m2: mean bp if sex == 0 & when == 2 Mean estimation Number of obs = 60 -------------------------------------------------------------- | Mean Std. err. [95% conf. interval] -------------+------------------------------------------------ bp | 155.5167 1.967891 151.5789 159.4544 -------------------------------------------------------------- . . eststo m3: mean bp if sex == 1 & when == 1 Mean estimation Number of obs = 60 -------------------------------------------------------------- | Mean Std. err. [95% conf. interval] -------------+------------------------------------------------ bp | 153.6333 1.38596 150.86 156.4066 -------------------------------------------------------------- . . eststo m4: mean bp if sex == 1 & when == 2 Mean estimation Number of obs = 60 -------------------------------------------------------------- | Mean Std. err. [95% conf. interval] -------------+------------------------------------------------ bp | 147.2 1.515979 144.1665 150.2335 -------------------------------------------------------------- . . eststo m5: mean bp if sex == 0 Mean estimation Number of obs = 120 -------------------------------------------------------------- | Mean Std. err. [95% conf. interval] -------------+------------------------------------------------ bp | 157.3917 1.236031 154.9442 159.8391 -------------------------------------------------------------- . . mat pval= r(table)["pvalue", 1...] . . estadd mat pval=pval added matrix: e(pval) : 1 x 1 . . eststo m6: mean bp if sex == 1 Mean estimation Number of obs = 120 -------------------------------------------------------------- | Mean Std. err. [95% conf. interval] -------------+------------------------------------------------ bp | 150.4167 1.064357 148.3091 152.5242 -------------------------------------------------------------- . . mat pval= r(table)["pvalue", 1...] . . estadd mat pval=pval added matrix: e(pval) : 1 x 1 . . esttab , main(b) aux(sd) ------------------------------------------------------------------------------------------------------------ (1) (2) (3) (4) (5) (6) Mean Mean Mean Mean Mean Mean ------------------------------------------------------------------------------------------------------------ bp 159.3*** 155.5*** 153.6*** 147.2*** 157.4*** 150.4*** (11.41) (15.24) (10.74) (11.74) (13.54) (11.66) ------------------------------------------------------------------------------------------------------------ N 60 60 60 60 120 120 ------------------------------------------------------------------------------------------------------------ b coefficients; sd in parentheses * p<0.05, ** p<0.01, *** p<0.001
Comment