Hi all,
Is there a way to only replace certain missing values with the mean of a sample using proc standard? The data I am working with have 3 different types of missing values:
Missing Value Code | Description |
.s | Not applicable, including legitimate skips |
.m | Item nonresponse (i.e. refused, don’t know, not ascertained) |
. | System missing, including unit nonresponse |
I only want to replace missing values that indicate item nonresponse (.m) with the mean of the sample, but I am not sure how to go about it.
Thanks in advance,
Stephanie
Quick and dirty:
Create a flag that has values S M and N to match the missing values
Pass through Proc Standard
Use the S and N flag to restore the correct missing values
Richard
Quick and dirty:
Create a flag that has values S M and N to match the missing values
Pass through Proc Standard
Use the S and N flag to restore the correct missing values
Richard
Thank you for your response, Richard! My mind was drawing a blank on how to do this.
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.
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.