BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
burtsm
Calcite | Level 5

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

1 ACCEPTED SOLUTION

Accepted Solutions
RichardinOz
Quartz | Level 8

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

View solution in original post

2 REPLIES 2
RichardinOz
Quartz | Level 8

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

burtsm
Calcite | Level 5

Thank you for your response, Richard!  My mind was drawing a blank on how to do this.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 2 replies
  • 380 views
  • 0 likes
  • 2 in conversation