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
inquire about Stata rule for abbreviation of variablesFor example, in the dataset, the variable name is Armani_premium. And no var name is Armani. But so…
Manipulating with many filesHello! I have 12 files from years from 2006 to 2017 and I have one code that I want to run in all of…
Comparing variables across rowsHi all, I'm not a frequent Stata user and got stuck on something that I think ought to be fairly si…
Help with extracting strings using regular expressionsHi Statalist. I am trying to use regexs and regexm to extra information from strings. A sample is b…
interpret margin effects after logit regressionsI want to interpret the economic significance of the margin effects. I have the following commands, …
Subscribe to:
Post Comments (Atom)
0 Response to Summing z scores in a new combined standardized variable stata
Post a Comment