I'm a bit stuck on running a GLM between 3 continuous variables in R. I can't make them categorical as it removes the significance. I have two questions.

I'm analysing data on eggs.

I had read that you could control for variables by adding them in using + like so:

m1 <- glm(Volume ~ Altitude + Breadth)

However, I have since been told that saying in my results that

Volume significantly declines as Altitude increases, when controlling for Breadth

isn't a correct statement. Is it? I was told the following:

The language works in that it IS controlling for it by taking it into account in the model as a fixed effect, BUT it isn’t removing it from the analysis entirely as your sentence suggested.

I'm very confused as I have read on this forum people advising to control variables by adding them in like this.

If I can't control for the variable, I can do an interaction. But for this purpose I had been advised to stay away from them as they are so difficult to explain. However if I can't control for Breadth then I don't have much choice.

m1 <- glm(Volume ~ Altitude*Breadth) 

How would you explain this interaction? I was going with

For any given breadth, Volume decreases as Altitude increase

but apparently this isn't right either. The model summary is as below

Please let me know if you would like any more information!

glm(formula = Volume ~ Altitude * Breadth)

Deviance Residuals: 
     Min        1Q    Median        3Q       Max  
-0.24775  -0.10975  -0.01984   0.06765   0.46698  

                   Estimate Std. Error t value Pr(>|t|)    
(Intercept)      -8.5941878  2.2616181  -3.800 0.000461 ***

Altitude          0.0080269  0.0033141   2.422 0.019829 *  
Breadth           0.8964839  0.1913092   4.686 2.93e-05 ***
Altitude:Breadth -0.0007117  0.0002800  -2.542 0.014801 *  
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 

(Dispersion parameter for gaussian family taken to be 0.02604406)

    Null deviance: 3.0980  on 45  degrees of freedom
Residual deviance: 1.0939  on 42  degrees of freedom
AIC: -31.449

Number of Fisher Scoring iterations: 2

Including an extra predictor in a regression is often described as controlling for it when discussing the coefficient estimates for another predictor of interest, so your first description is unexceptionable & doesn't carry any implication of "removing it from the analysis entirely"—how would you do that? Of course in this case you're assuming it has a linear effect on the response, & no interaction with the predictor of interest; you can check both assumptions. It might be good advice to concentrate on understanding the mathematical form of the model before worrying over the nuances of verbal descriptions:

$$\operatorname{E} Y = \beta_0 + \beta_1 x_1 + \beta_2 x_2$$

where $\operatorname{E} Y$ is expected volume, $x_1$ altitude, & $x_2$ breadth; $\beta_0$ is the intercept, $\beta_1$ the slope for altitude, & $\beta_2$ the slope for breadth. Experiment with plotting it for different values of the parameters & predictors, & you'll see that $\beta_1$ is the slope of the altitude vs volume plot for any breadth whatsoever.

The model with interaction contains an extra term:

$$\operatorname{E} Y = \beta_0 + \beta_1 x_1 + \beta_2 x_2 + \beta_{12} x_1x_2$$

Now $\beta_1 + \beta_{12}x_2$ is the slope of the altitude vs volume plot; still linear but dependent on the breadth (breadth is said to moderate the effect of altitude on volume). For some breadths volume increases with altitude; for others volume decreases with altitude: the breadth for which volume is a constant function of altitude can be found by solving $\beta_1+\beta_{12}x_2=0$ for $x_2$. If such relationships seem implausible, note they may be outside the range of applicability of the model.

If the interaction term's statistically significant at 1% & the difference in predictions between the two models is practically significant, it'd be silly to use the model without interaction because interaction's "difficult to explain". Plotting altitude vs volume for various different breadths gets the idea across.

† See also posts here & here & the entertaining paper cited by @EMS: Achen (2005), "Let’s Put Garbage-Can Regressions and Garbage-Can Probits Where They Belong", Conflict Management and Peace Science, 22, p.327. It's important to realize that stuffing linear terms for "control variables" into a regression model doesn't give you a carte blanche to claim the coefficients for "variables of interest" represent their causal effects on the response.

| cite | improve this answer | |
  • $\begingroup$ Scortchi, thanks so much for the response. To be honest we have never really been told to focus on the mathematical form of the models. I'm at a much more entry level. Are you saying I could say that I controlled for it? And that would be right? I could potentially say that for a given breadth, volume decreases with altitude. I understand I should use interactions when they are available as they explain more of the variance. But I'm afraid I'm still not understanding how I would describe it. Would I just say 'Volume decreases as altitude increases, with the effect moderated by breadth'? $\endgroup$ – restats Apr 22 '14 at 15:19
  • $\begingroup$ @restats: Even at entry level, as long as you've covered addition & multiplication you should be able to understand the models - else what's the point in fitting them? Plot them out over relevant predictor values & describe what you see. $\endgroup$ – Scortchi - Reinstate Monica Apr 22 '14 at 16:02
  • $\begingroup$ E.g. for breadths below $\frac{-\beta_1}{\beta_{12}}\approx 11.3$, volume increases with altitude according to the model with interaction - though this may be far outside the range of breadths you're interested in. $\endgroup$ – Scortchi - Reinstate Monica Apr 22 '14 at 16:19
  • $\begingroup$ it's not far outside the range. How did you figure out at which point the relationship changes? $\endgroup$ – restats Apr 22 '14 at 19:39
  • $\begingroup$ Well... 8 values out of 48 are less than 11.3... $\endgroup$ – restats Apr 22 '14 at 19:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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