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
poly(x, 2)
instead ofx + I(x^2)
to use orthogonal polynomials. $\endgroup$