์ธ๋ฏธํ๋ก์ ํธ02 ์๊ด๋ถ์
3. ๋ณ์ ์์ ๋ ธ์ธ ์ธ๊ตฌ ๋น์จ ์๊ด๋ถ์
str(total) plot(total$count, total$pop_old_be, xlab="๋ณ์ ์", ylab="๋
ธ์ธ์ธ๊ตฌ ์") cor(total$count,total$pop_old_be) #cor -0.5877963 ์์ ์๊ด๊ด๊ณ
[์ด์์น] ํ๋ ๋ฐ๊ฒฌ(=์์ธ ๊ฐ๋จ๊ตฌ) y์ถ์์ ์ค์๊ฐ์ด๊ณ , true random variation์ด ์๋๋ผ๋ ์ฆ๊ฑฐ๊ฐ ์์ผ๋ฏ๋ก ์ ๊ฑฐํ์ง ์๋๋ค.
๋ณ์ ์์ ๋
ธ์ธ ์ธ๊ตฌ ๋น์จ ๋จ์ํ๊ท๋ถ์
old = lm(formula = count ~ pop_old_be, total) summary(old)
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 797.323 43.216 18.45 <2e-16 ***
pop_old_be -21.818 1.866 -11.69 <2e-16 ***
Residual standard error: 257.9 on 259 degrees of freedom
Multiple R-squared: 0.3455, Adjusted R-squared: 0.343
F-statistic: 136.7 on 1 and 259 DF, p-value: < 2.2e-16
4. ์ถ๊ฐ๋ถ์
๊ทธ๋ ๋ค๋ฉด ์์ ์ ๋น์จ์ ๋ณ์ ์์ ๊ด๋ จ์ด ์์๊น?
plot(total$count, total$pop_child_be, xlab="๋ณ์ ์", ylab="์์ ์์ธ๊ตฌ ์") cor(total$count,total$pop_child_be) #cor 0.3487594 ์์ ์๊ด๊ด๊ณ
๋ณ์ ์์ ์์ ์ ์ธ๊ตฌ ๋น์จ ๋จ์ํ๊ท๋ถ์
child = lm(formula = count ~ pop_child_be, total) summary(child)
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -86.199 71.553 -1.205 0.229
pop_child_be 45.140 7.537 5.989 7.03e-09 ***
Residual standard error: 298.8 on 259 degrees of freedom
Multiple R-squared: 0.1216, Adjusted R-squared: 0.1182
F-statistic: 35.87 on 1 and 259 DF, p-value: 7.032e-09
๋ณ์ ์์ ๋น๋
ธ์ธ ์ธ๊ตฌ ์๊ด๋ถ์
cor(total$count,total$pop_be) #cor 0.6180532 ์์ ์๊ด๊ด๊ณ plot(total$count, total$pop_be, xlab="๋ณ์ ์", ylab="๋น ๋
ธ์ธ์ธ๊ตฌ ์")
๋ณ์ ์์ ๋น๋
ธ์ธ,๋น์์ ์ ์ธ๊ตฌ ๋จ์ํ๊ท๋ถ์
peo = lm(formula = count ~ pop_be, total) summary(peo)
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -1686.939 159.986 -10.54 <2e-16 ***
pop_be 29.069 2.297 12.65 <2e-16 ***
Residual standard error: 250.6 on 259 degrees of freedom
Multiple R-squared: 0.382, Adjusted R-squared: 0.3796
F-statistic: 160.1 on 1 and 259 DF, p-value: < 2.2e-16