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
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$?anscombe
(i.e. just cut and paste one line at a time into R and see what it's doing). $\endgroup$