Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# st: probing interactions with continuous variables with mi test / mi test transform

 From Justina Kamiel Grayman To statalist@hsphsun2.harvard.edu Subject st: probing interactions with continuous variables with mi test / mi test transform Date Thu, 9 Jun 2011 12:34:44 -0400

```i am doing some postestimation tests on multiply imputed data. i am
having trouble writing the syntax to test whether coefficients at 1
standard deviation below the mean(called "sdb" below), 1 standard
deviation above the mean (called "sda" below), and at the mean of a
continuous variable (called "avg" below) are different in a regression
involving the interaction between a continuous variable (knowlmleC)
and a dichotomous variable (bsent3ae). i would like to test 1) whether
each of these three coefficients (at 1 sd above, 1 sd below, and at
the mean) are equal to zero and 2) whether they are statistically
different from each other. here is my syntax.

*syntax to test whether the three coefficients are equal to zero
mi estimate (sdb: _b[bsent3ae] + _b[knowlmleCXbsent3ae]*79.35) ///
(avg:_b[bsent3ae] + _b[knowlmleCXbsent3ae]*100.55) ///
(sda:_b[bsent3ae] + _b[knowlmleCXbsent3ae]*121.75), saving(modund): ///
regress understanding ///
ageyearC female foreignborn bsgyfedC bsgedumC latino bsent3aa bsent3ab
trustmleC knowlmleC knowlmleCXbsent3ae ///
mi test sdb avg sda ///

an error occurred when mi estimate executed regress on m=1
r(111);

*syntax to test whether the three coefficients are equal
mi estimate (diff1: 1sda - avg) (diff2: 1sdb - avg), saving(modund): ///
regress understanding ///
ageyearC female foreignborn bsgyfedC bsgedumC latino bsent3aa bsent3ab
regionne regionse regionwest urbanicityurban urbanicityrural ///
privateschool schoolseskindahigh schoolseskindalow schoolseslow ///
trustmleC knowlmleC knowlmleCXbsent3ae ///
mi testtransform diff1 diff2

an error occurred when mi estimate executed regress on m=1
r(111);

*syntax to test whether the three coefficients are equal (more
complicated & i believe you can't do this because of all of the
brackets/parenthesis)
mi estimate: [diff1: (_b[bsent3ae] + _b[knowlmleCXbsent3ae]*79.35) -///
(_b[bsent3ae] + _b[knowlmleCXbsent3ae]*100.55)] ///
[diff2: (_b[bsent3ae] + _b[knowlmleCXbsent3ae]*121.75) -///
(_b[bsent3ae] + _b[knowlmleCXbsent3ae]*100.55)], saving(modund) ///
regress understanding ///
ageyearC female foreignborn bsgyfedC bsgedumC latino bsent3aa bsent3ab
regionne regionse regionwest urbanicityurban urbanicityrural ///
privateschool schoolseskindahigh schoolseskindalow schoolseslow ///
trustmleC knowlmleC knowlmleCXbsent3ae ///
mi testtr diff1 diff2///