# Interpreting ANOVA f-test for model comparison

In the book ISLR, there's a lab activity which compares the nested models.

> fit .1= lm ( wage∼age , data = Wage )
> fit .2= lm ( wage∼poly ( age ,2) , data = Wage )
> fit .3= lm ( wage∼poly ( age ,3) , data = Wage )
> fit .4= lm ( wage∼poly ( age ,4) , data = Wage )
> fit .5= lm ( wage∼poly ( age ,5) , data = Wage )
> anova ( fit .1 , fit .2 , fit .3 , fit .4 , fit .5)
Analysis of Variance Table
Model 1: wage ∼ age
Model 2: wage ∼ poly ( age , 2)
Model 3: wage ∼ poly ( age , 3)
Model 4: wage ∼ poly ( age , 4)
Model 5: wage ∼ poly ( age , 5)
Res . Df     RSS Df  Sum of Sq      F Pr ( > F )
1     2998 5022216
2     2997 4793430  1     228786 143.59 <2e -16 ***
3     2996 4777674  1      15756   9.89  0.0017 **
4     2995 4771604  1       6070   3.81  0.0510 .
5     2994 4770322  1       1283   0.80  0.3697
---
Signif . codes : 0 ’*** ’ 0.001 ’** ’ 0.01 ’* ’ 0.05 ’. ’ 0.1 ’ ’ 1


The book said

The $$p$$-value comparing linear Model 1 to the quadratic Model 2 is essentially zero ($$<10^{-15}$$), indicating that a linear fit is not sufficient. Similarly the $$p$$-value comparing quadratic Model 2 to the cubic Model 3 is very low ($$0.0017$$), so the quadratic fit is also insufficient. ...

What I would like to know of what does it mean of insufficient? insufficient of what?

It's important to understand what the hypothesis tests look like.

Model 1: E(Y) = b0 + b1x1

Model 2: E(Y) = b0 + b1x1 + b2x1(squared)

Model 3: E(Y) = b0 + b1x1 + b2x1(squared) + b3x1(cubed)

I don't have the book in front of me, so this could be different than whats in the book, but it will demonstrate the point.

Test 1 is comparing model 1 and model two by testing

Ho : B2 = 0 (Y is not related to X1(squared); true beta relating Y to X1squared is zero, after accounting for other terms (X1) in the model)

Ha: B2 not equal to 0 (Y is related to X1(squared); true beta relating Y to X1squared is nonzero, after accounting for other terms (X1) in the model)

Since x1-squared is the only difference in the models, a small p-value on this test causes us to conclude that a squared term for X1 is statistically useful for predicting the DV (i.e. after accounting for X1, there is sufficient evidence to suggest b2 is nonzero).

Next test is the same, but comparing model 3 to model 2.

Ho : B3 = 0 (Y is not related to X1(cubed); true beta relating Y to X1-cubed is zero, after accounting for other terms (X1 and X1 squared) in the model)

Ha: B3 not equal to 0 (Y is related to X1(cubed); true beta relating Y to X1cubed is nonzero, after accounting for other terms (X1 and X1 squared) in the model)

Again, small p-value means we can reject the null hypothesis at the preset alpha level and conclude that there is sufficient evidence to suggest that X1-cubed is statistically useful for predicting Y even after accounting for X1 an X1 squared, meaning that the cubic version of X1 improves the model for Y, in a statistical sense.

Keep in mind this is only "statistically" and may not equate to practical significance. They mean that in a statistical sense, the model is improved by adding the quadratic version of X1, and then on top of that, still improved by adding the cubic version of X1.