从“check all that apply”变量创建一个响应
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了从“check all that apply”变量创建一个响应相关的知识,希望对你有一定的参考价值。
Below is some code written for creating one response from survey questions where the respondent checks all that apply.
proc format; value respfmt 0='jim' 2='joe' 4='jon' 8='jan' 6='jake' 10='jack' 12='jill' 14='josh'; run; data have; input response1-response3; cards; 0 0 0 1 0 0 0 1 0 0 0 1 1 1 0 1 0 1 0 1 1 1 1 1 ; data want (drop=i); set have; array resp(*) response1-response3; format responses respfmt.; responses=0; do i=1 to 3; if resp(i) eq 1 then responses+2**i; end; run; proc print data=want; run;
以上是关于从“check all that apply”变量创建一个响应的主要内容,如果未能解决你的问题,请参考以下文章
参考:啥是变量范围,哪些变量可以从哪里访问,啥是“未定义变量”错误?