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?