I have data with anthropometics (e.g. weight, height, waist cercumference...) and blood samples (e.g. insulin, glucose, triglycerids....) and I use them as outcomes in my lineary regression.
In order to compare these measurements, I have standardarized all variables (and some in sex-specific z-scores, where differences between gender occured)
I have used the egen command to standarize all variables e.g.:
egen float z_insulin = std(finsulin), mean(0) sd(1)
egen float z_gluc0 = std(fglucose) if sex==0, mean(0) sd(1)
egen float z_gluc1 = std(fglucose) if sex==1, mean(0) sd(1)
Now I want to combine these 3 standardarized variables into 1 new combined standarized variable (z_insu_gluco) and i have tried this command:
egen float z_insu_gluc = std(z_insulin, z_gluc0, z_gluc1), mean(0) sd(1)
stata gives an error: z_insulin, z_gluc0, z_gluc1 invalid name
then i have tried without comma separation and the error is: z_insulinz_gluc0z_gluc1 not found.
How do I correctly combine these 3 variables into a new standarized variable?
Thanks
Related Posts with Summing z scores in a new combined standardized variable stata
How to check for orthogonality in a DiD framwork?Hi guys, while going trough some papers which used the DiD, I came across one paper in which it is m…
combining and/or expressionsGood afternoon, I have a panel dataset with observations from different countries and different year…
Help me with fixed effect model please! Many thanksHello I am planning to run a fixed effect model in stata. However I would like to discuss here 1) wh…
ivregress for binary variablesHi All. I am analyzing data from a trial looking at the impact of treatment on prognosis (i.e. dead…
Assigning colors to box plot with stratificationDear Forum, I would like to box plot sCD163 over HIV status (positive vs. negative) (i) stratified …
Subscribe to:
Post Comments (Atom)
0 Response to Summing z scores in a new combined standardized variable stata
Post a Comment