Bond, Stephen
2010-May-19 14:16 UTC
[R] how to remove interactions of factor with continuous var
I need to remove certain interactions and keep only the one between the second level of the factor and the continuous var t2 bin4 <- glm(resp2~ t*t2+c5.vrm,data=dfa,family="quasibinomial")> summary(bin4)Call: glm(formula = resp2 ~ t * t2 + c5.vrm, family = "quasibinomial", data = dfa) Deviance Residuals: Min 1Q Median 3Q Max -6.5464 -3.0720 -1.8135 0.4896 28.9207 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -1.492379 0.147779 -10.099 < 2e-16 *** t2 1.381409 0.193110 7.153 1.19e-11 *** t3 0.223979 0.275389 0.813 0.416898 t4 -1.751518 0.495391 -3.536 0.000494 *** t5 -2.455172 0.913674 -2.687 0.007747 ** t6 -2.347207 1.131134 -2.075 0.039120 * t2 -0.030819 0.013144 -2.345 0.019914 * c5.vrm 0.427088 0.140085 3.049 0.002574 ** t2:t2 -0.015909 0.007292 -2.182 0.030174 * t3:t2 -0.016170 0.010479 -1.543 0.124218 t4:t2 0.024352 0.016900 1.441 0.151009 t5:t2 -0.012071 0.034230 -0.353 0.724680 t6:t2 -0.041797 0.047106 -0.887 0.375880 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for quasibinomial family taken to be 41.75819) Trying with - t3:t2 etc did not work neither did putting quotes around the terms. I need to have the continuous var c5.vrm same for all levels of the factor so estimating separate equations for each level will not work. I could use offset, but seems quite an ugly solution, there should be a way to specify exactly which interactions are desired. Thank you all. Stephen Bond [[alternative HTML version deleted]]