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
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
Comment