0
$\begingroup$

Multiple regression will be performed on the following, to determine if the interaction term is significant:
1.The dependent variable A is continuous;
2.There are two independent variables, X and Y, which are Boolean.

I used lm() in R, isolating for just the interaction term.

lm(A ~ X:Y, data = SomeData)

Coefficients: (1 not defined because of singularities)
                  Estimate    Pr(>|t|)    
(Intercept)         252.04    6.42e-06 ***
XTrue:YFalse        126.57    0.0623 .  
XFalse:YFalse       156.61    0.0212 *  
XTrue:YTrue          59.32    0.3594    
XFalse:YTrue          NA         NA      

F-statistic p-value: 0.08724

How do I interpret this, when testing whether the interaction between X and Y is significant, at the 0.05 confidence level? Is this the correct way to run this?

I avoided using lm(A ~ X*Y, data = SomeData) to isolate for X:Y. Is that necessary? I have read that using step-wise regression to remove terms can affect the p-values.

The Likelihood Ratio Test returns Pr(>Chisq) = .2804

a <- lm(A ~ X+Y, data=SomeData)
b <- lm(A ~ X*Y, data=SomeData)
lmtest::lrtest(a, b)

Running the full model returns an intercept + 3 term model, with a single interaction term, XFalse:YTrue, p = 0.317

lm(A~X*Y, data=SomeData)

Which one is correct? Can I do this just using multiple regression, without using the Likelihood Ratio Test? I am worried that running multiple tests affects the p-value - is that true?

$\endgroup$
  • $\begingroup$ I think you can use likelihood ratio test. lmtest::lrtest() can test lm(A~X*Y) and lm(A~X+Y). $\endgroup$ – WCMC Aug 18 at 21:41
  • $\begingroup$ Your intercept already captures the case of $X=0$ & $Y=0$, so it should not be included. In general, interaction terms between dichotomous variables aren't a good idea. $\endgroup$ – Durden Aug 18 at 21:43
  • 1
    $\begingroup$ @Durden Why not? The interaction effect between smoking status and sex on disease is common in epi researchers. $\endgroup$ – WCMC Aug 18 at 21:44
  • $\begingroup$ Sorry, I should've been more precise: I meant interaction terms of dichotomous variables in the way Larry implemented it. After all, he's just comparing different means. His regression model should be $A = \mu + \mathbf{1}(X=1) + \mathbf{1}(Y=1) + \mathbf{1}(X=1,Y=1)$, where $\mathbf{1}$ is the indicator function. $\endgroup$ – Durden Aug 18 at 21:49
  • $\begingroup$ @Durden - I don't know how to leave out the intercept. If I add either + 0 or -1 to the call, all the significance values get crazy low. Those NA's also get replaced with real numbers. $\endgroup$ – user280191 Aug 18 at 21:51
1
$\begingroup$

Multiple websites say that the correct p-value for the significance of the interaction is given using the standard

lm(A ~ X*Y, data=SomeData)

which returns

                    Estimate  Pr(>|t|)    
(Intercept)         376.79     4.7e-09 ***
XFalse               32.03     0.631    
YTrue               -67.21     0.312    
XFalse:YTrue        -90.38     0.317 

So the p-value to use in the given hypothesis test is 0.317. (H: Is the interaction significant? Not at p < 0.05.)

If you think this is not correct, then please post the correct answer. Thanks.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ Please don't post a tentative answer & ask for comments / corrections. That isn't how SE sites work. If you want to do that, post your attempted solution as part of your question statement. $\endgroup$ – gung - Reinstate Monica Aug 19 at 11:33
  • $\begingroup$ FWIW, this is correct. XFalse:YTrue is the test of the interaction. Your p-value is .317. Scientific culture requires the use of .05 as alpha; from a purely logical point of view, you can use whatever alpha you like, but setting $\alpha\ge.32$ would be pretty strange. The interaction isn't significant. $\endgroup$ – gung - Reinstate Monica Aug 19 at 11:35
  • $\begingroup$ Thanks. (If you are referring to my answer, "Is the interaction significant" is quoting the hypothesis." I'm updating to clarify. ) $\endgroup$ – user280191 Aug 19 at 18:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy