问题
I'm trying to run analysis on a data set relating to a particular variable, but the question was only asked to half the respondents of the survey. Is there a function in SAS that would allow me to make a new data set from the current data set, but only including those who responded to the question of interest?
回答1:
data responded_Question_42;
set survey_responses;
where not missing(Answer_42);
run;
You can also use the where clause directly at the time of analysis, for example:
Proc FREQ data=survey_responses;
where not missing(Answer_42);
table Answer_42 Answer_43 Answer_44;
run;
来源:https://stackoverflow.com/questions/56691248/is-there-a-sas-function-for-removing-respondents-who-are-missing-values-for-one