I am doing some analyses on survey data and we are trying to exclude one level from a 4 level variable. To do this I originally ran the code
which I thought would work fine. I was curious so I decided to convert the cases to missing
then I ran the analyses again.
.
What is weird is that the exclusion code I ran had one less observation than the convert to missing code (537 vs 538). The convert to missing has the accurate number of cases (538) but I am not sure why excluding the same cases yielded a different result. Has anyone else tried this or know why it produces different results while effectively doing the same thing?
Code:
svy: prop s1_q1 if s1_q1 != 4
Code:
replace s1_q1 = . if s1_q1 == 4
Code:
svy: prop s1_q1
What is weird is that the exclusion code I ran had one less observation than the convert to missing code (537 vs 538). The convert to missing has the accurate number of cases (538) but I am not sure why excluding the same cases yielded a different result. Has anyone else tried this or know why it produces different results while effectively doing the same thing?
Comment