Hello,
I am working with nationally representative biomarker data and thus am working through a number of syntax issues in trying to obtain adjusted geometric mean estimates for biomarkers at each level of a grouping variable. I am using Stata 14 regress commands (log-transformed biomarker data serve as the outcome variables). I would like to adjust for age (continuous), sex (binary), race/ethnicity (4 categories), creatinine (continuous), and then get the geometric means adjusted for these variables by the grouping variable following execution of the regression command. My syntax looks something like this:
svy, subpop(if eligible==1): regress biomarker_ln c.age i.sex i.Race c.Creat i.Group, eform(exp(Coef.))
This is giving me exponentiated regression coefficients, which I believe are the geometric mean differences for a given covariate in the model.
Example:
biomarker_ln | exp(Coef.) Std. Err. t P>|t| [95% Conf. Interval]
---------------+----------------------------------------------------------------
age | 1.017817 .0046482 3.87 0.000 1.008723 1.026993
sex
female | 1.281597 .157293 2.02 0.044 1.006924 1.631196
Race2|
Non-white | .6388515 .1125512 -2.54 0.011 .4518855 .903174
Creat | .8179233 .0441127 -3.73 0.000 .7356647 .9093796
|
Group |
1 | .0006994 .0001183 -42.95 0.000 .0005015 .0009752
2 | 1.400022 .229586 2.05 0.041 1.014303 1.932421
3 | 1.159951 .2028994 0.85 0.397 .8225093 1.635831
_cons | 920.7408 246.3742 25.51 0.000 544.1887 1557.848
After reading through many tutorials (including this helpful summary: https://www3.nd.edu/~rwilliam/stats/Margins01.pdf) and through the very long and daunting manual for the margins command, I think, to get the adjusted means for the ln values, I would run: margins Group - which gives this:
------------------------------------------------------------------------------
| Delta-method
| Margin Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
Group |
1 | 7.292628 .1147933 63.53 0.000 7.067023 7.518232
2 | .0272855 .1228874 0.22 0.824 -.2142263 .2687973
3 | 7.629115 .1155252 66.04 0.000 7.402073 7.856158
4 | 7.441005 .1305297 57.01 0.000 7.184474 7.697536
Now, assuming I am correctly interpreting that this would result in the ln means of "biomarker" adjusted for the covariates in the model I had specified (age, sex, race, creat) - I would need to exponentiate each of the four group values in order to obtain the resulting geometric mean. I cannot find a way to do this in a code-based, straightforward manner in Stata 14. (i.e., eform won't work).
I am wondering if anyone on the forum may be able to confirm that my interpretation of this issue is correct, and if so, if they are aware of a reasonably straightforward, code-based way in which to get the exponentiated values for the margins obtained in this postestimation command? Other alternative code suggestions are options, too.
Thanks in advance,
Danielle Smith
I am working with nationally representative biomarker data and thus am working through a number of syntax issues in trying to obtain adjusted geometric mean estimates for biomarkers at each level of a grouping variable. I am using Stata 14 regress commands (log-transformed biomarker data serve as the outcome variables). I would like to adjust for age (continuous), sex (binary), race/ethnicity (4 categories), creatinine (continuous), and then get the geometric means adjusted for these variables by the grouping variable following execution of the regression command. My syntax looks something like this:
svy, subpop(if eligible==1): regress biomarker_ln c.age i.sex i.Race c.Creat i.Group, eform(exp(Coef.))
This is giving me exponentiated regression coefficients, which I believe are the geometric mean differences for a given covariate in the model.
Example:
biomarker_ln | exp(Coef.) Std. Err. t P>|t| [95% Conf. Interval]
---------------+----------------------------------------------------------------
age | 1.017817 .0046482 3.87 0.000 1.008723 1.026993
sex
female | 1.281597 .157293 2.02 0.044 1.006924 1.631196
Race2|
Non-white | .6388515 .1125512 -2.54 0.011 .4518855 .903174
Creat | .8179233 .0441127 -3.73 0.000 .7356647 .9093796
|
Group |
1 | .0006994 .0001183 -42.95 0.000 .0005015 .0009752
2 | 1.400022 .229586 2.05 0.041 1.014303 1.932421
3 | 1.159951 .2028994 0.85 0.397 .8225093 1.635831
_cons | 920.7408 246.3742 25.51 0.000 544.1887 1557.848
After reading through many tutorials (including this helpful summary: https://www3.nd.edu/~rwilliam/stats/Margins01.pdf) and through the very long and daunting manual for the margins command, I think, to get the adjusted means for the ln values, I would run: margins Group - which gives this:
------------------------------------------------------------------------------
| Delta-method
| Margin Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
Group |
1 | 7.292628 .1147933 63.53 0.000 7.067023 7.518232
2 | .0272855 .1228874 0.22 0.824 -.2142263 .2687973
3 | 7.629115 .1155252 66.04 0.000 7.402073 7.856158
4 | 7.441005 .1305297 57.01 0.000 7.184474 7.697536
Now, assuming I am correctly interpreting that this would result in the ln means of "biomarker" adjusted for the covariates in the model I had specified (age, sex, race, creat) - I would need to exponentiate each of the four group values in order to obtain the resulting geometric mean. I cannot find a way to do this in a code-based, straightforward manner in Stata 14. (i.e., eform won't work).
I am wondering if anyone on the forum may be able to confirm that my interpretation of this issue is correct, and if so, if they are aware of a reasonably straightforward, code-based way in which to get the exponentiated values for the margins obtained in this postestimation command? Other alternative code suggestions are options, too.
Thanks in advance,
Danielle Smith
Comment