Stata - How to winsorize your data
HTML-код
- Опубликовано: 11 сен 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 use the winsor command to winsorize your data/variables. Often a better alternative to dropping certain observations.
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
Happy my brother had some fun editing this one -.-
Awesome job, brief and to the point. Thank you so much.
steffen legend
Thank you this was very helpful!
many thanks
Pretty good video my dude
Had a bad time near the end though
Whatever makes his day xD
Thank you
Thanx for your videos. Is there a specific criteria for choosing the cut off points here?
Hi!
Often, 5 or 10 percent is used. I need to look more into the literature, but always justify your choices.
I wanted to apply winsor2 to my thesis data and afraid it won’t be suitable.
@@bellisma77 Well, it depends on how the data looks. Do you have a lot of outliers? Is it skewed? In any case, it is a good idea to conduct your analysis with and without applying winzorizing.
@SteffensClassroom not that much outliers and i want to replace them by winsorizing with +/- 3 sigma
@@bellisma77 You just need to do it yourself, which fortunately is not very difficult in this case.
sum x
scalar low = r(mean) - 3 * r(sd)
scalar high = r(mean) + 3 * r(sd)
gen x2 = cond(x < low, low, cond(x > high & x < ., high, x))
This should do it.
If you should winsorize all continuously scaled variables, does that mean variables with 'real numbers' (stata: 'float' and 'double'), or also integer variables (in stata named 'byte', 'int', 'long')?
Be sure what you mean by continous here. You may be mixing things up here. I typically would only consider string vs numeric when it comes to winzoring, as winzoring works the same way for all numeric types in Stata (to the best of my knowledge).
@@SteffensClassroom Thanks!!
Wait but why are one of their eyes blue tho?
How to winsorize for panel data?
Afaik, same startegy. You are winsorizing prior to estimation.
Thanx for your simple and clear explaination. Is it possible to replace the values with say the mean?
winsor2 x1 if z ==1,replace(mean)? i want to replace x1 which its z =1 with the mean value. Is this correct?
Honestly, never tried. However, what is your reasoning for wanting to replace your values with the mean? It doesn't sound like a good idea.
@@SteffensClassroom i have a panel data and i detected outliers using Cook's distance, and leverages, and i want to replace these points with mean or median value. I guess using replace command will be suitable right? thank you Dr. for you reply
@@aminaahmedalibelal5676 Hi again. The replace command would of course work. My question was more like why you would like to replace the values with the mean/median. There must be a reason I am missing :)
Good luck with your project!
@@SteffensClassroom Hi. I have a percentage of 2.30% of outliers and i do not want to trim them so my panel data will not be unbalanced. Thanks for your wishes. Hope you loaded more video's on STATA.
snans blundertale.
Funny Skeleton
Sans is ness confirmation
Ketchup
Funnybones
doot
undersnail
Haha, Megalovania
Thank you