Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Excluding cases vs convert data missing yielding different results

    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
    Code:
    svy: prop s1_q1 if s1_q1 != 4
    which I thought would work fine. I was curious so I decided to convert the cases to missing
    Code:
    replace s1_q1 = . if s1_q1 == 4
    then I ran the analyses again.
    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?

  • #2
    you should not use "if" qualifier with svy; here is a quote from the help file: " Warning: Using if or in restrictions will often not produce correct variance estimates for subpopulations. To compute estimates for subpopulations, use the subpop() option." other than that, I don't find what you say to be clear so, as the FAQ recommends, you should post the output if you still have a problem/question when you use the subpop option

    Comment

    Working...
    X