Hi, I have a coding question regarding keeping records that meet the criteria where at least 80% of the data is not missing. I want to delete any records that are missing more than 20% of the data.
recode Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 Q13 Q14 Q15 Q16 Q17 Q18 Q19 Q20 Q21
Q22 Q23 Q24 Q25 Q26 (0=0) (1=1) (2=2) (3=3) (4=4)
(5=5) (777=.) (888=.) (999=.)
In this case, there are 26 variables and I want to keep only those records where 21 or more of these variables are not missing. The code I have in SPSS looks like this:
COUNT BaselineTotal=Q1 TO Q26 (1 THRU 5).
FILTER OFF.
USE ALL.
SELECT IF (BaselineTotal>=21).
EXECUTE.
Any help would be great.
Thanks.
recode Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 Q13 Q14 Q15 Q16 Q17 Q18 Q19 Q20 Q21
Q22 Q23 Q24 Q25 Q26 (0=0) (1=1) (2=2) (3=3) (4=4)
(5=5) (777=.) (888=.) (999=.)
In this case, there are 26 variables and I want to keep only those records where 21 or more of these variables are not missing. The code I have in SPSS looks like this:
COUNT BaselineTotal=Q1 TO Q26 (1 THRU 5).
FILTER OFF.
USE ALL.
SELECT IF (BaselineTotal>=21).
EXECUTE.
Any help would be great.
Thanks.
Comment