Announcement

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

  • Help with registering imputed variables

    Hi all,

    I am having trouble with multiple imputation. I have a variable, z, which is an index made up of three components: z1, z2 and z3. I have complete data on the weights of these components (w1, w2 and w3), but not on the components themselves.

    Rather than imputing z directly, I impute z1, z2 and z3. Note that when z1 is missing, z2 and z3 may be present, and so on. So I impute some values of the three components. So far, I have no problems.

    The problem comes when I try to combine these imputations for imputations of the index z and include this variable in a regression. Here's what I do:

    Code:
    gen z = w1*z1+w2*z2+w3*z3
    mi register imputed z
    forval i = 1/10{
    replace _`i'_z = w1*_`i'_z1+w2*_`i'_z2+w3*_`i'_z3
    }
    This works fine, too. I get 10 new copies of z with blanks replaced with imputed values. However, when I try this:

    Code:
    mi estimate: regress y x z
    I get the following:

    Code:
    (20 values of imputed variable z in m>0 updated to match values in m=0)
    I think the variable isn't registered properly in some way, but I can't figure out what to change.

    Thanks,

    Alex

  • #2
    why are you trying to register this as "imputed" rather than, say, "passive"? in fact, why aren't you generating this via "mi passive"?

    Comment


    • #3
      Hi Rich,

      Thanks! I hadn't really looked into passive variables. That's fixed it for me.
      or me.

      Alex
      Last edited by Alex Stead; 17 Jul 2017, 08:29.

      Comment


      • #4
        Update: actually, this hasn't fixed the problem. I generate the passive variable, and now I'm just getting a message:

        Code:
        (passive variable z unregistered because not in m=0)

        Comment


        • #5
          You might have created what Stata calls super-varying variables. Run

          Code:
          mi varying
          the start with

          Code:
          help mi set
          read under the heading mi register and mi unregister.

          Stata sometimes makes things hard if they are usually a bad idea. This does not imply that what you are doing is a bad idea, but it should give you the opportunity to reflect in more detail.

          Best
          Daniel

          Comment

          Working...
          X