Stata - How to standardize your variables?
HTML-код
- Опубликовано: 21 авг 2024
- Welcome to my classroom!
This video is part of my Stata series. A series where I help you learn how to use Stata. In this video, we look at how to create standardized variables (also known as z-scores) in Stata.
Note: What I show here is my take on the topic. I would be happy to receive comments!
Useful links:
►Twitch: / steffens_classroom
►Twitter: / steff5001
►Workpage: www.rug.nl/sta...
►Subscribe: cutt.ly/Qfu9cmV
you can just include ,beta in your regression to output the beta or "standardized coefficients"
Haha, guess you learn every day!
Just a few small differences: You don't obtain the standard deviation of the coefficient this way (if you need it), and you still have to calculate them manually if you wish to get the summary statistics for the standardized variables. However, if all you need is just to produce the standardized coefficients, then this works perfectly. Thank you :)
Again very helpful! 👏
Thank you, very well explained and useful for my Stata university project where I'm standardising an income variable :)
Happy to help!
I was really confused seeing the mean being non-zero. Thank you for clearing it.
Happy to help!
excellent sir
thanks! great help
Sir, I have the data of six social media platforms from 2009 to 22, so how can I create an index for each country separately or combine the countries, which are 21 countries, so they are aggregated. Also tell me how to do normalization of data
This video is about how to standardize your variables. Other inquiries can be mailed, where a session can be booked.
What if I want to standardize data on a 0-1 scale?
Hello!
I would try something like:
sum var replace var = (var - `r(min)') / (`r(max)'-`r(min)')
You can extend this to a loop if you need to do this for many variables at once.
@@SteffensClassroom Thanks a lot! Very useful. On the same note, I am trying to rescale a 1 to 7 variable in an 11 point scale (0-10), plus I would like to reverse the variable so that the higher values become the lowest. Do you have any advise on that? I guess I should first subtract 1 from the variable, but then how do I "stretch" it to 10?
@@NathanCats777 re-scaling: use basic math ;)
For the reverse order, there is a Stata command called revrs I believe.
@@SteffensClassroom Thanks a lot, actually revrs command did not work, but I managed to do it by abs(r(max)-var) and it worked
@@NathanCats777 Happy it worked out :)
Is sd can help to reduce non normality distributed data ??? Thank you
Hi! Thanks for your question. In short: no. Standardization shifts and scales a given distribution. It does however not change its shape.
@@SteffensClassroom Thank you for your response, can you help me with any solutions to transform data to normal distribution?
Hi again,
Please mail me. Then we can discuss this further.