본문 바로가기
R/R Commander

R Commander - Statistics - Fit Model - Linear Regression (3) - 'R Squared'

by 거인과난쟁이 2011. 8. 22.

regression1.xlsx
다운로드

회귀분석을 통해서 산출되는 값들에 대한 해석을 많은 사람들이 어려워한다. 나 또한 어려움을 겪고 있다. 값의 뜻을 파악하는 것은 어렵지 않을 수 있다. 하지만, 그 값이 의미하는 바를 확신하지 못하기 때문일 것이다.

이른바 R 값들이 있다: R-squared(R의 제곱값), Adjust R-squared(수정된 R의 제곱값), R-squared의 루트값 등
크게보아 분포값과 회귀함수의 직선값을 비교하는데 필요한 계수이다.
1. 값의 분포가 회귀함수 직선 위에 있으면 계수가 1이 된다(오차값에 대한 고려가 필요하지 않다는 뜻이다)
2. 값의 분포가 회귀함수 직선으로부터 위-아래로 펴져있으며, 그 값이 불규칙하게 퍼져있거나 멀어져 있는 정도가 심해지면 값이 점차 1에서 0의 방향으로 이동한다. 0의 값으로 이동하여, 만약 0.6/0.7/0.8 등으로 값이 나온다면, 회귀함수로 설명할 수 있는 설명력이 그 수치라는 뜻이다.

<Rplot 1의 값에 관한 설명이다>

Call:
lm(formula = y1 ~ x1, data = Dataset)

Residuals:
       Min         1Q     Median         3Q        Max
-1.626e-15 -4.142e-16  1.246e-16  6.024e-16  1.270e-15

Coefficients:
             Estimate Std. Error   t value Pr(>|t|)   
(Intercept) 1.000e+00  4.655e-16 2.148e+15   <2e-16 ***
x1          1.000e+00  5.120e-17 1.953e+16   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 8.567e-16 on 13 degrees of freedom
Multiple R-squared:     1,    Adjusted R-squared:     1
F-statistic: 3.815e+32 on 1 and 13 DF,  p-value: < 2.2e-16

Rplot1-1.pdf
다운로드

<Rplot 2_1의 값에 관한 설명이다>

Call:
lm(formula = y2_1 ~ x2, data = Dataset2)

Residuals:
    Min      1Q  Median      3Q     Max
-0.5333 -0.5333  0.4667  0.4667  0.4667

Coefficients:
            Estimate Std. Error t value Pr(>|t|)   
(Intercept)  0.53333    0.29118   1.832     0.09 . 
x2           1.00000    0.03203  31.225  1.3e-13 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.5359 on 13 degrees of freedom
Multiple R-squared: 0.9868,    Adjusted R-squared: 0.9858
F-statistic:   975 on 1 and 13 DF,  p-value: 1.3e-13

Rplot2_1.pdf
다운로드

<Rplot 2_3의 값에 관한 설명이다>

Call:
lm(formula = y2_3 ~ x2, data = Dataset2)

Residuals:
    Min      1Q  Median      3Q     Max
-3.5048 -1.8262 -0.1476  1.7810  4.3524

Coefficients:
            Estimate Std. Error t value Pr(>|t|)   
(Intercept)   1.6476     1.3144   1.253 0.232106   
x2            0.7857     0.1446   5.435 0.000114 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 2.419 on 13 degrees of freedom
Multiple R-squared: 0.6944,    Adjusted R-squared: 0.6709
F-statistic: 29.54 on 1 and 13 DF,  p-value: 0.0001141

Rplot2_3.pdf
다운로드

<Rplot 2-4의 값에 관한 설명이다>

Call:
lm(formula = y2_4 ~ x2, data = Dataset2)

Residuals:
   Min     1Q Median     3Q    Max
-4.233 -2.983 -2.133  3.217  5.467

Coefficients:
            Estimate Std. Error t value Pr(>|t|)  
(Intercept)   2.7333     2.0226   1.351  0.19962  
x2            0.7000     0.2225   3.147  0.00772 **
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 3.722 on 13 degrees of freedom
Multiple R-squared: 0.4324,    Adjusted R-squared: 0.3887
F-statistic: 9.902 on 1 and 13 DF,  p-value: 0.007721

Rplot2_4.pdf
다운로드


https://rcmdr.tistory.com/130

 

1. Linear regression...

통계 > 적합성 모델 > 선형 회귀... Statistics > Fit models > Linear regression... carData 패키지에서 제공하는 Prestige 데이터셋을 불러와서 활성화시키자. 그러면, 위의 화면처럼 <선형 회귀...> 기능이..

rcmdr.kr