1
$\begingroup$

This is my R code and running result:(See below)

How to judge is the linear regression model appropriate for this data set? Except R^2 value, Can the

p-value in last row of the running result mean something? What does this p-value mean and can it mean the linear regression model appropriate for this data set? Why?

Thanks in advance.

x=c(7,12,10,10,14,25,30,25,18,10,4,6)    
y=c(128,213,191,178,205,446,540,547,324,117,75,107)    
list(x,y)    
reg1 <- lm(y~x)    
summary(reg1)    
plot(x, y)
abline(reg1)    
reg2 <- lm(y~x-1)    
reg2    
summary(reg2)
#------------------    
Call:
lm(formula = y ~ x)

Residuals:
    Min      1Q  Median      3Q     Max 
-55.805 -21.085   3.139  14.946  80.859 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  -22.753     21.846  -1.041    0.322    
x             19.556      1.335  14.652 4.38e-08 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 37.23 on 10 degrees of freedom
Multiple R-squared:  0.9555,    Adjusted R-squared:  0.951 
F-statistic: 214.7 on 1 and 10 DF,  p-value: 4.38e-08
$\endgroup$
2
  • 3
    $\begingroup$ You can't really assess the suitability of the regression assumptions from this output; try plot(reg1) (that's a clickable link, by the way) as a first step. As for what a p-value means, try this (the first sentence here has a basic definition). $\endgroup$
    – Glen_b
    Commented Sep 9, 2013 at 1:18
  • 1
    $\begingroup$ (Note that the p-value at the bottom is the p-value of the null that all the coefficients - bar the intercept - are zero.) For a clear illustration of the danger of just using regression output like the above, try working your way line by line through the example code at the bottom of ?anscombe (i.e. just cut and paste one line at a time into R and see what it's doing). $\endgroup$
    – Glen_b
    Commented Sep 9, 2013 at 6:05

1 Answer 1

2
$\begingroup$

In the interests of making sure this has an answer, I'm turning my comments into one:

You can't really assess the suitability of the regression assumptions from this output; try plot(reg1) (see here) as a first step, which produces a number of useful diagnostics relating to the suitability of the assumptions.

For a clear illustration of the danger of just using regression output like the above, try working your way line by line through the example code at the bottom of ?anscombe (i.e. just cut and paste one line at a time into R and see what it's doing). There's a collection of data sets with the same regression output, only one of which has its assumptions satisfied; the others all have some problem - a different one in each case.

More details about this data set are in Wikipedia, here.

As for what a p-value means, the first sentence of the relevant Wikipedia article has the following:

the p-value is the probability of obtaining a test statistic result at least as extreme as the one that was actually observed, assuming that the null hypothesis is true.

...which is pretty much word for word how I define it when someone asks.

There's more details at this question.

Note that the p-value at the bottom of the output is the p-value of the null that all the coefficients - bar the intercept - are zero.

It cannot tell you that the linear regression model is appropriate for this data set, in the sense that it can be very low while the assumptions are unsatisfied.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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