Dear Statalist,
I would have a couple of questions related to the new command collect stars.
First, I would like to know if it is possible to attach stars to coefficients based on custom statistics. To illustrate the point, in the example below I obtain r_p2 by dividing the p-value in half, and I would like to attach stars to the coefficients based on this (this is just an example to illustrate a more general point). The process does not seem to work (but it works if I use the p value which is automatically collected from the regress command, that is _r_p).
Second, I would like to know if it is possible to attach stars to different statistics based on different conditions (for instance, attach stars to _r_b based on _r_p, and attach stars to _r_z based on _r_p2). Again, this is not a real - life example, but this feature could be useful to attach stars to different coefficients in the table based on different tests.
Many thanks in advance!
I would have a couple of questions related to the new command collect stars.
First, I would like to know if it is possible to attach stars to coefficients based on custom statistics. To illustrate the point, in the example below I obtain r_p2 by dividing the p-value in half, and I would like to attach stars to the coefficients based on this (this is just an example to illustrate a more general point). The process does not seem to work (but it works if I use the p value which is automatically collected from the regress command, that is _r_p).
Second, I would like to know if it is possible to attach stars to different statistics based on different conditions (for instance, attach stars to _r_b based on _r_p, and attach stars to _r_z based on _r_p2). Again, this is not a real - life example, but this feature could be useful to attach stars to different coefficients in the table based on different tests.
Code:
clear all use https://www.stata-press.com/data/r17/nhanes2 quietly: collect r_p2 = r(_r_p)/2: regress bpsystol bmi i.region age collect label levels result r_p2 "r_p2" collect style showbase off collect layout (colname) (result[_r_b _r_z]) collect stars _r_p 0.01 "***" 0.05 "**" 0.1 "*", attach(_r_b) collect preview collect stars r_p2 0.01 "***" 0.05 "**" 0.1 "*", attach(_r_b) collect preview
Comment