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