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
Help needed in loopsHi all, I am using Stata 17 and would need some help in my loops. Below is an example of my dataset…
Dummy variable omitted due to collinearityHello, I am doing a 3sls regression on int remittance and poverty among developing countries. So, fo…
Transforming datatableHi! I have a question about transforming my data table. I have a table with 3 variables: postal co…
Uncertainty Indexi am trying to construct an uncertainty index using STATA and would like help with commands …
How to insert control variables and the command 'by' in xtabond2 ?Hello all, I am doing a research on the Persistence of Profit in the banking sector in 14 emerging c…
Subscribe to:
Post Comments (Atom)
0 Response to Summing z scores in a new combined standardized variable stata
Post a Comment