0
$\begingroup$

I estimate two models using the same data:

lm(Z ~ X,     data = W)  # Model 1
lm(Z ~ X + Y, data = W)  # Model 2

I am trying to test whether the coefficient on X differs across the two models.

In other words,

let A = the coefficient on X in Model 1 
B = the coefficient on X in Model 2, 

I want to test:

H0: A = B

Any advice on (a) what I would want to use and (b) how to use it in R?

$\endgroup$
1
  • $\begingroup$ it's to compare models, not to compare coefficients. imagine, X is something without effect, but Y has effect ... $\endgroup$
    – jogo
    Oct 31, 2015 at 19:10

2 Answers 2

0
$\begingroup$

This would be logically equivalent to testing for the coefficient B being zero in a model that already had an estimate for A, and this in turn would be tested by running an ANOVA for a significant difference between the two models. The R lm() function would normally use treatment contrasts and the first variable, X, going from left to right would be added first, so the summary results from the second model should useful information.

$\endgroup$
-1
$\begingroup$

if you want to know if the coefficient for X predicting Z changes when you estimate the coefficient for Y [predicting Z], then you're testing for collinearity. in other words, your theory is actually:

H: X ~~ Y

So,

cor(x, y) 
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.