Announcement

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

  • Getting contrasts after regression with multiple imputation and complex survey design / mimrgns

    Hi,

    I am using a large-scale survey dataset with a complex survey design. I have also used multiple imputation to account for missing data.

    Now, I am trying to run a regression model on the imputed data, taking into account its complex survey design. I would then like to conduct a hypothesis test to determine whether people at, say, the 25th and 75th percentiles of BMI had the same value of the outcome variable. However, I am not sure how to conduct this test, given that my data are both multiply imputed and have a complex survey design.

    To conduct this analysis in a non-survey, non-mi context, I think I would use something like:

    reg smoker BMI
    margins, at((p25) BMI) at((p75) BMI) contrast(atcontrast(r._at) marginswithin)

    To conduct the regression in the mi/svyset context, I think I would use this for the regression model:
    mi estimate: svy: reg smoker BMI

    However, I am not sure how to conduct the postestimation test of whether people at the 25th and 75 percentiles are the same on the outcome. Is there a way to do this using ssc's -mimrgns-, or some other method? (I can see in the current -mimrgns- help file a note that it doesn't support contrast, although I also found this thread here noting that mimrgns now has support for contrast operators:

    http://www.statalist.org/forums/foru...updated-on-ssc

    Many thanks in advance for any help. I very much appreciate it.




  • #2
    Currently, mimrgns does not support the atcontrast() suboption. From a quick glance, I think it should, and I will implement this in an updated version when I find the time. Until then, you might want to implement this yourself.

    Code:
    capture program drop mimargins
    program mimargins , eclass properties(mi)
        version 12.1
        svy : regress attack bmi
        margins , at((p25) bmi) at((p75) bmi) ///
            contrast(atcontrast(r._at) marginswithin) ///
            vce(unconditional) post
    end
    
    mi estimate : mimargins whatever
    Note that I added the vce(unconditional) option that you probably want to use with survey data.

    Best
    Daniel
    Last edited by daniel klein; 07 Aug 2016, 14:56.

    Comment


    • #3
      Dear Daniel,

      Thank you so much for this very helpful response. I was able to run this code and generate the contrasts. I greatly appreciate it.

      Many thanks,
      Kate

      Comment

      Working...
      X