是否有 SAS 函数可以删除缺少某个问题值的受访者? [英] Is there a SAS function for removing respondents who are missing values for one question?

查看:23
本文介绍了是否有 SAS 函数可以删除缺少某个问题值的受访者?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试对与特定变量相关的数据集进行分析,但只有一半的调查受访者提出了这个问题.SAS 中是否有一个函数可以让我从当前数据集创建一个新数据集,但只包括那些回答了感兴趣的问题的人?

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?

推荐答案

data responded_Question_42;
  set survey_responses;
  where not missing(Answer_42);
run;

也可以在分析的时候直接使用where子句,例如:

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;

这篇关于是否有 SAS 函数可以删除缺少某个问题值的受访者?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆