Announcement

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

  • mi test for interaction

    Dear Statalist,

    I would like to perform a Wald test for the significance of an interaction between a categorical and splined variable following multiple imputation.

    My exposure var is C3spline (a restricted cubic spline with 3 knots), which is interacted with (tumour) grade, a 3 level categorical variable, while the binary outcome var is surgery.

    The following works fine using complete case analysis;

    Code:
    poisson surg c.c3spline*##i.grade, vce(robust) irr
    test 1.grade#c.c3spline1=1.grade#c.c3spline2=2.grade#c.c3spline1=2.grade#c.c3spline2=3.grade#c.c3spline1=3.grade#c.c3spline2=0
    However trying to do the same thing with multiply imputed data and mi test produces the following error message;

    Code:
    mi estimate, eform: poisson surg c.c3spline*##i.grade, vce(robust) 
    mi test 1.grade#c.c3spline1=1.grade#c.c3spline2=2.grade#c.c3spline1=2.grade#c.c3spline2=3.grade#c.c3spline1=3.grade#c.c3spline2=0
    
    =exp not allowed
    Your advice on this would be greatly appreciated.

  • #2
    -mi test- does not support testing the equality of two coefficients. What you have to do is calculate the difference between them and then use -mi testtransform- So something like this:

    Code:
    mi estimate (diff12: _b[1.grade#c.c3spline1]-_b[1.grade#c.c3spline2])
    mi testtransform diff12
    You can do the same with the other equations.

    Added: That said, I suspect this is not what you really want to do. It is pretty unusual to see anybody testing for the equality of several interaction coefficients. It's perfectly legal to do, but it's the answer to a question that there is rarely any reason to ask. It strikes me as more likely that you are just interested in testing whether all of the interaction coefficients are zero. That is quite simple:

    Code:
    mi test 1.grade#c.c3spline1 1.grade#c.c3spline2 ///
        2.grade#c.c3spline1 2.grade#c.c3spline2 3.grade#c.c3spline1 ///
        3.grade#c.c3spline2
    By the way, this same simplified syntax also works with ordinary, non multiply imputed, -test-.
    Last edited by Clyde Schechter; 08 Sep 2018, 22:21.

    Comment

    Working...
    X