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:52] – hkimscil | multiple_regression_examples [2020/07/06 15:04] – [E.g. 1] hkimscil | ||
---|---|---|---|
Line 283: | Line 283: | ||
</ | </ | ||
+ | < | ||
+ | Multiple R-squared: | ||
+ | F-statistic: | ||
+ | </ | ||
+ | 이제 반대로 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