# Polynomial regression providing odd p-values

I have the data:

Distances   Diversity
-300        3.532833
-300        3.319447
-300        3.331814
-300        3.284599
-150        3.167693
-150        3.343932
-150        3.400182
-150        3.347922
-50         3.185409
-50         3.590527
-50         3.163942
-50         3.102254
50         3.382986
50         2.78799
50         3.204374
50         2.756762
150        2.784996
150        3.206704
150        2.431388
150        2.911236
300        2.10763
300        2.393464
300        3.527539
300        2.552804


After investigating the data it seems that there is a slightly curved relationship:

I have performed a simple polynomial regression and linear regression with the code:

m1 <- lm(Diversity ~ Distances + I(Distances^2), data = Data)
m2 <- lm(Diversity ~ Distances, data = Data)


However the output shows that the linear model is a better predictor with a p-value of <0.001 while the polynomial is not significant (p>0.1).

This confuses me as the predicted values from m1 seem to better match the trend shown in the data:

 plot(Diversity ~ Distances)
lines(lowess(Diversity ~ Distances))
lines(Distances, predict(m1), col = "red")
lines(Distances, predict(m2), col = "blue")


can someone explain why the p values suggest that the polynomial regression is such a poor predictor?

Summary (m1):

Call:
lm(formula = Diversity ~ Distances + I(Distances^2), data = Data.Col)

Residuals:
Min       1Q   Median       3Q      Max
-0.50157 -0.12025 -0.04278  0.11443  0.91834

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept)     3.131e+00  9.027e-02  34.689  < 2e-16 ***
Distances      -1.305e-03  3.221e-04  -4.051 0.000576 ***
I(Distances^2) -1.454e-06  1.685e-06  -0.863 0.397985
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.309 on 21 degrees of freedom
Multiple R-squared:  0.4496,    Adjusted R-squared:  0.3971
F-statistic: 8.576 on 2 and 21 DF,  p-value: 0.001894


Summary(m2): Call: lm(formula = Diversity ~ Distances, data = Data.Col)

Residuals:
Min       1Q   Median       3Q      Max
-0.57667 -0.15650 -0.00791  0.08949  0.84323

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept)  3.0757678  0.0627046  49.052  < 2e-16 ***
Distances   -0.0013049  0.0003203  -4.074 0.000503 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.3072 on 22 degrees of freedom
Multiple R-squared:  0.4301,    Adjusted R-squared:  0.4042
F-statistic:  16.6 on 1 and 22 DF,  p-value: 0.0005031

• Could it be because of the high diversity value at distance of 300? – tom91 Aug 19 '15 at 15:45
• How, exactly, does the output from your linear model (which is not shown) indicate it is "a better predictor"? Which p-values are you looking at, and why do you think they are related to predictability? (You also ought to consider a model in which the conditional variance increases with distance, because there is evidence of such heteroscedasticity.) – whuber Aug 19 '15 at 15:55
• You might consider poly(x, 2) instead of x + I(x^2) to use orthogonal polynomials. – Gregor Aug 19 '15 at 16:25
• I don't see how that will help. You can see from the output that the adjusted $R^2$ goes down for the larger model, indicating that the nonlinearity does not add enough to be worth it. You could likely have a power problem due to the small sample size. If you think the nonlinear fit is more realistic, use it regardless of significance. – Frank Harrell Aug 19 '15 at 16:39
• I think @tom91 comment goes in the right direction: by just looking at the scatterplot you can guess, that this point the point $(300,3.53)$ will be a high leverage point to which the polynomial regression fits worse. I guess by deleting it you will see a dramatic increase of the $R^2$ and probably get significant regressors from the polynomial fit. however, just deleting points which don't fit well with the model in mind is not the correct way of doing statistics. you need to justify such a step. – BloXX Feb 6 at 10:53