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
Reshape wide to long: many variables of many yearsHi All, I have a dataset with more than 10 variables of more than 10 years in wide shape. I'm tryin…
Sargan-Hansen testHi. I am trying to obtain results for the Sargan-Hansen test. However, when I run a regression usin…
Transforming a series to be standard normal in panel dataHi all, May I have a basic question: how can I make/transform a series/variable to be standard norm…
Significant OLS results but insignificant IV results and the insignificant endogeneity testDear all, I want to explore the effects of X on Y. Considering X might be an exogenous variable, I …
Applying different colors to data points in scatter plotHi! I am trying to create a graph like the one below where I can apply different colors to data poin…
Subscribe to:
Post Comments (Atom)
0 Response to Summing z scores in a new combined standardized variable stata
Post a Comment