Hi all,
Students where requested to complete a survey but some students didn't answer all the questions (Question1 to Question12). The survey consist of 12 questions. I want to create a variable to flag ( variable name: complete) students that didn't answer three or more questions from the survey.
The questions that are not answered are coded as missing "."
The variable names for the questions are question1 = item1, question2= item2, question3= item3 etc.
For example,
Appreciate your assistance in writing up the sas code. Through array?
Thanks,
Sofia
Obviously, this is untested, since I can't see your data
data want;
set have;
complete = (n(of item:) > 9);
run;
And what should happen if exactly 10 answers are correct?
Posting data in usable form helps us to provide tested code.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.