Hello,

I am having trouble standardizing to standardize some panel data from VDEM. The data doesn't seem to change much before and after I standardize. I thought that if I specified a mean of 0 and a standard deviation of 1, that the max of the new variable would be 1 and the min would -1, but that doesn't happen. The data is still kind of messy. For example, in one of my variables, the max before standardization is 3.882 and after it's 2.925161. And the min goes from -3.625 to -2.212299 . And the mean goes from -.3923272 to 2.65e-09. I'm assuming 2.65e-09 is close enough to 0. That doesn't seem very standard to me.
The code I am using is:
In general:
Code:
egen newvar = std(oldvar), mean(0) sd(1)
Code:
    foreach variable in varlist {
    egen `variable'std = std(`variable'), mean(0) sd(1)
    sum `variable'std
 }
I was worried that my loop was wrong but I tried doing them invidually too to check if the numbers change. I didn't include a data example because I didn't think it would be helpful in this but let me know if it would be. Is there a way to standardize variables to make the max 1 and the min -1?

Thank you very much!