Hi All,
I have made a table of t-tests using the code below, which I borrowed from an example in the Stata manual.
The example is here: https://www.stata.com/manuals/tablesexample4.pdf
I would like to use the collect stars command to replace the last column, which currently shows p-values, with a column showing significance stars.
The Stata help file indicates that the command should be something like:
I have tried many different versions of the collect stars command with _r_p replaced with item names from the example below (e.g., p Difference), but I can't seem to get it to work.
Does anyone know how to do this? I would prefer to have the stars in a separate column rather than attached to something.
Thanks,
Jeremy
I have made a table of t-tests using the code below, which I borrowed from an example in the Stata manual.
The example is here: https://www.stata.com/manuals/tablesexample4.pdf
I would like to use the collect stars command to replace the last column, which currently shows p-values, with a column showing significance stars.
The Stata help file indicates that the command should be something like:
Code:
collect stars _r_p 0.01 "**" 0.05 "*"
Does anyone know how to do this? I would prefer to have the stars in a separate column rather than attached to something.
Thanks,
Jeremy
Code:
use https://www.stata-press.com/data/r18/nhanes2l collect create ex4 quietly: collect r(N_1) r(mu_1) r(N_2) r(mu_2) r(p): by race, sort: ttest bpsystol, by(sex) collect remap result[N_1 mu_1] = Males collect remap result[N_2 mu_2] = Females collect remap result[p] = Difference collect style header Males Females Difference, title(name) collect layout (race) (Males Females Difference) collect label levels Males N_1 "N" mu_1 "Mean BP" collect label levels Females N_2 "N" mu_2 "Mean BP" collect label levels Difference p "p-value" collect style column, dups(center) width(equal) collect style cell, halign(center) collect style cell Males[mu_1] Females[mu_2] Difference[p], nformat(%5.2f) collect preview
Comment