How do we winsorize variables using standard deviation instead of percentiles in SAS? Let's say we want to winsorise VarX at 3.5 standard deviations?How do we do that in SAS?
PROC MEANS can easily get MEAN and STD.
After that , [ mean-3.5*std , mean+3.5*std ] is the range you need, and next thing you can do by data step is very easy.
I strongly recommend you to read Rick Wicklin's 2017 blog article "Winsorization: The good, the bad, and the ugly" before you start modifying your data. This article contains a link to another one (from 2015) in Rick's blog which is titled "How to Winsorize data in SAS", but it also points out that Winsorization can be inappropriate, especially when done improperly.
Trimmed and Winsorized statistics require the removal or replacement of an equal number of observations at both ends of the variable range. Doing otherwise will bias location estimates.These statistics have been greatly improved on by more modern robust measures.
If you suspect your data of containing outliers, you should rely on robust location and scale estimates such as the median (location) and Qn (scale).
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.