Explaning Interaction effect from Linear Models in R I am working on a basic routine to understand the principle of interaction effect in linear models using R. For this I am using the openintro::babies package-data,
the code:
library(tidyverse)
library(tidymodels)
babies <- openintro::babies %>% 
  drop_na() %>% 
  mutate(bwt = 28.3495 * bwt) %>% 
  mutate(weight = 0.453592 * weight) 

linear_reg() %>%
  set_engine("lm") %>%
  fit(formula = bwt ~ gestation * smoke, data= babies) %>%
  tidy()

What I am trying to find is that captures it interaction effects between gestation length and smoking to predict birth weight.
# A tibble: 4 x 5
  term            estimate std.error statistic  p.value
  <chr>              <dbl>     <dbl>     <dbl>    <dbl>
1 (Intercept)       557.      292.        1.91 5.66e- 2
2 gestation          10.5       1.04     10.1  6.27e-23
3 smoke           -2061.      489.       -4.22 2.65e- 5
4 gestation:smoke     6.54      1.75      3.74 1.94e- 4

How I tried to interpret is that since the p-values of all the coefficients including the interaction term coefficient, gestation:smoke are statistically significant, i.e. p-value < 0.05 I find an interactive relationship between the two predictor variables (gestation length and smoking). Is my claim right or are there any better ways to prove this?
 A: A few points which I hope will help not just with this, but with your understanding of statistics generally.

*

*Try not to rely on statistical significance based on an arbitrary cut-offs for p-values such as 0.05. In this particular case, the p-value is quite a lot smaller than 0.05, but imagine that your p-value was 0.0499999, or perhaps 0.0500001 - I would put it to you that these results are essentially the same, yet you might make completely different claims and make different decisions if you relied on the "magic" cutoff of 0.05


*You cannot "prove" anything with statistics. The p-values you have shown in the question are for hypothesis tests that the relevant term is different from zero. The hypothesis you are testing (the null hypothesis) is that the term is zero, and the p-value tells you the probality of observing this data, or data more extreme IF THE NULL HYPOTHESIS IS TRUE. This is very important but often overlooked.


*Given the these points, what you have found is that if there is actually no interaction, then the probability of observing this interaction or an even larger one is less than 0.0002.


*Regardless of the p-value, I would suggest that the more important information is in the term itself. The interaction is 6.5, which is quite small relative to the other terms in the model - especially the intercept and the term for smoke. It is up to you to interpret whether this is clinically significant, as opposed to statistically significant. An example I have used in teaching medical students in the past concerns a clinical trial for a drug that is intended to lower blood pressure. The results were highly statistically significant (p<0.001) but the effect size was only 0.2mmHg, which is clinically meaningless.


*Finally it is important to realise that when you include an interaction in a linear model, the interpretaion of the main effects (smoke and gestation in this case) are not the same as in the model without the interaction. With the interaction, the main effects are conditional on the other main effect being zero (or at the reference level in the case of a categorical variable). So, the term for smoke means that for every one unit change in smoke, or if it is a binary variable, the difference between smoke=0 and smoke=1 is -2061 units of whatever the scale of birth weight is measured on (perhaps gramms ?) WHEN GESTATION IS ZERO. Now gestation is never zero so that is meaningless. The usual aprproach in cases like this is to centre gestation about it's mean, so that the mean effect of smoke is conditional on the mean gestation period, not a gestation period of zero.
Hope this helps !
