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?
lmtest::lrtest()
can testlm(A~X*Y)
andlm(A~X+Y)
. $\endgroup$