1
$\begingroup$

I'd like to estimate the unique effects for each variable in a linear model, however I am unsure if I calculating these correctly.

I am using a model estimated using each of the variables in my data plus a binary interaction with each variable, e.g. y ~ x + x:z where x is a vector and z is two factors which is present in x. Doing this in R I believe a two levels factor is simply c(0,1).

From what understand I can calculate the individual effects of the variables for each case of the binary interaction term is as follows:

  • When the interaction term is 0, the variable effect of x on y is the estimated model coefficient for x
  • When the interaction term is 1, the variable effect of x on y is the estimated model coefficient for x plus the coefficient for the interaction term of x:z

Assuming this is correct I would also like to calculate the standard errors associated with the each effect. I looked at this question which states that the associated standard errors can be calculated as follows sqrt(x + x:z + 2*cov(x,x:z)). This however produces much smaller standard errors compared to the non-interaction term effects. This makes me assume I am doing something wrong. Could you tell me the correct way to estimate these effects?

$\endgroup$

1 Answer 1

1
$\begingroup$

First, doesn't R give you the standard errors?

Second, it is very rarely sensible to include an interaction term without the main effects that are part of that interaction. Except in very unusual circumstances, I think you should be including z in the model.

Why?

Well here are predicted values for y from $y = b_0 + b_1*x + b_2*z$

x z y

0 0 $b_0$

0 1 $b_0$

100 0 $b_0 + 100b_1$

100 1 $b_0 + 100b_1 + 100b_2$

So, you are forcing there to be no effect of z when x is 0. Is this what you want?

$\endgroup$
3
  • $\begingroup$ Sorry I should have wrote that z is also in x. What I specifically want is the effect sizes for each of the variables in x given z. $\endgroup$ Commented Mar 29, 2012 at 19:31
  • $\begingroup$ R does give the standard errors but not for the unique effects as far as I can tell. $\endgroup$ Commented Mar 29, 2012 at 19:38
  • $\begingroup$ Please name all your predictor variables. I can't make sense of "z is two factors which is present in x." $\endgroup$
    – rolando2
    Commented Mar 30, 2012 at 0:14

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.