0
$\begingroup$

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:

graph of Diversity against distance

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")

Trend lines

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
$\endgroup$
  • 2
    $\begingroup$ Could it be because of the high diversity value at distance of 300? $\endgroup$ – tom91 Aug 19 '15 at 15:45
  • 6
    $\begingroup$ 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.) $\endgroup$ – whuber Aug 19 '15 at 15:55
  • 1
    $\begingroup$ You might consider poly(x, 2) instead of x + I(x^2) to use orthogonal polynomials. $\endgroup$ – Gregor Aug 19 '15 at 16:25
  • 3
    $\begingroup$ 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. $\endgroup$ – Frank Harrell Aug 19 '15 at 16:39
  • $\begingroup$ 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. $\endgroup$ – BloXX Feb 6 at 10:53
2
$\begingroup$

I don't see anything odd here.

First, the red line and the blue line are very close to each other, which indicates that the added complexity is not likely to be worth it. We don't even need to compare the lines to the data to see that the lines are close to each other.

Second, the N is fairly small, so, a small improvement in fit is not going to be significant.

Third, as pointed out in the comments, by far the largest residual is going to be at x =300 (for both models) but for that data point, the residual is larger for the polynomial model. Since the models use squared errors, that difference makes a bigger difference.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.