interactions in multiple regression Flashcards
(15 cards)
What is a main effect in regression?
The effect of one predictor on the response, ignoring other variables.
Example: In Weight ~ SST + Depth, SST and Depth are main effects.
What is an interaction effect?
When the effect of one predictor on the response depends on another predictor.
Example: The impact of SST on fish weight may differ by Sediment type.
How do you specify an interaction in R?
A: Use : or * (includes main effects automatically):
How do you interpret the coefficient for an interaction term?
Continuous × Categorical: Change in slope for the categorical level.
Example: LLL:GroupB = -0.1647 → Slope for Group B is 0.1647 less than Group A.
Continuous × Continuous: Change in slope per unit increase in the other predictor.
What are the rules for including interactions?
Hierarchy Principle: Always include main effects if their interaction is in the model.
Order Matters: Interactions come last in model formulas.
Significance: If interaction is significant, keep its main effects regardless of their p-values.
How do you test if an interaction is significant?
Check the p-value of the interaction term in summary() or Anova().
How do you visualize interactions?
Categorical × Continuous: Plot separate regression lines for each group.
Continuous × Continuous: Use 3D plots or heatmaps (e.g., quilt.plot()).
What happens if you omit a main effect but keep its interaction?
Violates hierarchy → Model is hard to interpret!
R will often warn you.
How do you select models with interactions?
Backward Selection: Remove non-significant interactions first, then main effects.
Forward Selection: Add main effects first, then interactions.
How does AIC handle interactions?
Prefers simpler models unless the interaction significantly improves fit.
Compare AIC values: Lower AIC = better model.
What’s the difference between : and * in R formulas?
:: Only fits the interaction term (e.g., A:B).
: Fits main effects and interaction (e.g., AB = A + B + A:B).
How do you interpret a non-significant interaction?
The relationship between predictors is additive (no synergy/antagonism).
Action: Remove the interaction term and refit the model.
What’s an example of a continuous × continuous interaction?
Model: Weight ~ Depth + SST + Depth:SST
Interpretation: The effect of Depth on Weight depends on SST (and vice versa).
How do you write the equation for an interaction model?
Categorical × Continuous:
Y=β0+β1GroupB+β2LLL+γ(GroupB×LLL)+ϵ
Continuous × Continuous:
Y=β0+β1X1 +β2X 2+β3(X1×X2)+ϵ
Why are interactions important?
They reveal context-dependent effects (e.g., drug efficacy varies by gender, or SST’s impact on fish weight varies by sediment type).