multiple_regression_examples
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
multiple_regression_examples [2020/07/06 14:53] – [E.g. 1] hkimscil | multiple_regression_examples [2020/07/06 15:59] – [E.g. 1] hkimscil | ||
---|---|---|---|
Line 242: | Line 242: | ||
</ | </ | ||
- | 이 residuals이 DV (종속변인) 설명에 얼마나 기여하는지를 보기 위해서 regression을 하면 stress 고유분의 영향력을 파악할 수 있다. | + | 삭제 -- |
+ | 이 residuals이 DV (종속변인) 설명에 얼마나 기여하는지를 보기 위해서 regression을 하면 stress 고유분의 영향력을 파악할 수 있다. 그런데 partial correlation의 정의에 따르면 partial correlation은 종속변인 또한 bmi의 영향력을 배제한 부분으로 평가를 해야 한다. 이는 위에서 분석했던 lm.happiness.bmi의 residual이 그것이다. 따라서 아래를 구해둔다. | ||
< | < | ||
- | lm.happiness.reslmstressbmi <- lm(happiness ~ res.lm.stress.bmi) | + | res.lm.happiness.bmi <- lm.happiness.bmi$residuals |
+ | </ | ||
+ | -- 삭제 | ||
+ | |||
+ | < | ||
+ | lm.happiness.reslmstressbmi <- lm(res.lm.happiness.bmi ~ res.lm.stress.bmi) | ||
summary(lm.happiness.reslmstressbmi) | summary(lm.happiness.reslmstressbmi) | ||
anova(lm.happiness.reslmstressbmi) | anova(lm.happiness.reslmstressbmi) | ||
Line 288: | Line 294: | ||
</ | </ | ||
+ | 이제 반대로 bmi 고유의 설명력을 보려면 | ||
+ | < | ||
+ | lm.bmi.stress <- lm(bmi~stress) | ||
+ | summary(lm.bmi.stress) | ||
+ | anova(lm.bmi.stress) | ||
+ | res.lm.bmi.stress <- lm.bmi.stress$residuals | ||
+ | lm.happiness.reslmbmistress <- lm(happiness ~ res.lm.bmi.stress) | ||
+ | summary(lm.happiness.reslmbmistress) | ||
+ | anova(lm.happiness.reslmbmistress) | ||
+ | </ | ||
+ | < | ||
+ | > lm.bmi.stress <- lm(bmi~stress) | ||
+ | > summary(lm.bmi.stress) | ||
+ | |||
+ | Call: | ||
+ | lm(formula = bmi ~ stress) | ||
+ | |||
+ | Residuals: | ||
+ | Min 1Q Median | ||
+ | -6.2169 -2.0524 | ||
+ | |||
+ | Coefficients: | ||
+ | Estimate Std. Error t value Pr(> | ||
+ | (Intercept) | ||
+ | stress | ||
+ | --- | ||
+ | Signif. codes: | ||
+ | |||
+ | Residual standard error: 3.059 on 28 degrees of freedom | ||
+ | Multiple R-squared: | ||
+ | F-statistic: | ||
+ | |||
+ | > anova(lm.bmi.stress) | ||
+ | Analysis of Variance Table | ||
+ | |||
+ | Response: bmi | ||
+ | Df Sum Sq Mean Sq F value | ||
+ | stress | ||
+ | Residuals 28 261.95 | ||
+ | --- | ||
+ | Signif. codes: | ||
+ | > res.lm.bmi.stress <- lm.bmi.stress$residuals | ||
+ | > lm.happiness.reslmbmistress <- lm(happiness ~ res.lm.bmi.stress) | ||
+ | > summary(lm.happiness.reslmbmistress) | ||
+ | |||
+ | Call: | ||
+ | lm(formula = happiness ~ res.lm.bmi.stress) | ||
+ | |||
+ | Residuals: | ||
+ | | ||
+ | -1.97283 -0.94440 | ||
+ | |||
+ | Coefficients: | ||
+ | Estimate Std. Error t value Pr(> | ||
+ | (Intercept) | ||
+ | res.lm.bmi.stress -0.05954 | ||
+ | --- | ||
+ | Signif. codes: | ||
+ | |||
+ | Residual standard error: 1.353 on 28 degrees of freedom | ||
+ | Multiple R-squared: | ||
+ | F-statistic: | ||
+ | |||
+ | > anova(lm.happiness.reslmbmistress) | ||
+ | Analysis of Variance Table | ||
+ | |||
+ | Response: happiness | ||
+ | Df Sum Sq Mean Sq F value Pr(>F) | ||
+ | res.lm.bmi.stress | ||
+ | Residuals | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | Multiple R-squared: | ||
+ | F-statistic: | ||
+ | </ | ||
+ | stress: 8.1% | ||
+ | bmi: 1.78% | ||
+ | 만이 독립변인의 고유영향력이고 이를 제외한 | ||
+ | 82.17 - (9.88) = 72.29 가 | ||
+ | 공통영향력이라고 하겠다. | ||
multiple_regression_examples.txt · Last modified: 2023/10/21 13:26 by hkimscil