Hi All,
I hope this message finds you well. I was wondering if there is any way to select participants who answered the cesd question more than once. Thanks!
| ID | cesd1 | cesd2 | cesd3 | cesd4 | cesd5 | |
| 1 | . | 0 | . | 1 | 2 | keep |
| 2 | . | . | . | . | 5 | delete |
| 3 | 1 | . | . | . | . | delete |
| 4 | . | 1 | . | 2 | . | keep |
| 5 | 0 | 2 | 1 | 2 | 4 | keep |
Assuming the variables are numeric you can use the N() function to see how many non-missing values there are.
data want;
set have;
if n(of cesd1-cesd5)<2 then delete;
run;
Assuming the variables are numeric you can use the N() function to see how many non-missing values there are.
data want;
set have;
if n(of cesd1-cesd5)<2 then delete;
run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.