BookmarkSubscribeRSS Feed
Amalik
Calcite | Level 5

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?

 

4 REPLIES 4
Ksharp
Super User

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.

 

Amalik
Calcite | Level 5
Hi,

Can you please write the code that I can use, as I am unsure on how to do it.
FreelanceReinh
Jade | Level 19

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.

PGStats
Opal | Level 21

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).

PG

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1026 views
  • 2 likes
  • 4 in conversation