Is there a SAS function for removing respondents who are missing values for one question?

做~自己de王妃 提交于 2021-02-08 11:22:50

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!