Quantcast
Viewing all articles
Browse latest Browse all 310

Convert a numeric value to missing for multiple variables

I have a dataset with 8200 observations and 33 questions.

When any of the values for questions q1-q33 equals 9 (numeric), I want to set it to missing value (.)

I know I can write syntax in a data step:
if q1 = 9 then nq1 = .;
if q2 = 9 then nq2 = .;
etc....

Is there a better & less cumbersome way to this?

Viewing all articles
Browse latest Browse all 310

Trending Articles