Announcement

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

  • "Invalid psu variable name" error with mi svyset prefix

    Hi, I am getting an error when attempted to svyset data and run a logistic regression after multiple imputation. I ran 20 multiple imputations. Then, I svyset the data as a whole. Then, when trying to run a logistic regression with the prefix "mi svyset," the error arises "invalid psu variable name r(111);". Output is below. I am confused because I was not aware I need to enter the psu when running the logistic regression command; I was under the impression I only needed to enter "mi svyset" as a prefix. I tried entering the psu as part of the prefix, but that also gave me the same error message.
    Thank you in advance!


    mi svyset c5varunit [pweight=w5cgfinwgt0], strata(c5varstrat)

    pweight: w5cgfinwgt0
    VCE: linearized
    Single unit: missing
    Strata 1: c5varstrat
    SU 1: c5varunit
    FPC 1: <zero>

    mi svyset logistic cac5diffinc chi5medicare edudummy martstatdummy che5health c5dgender chd5age cdc5hlphrsdy hispdummy crl5dyourrace5 crl5dyourrace4 crl5dyourrace3 crl5dyourrace2 crl5dyourrace1
    logistic cac5diffinc chi5medicare edudummy martstatdummy che5health c5dgender chd5age cdc5hlphrsdy
    hispdummy crl5dyourrace5 crl5dyourrace4 crl5dyourrace3 crl5dyourrace2 crl5dyourrace1
    invalid psu
    variable name

    r(111);


  • #2
    Originally posted by Andrew Steward View Post
    Then, when trying to run a logistic regression with the prefix "mi svyset," [...]
    You only svyset your dataset once. The prefix(es) for estimation should then be

    Code:
    mi estimate : svy : ...

    Comment


    • #3
      Thank you so much!
      I believe this worked.

      Now my results are non-significant, but that's the way it goes in doing science...
      Thank you again

      Comment

      Working...
      X