1

What does the r-squared value indicate in the lm() function in r.

How to interprete it with the coefficients and p value. Following is an example of the output i got for summary of linear model I build for Auto data

Call:
lm(formula = mpg ~ ., data = data)

Residuals:
    Min      1Q  Median      3Q     Max 
-9.5903 -2.1565 -0.1169  1.8690 13.0604 

Coefficients:
               Estimate Std. Error t value Pr(>|t|)    
(Intercept)  -17.218435   4.644294  -3.707  0.00024 ***
cylinders     -0.493376   0.323282  -1.526  0.12780    
displacement   0.019896   0.007515   2.647  0.00844 ** 
horsepower    -0.016951   0.013787  -1.230  0.21963    
weight        -0.006474   0.000652  -9.929  < 2e-16 ***
acceleration   0.080576   0.098845   0.815  0.41548    
year           0.750773   0.050973  14.729  < 2e-16 ***
origin         1.426141   0.278136   5.127 4.67e-07 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 3.328 on 384 degrees of freedom
Multiple R-squared:  0.8215,    Adjusted R-squared:  0.8182 
F-statistic: 252.4 on 7 and 384 DF,  p-value: < 2.2e-16

1 Answers1

0

If the p value is less than 0.05, it means that the intercept has a significant effect.

cylinders = -0.493376 means every 1 unit change for cylinders is equivalent to -0.493376 change in mpg values.

Residual standard error: 3.328 on 384 degrees of freedom Residual values mean it can play around +- 3.328.

Pr(>|t|) cylinders = 0.12780 indicates the significance of the coefficients, while p-value: < 2.2e-16 indicates the significance of the model.

Adjusted R-squared: 0.8182 Indicates the significance of the model at the 95% confidence level.

Esad
  • 24