multiple_regression
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
multiple_regression [2019/05/21 22:33] – [무엇부터? 라는 문제] hkimscil | multiple_regression [2019/05/21 22:40] – [Why overall model is significant while IVs are not?] hkimscil | ||
---|---|---|---|
Line 331: | Line 331: | ||
see https:// | see https:// | ||
- | This problem | + | < |
+ | > LSS = rnorm(RSS, RSS, 0.1) #Left shoe size - similar to RSS | ||
+ | > cor(LSS, RSS) # | ||
+ | [1] 0.9983294 | ||
+ | > | ||
+ | > weights = 120 + rnorm(RSS, 10*RSS, 10) | ||
+ | > | ||
+ | > ##Fit a joint model | ||
+ | > m = lm(weights ~ LSS + RSS) | ||
+ | > | ||
+ | > ##F-value is very small, but neither LSS or RSS are significant | ||
+ | > summary(m) | ||
+ | |||
+ | Call: | ||
+ | lm(formula = weights ~ LSS + RSS) | ||
+ | |||
+ | Residuals: | ||
+ | 1 | ||
+ | | ||
+ | 8 | ||
+ | | ||
+ | |||
+ | Coefficients: | ||
+ | Estimate Std. Error t value Pr(> | ||
+ | (Intercept) | ||
+ | LSS -27.546 | ||
+ | RSS | ||
+ | --- | ||
+ | Signif. codes: | ||
+ | |||
+ | Residual standard error: 4.508 on 5 degrees of freedom | ||
+ | Multiple R-squared: | ||
+ | F-statistic: | ||
+ | |||
+ | > | ||
+ | > ##Fitting RSS or LSS separately gives a significant result. | ||
+ | > summary(lm(weights ~ LSS)) | ||
+ | |||
+ | Call: | ||
+ | lm(formula = weights ~ LSS) | ||
+ | |||
+ | Residuals: | ||
+ | Min 1Q Median | ||
+ | -11.044 | ||
+ | |||
+ | Coefficients: | ||
+ | Estimate Std. Error t value Pr(> | ||
+ | (Intercept) | ||
+ | LSS | ||
+ | --- | ||
+ | Signif. codes: | ||
+ | |||
+ | Residual standard error: 7.282 on 6 degrees of freedom | ||
+ | Multiple R-squared: | ||
+ | F-statistic: | ||
+ | |||
+ | > | ||
+ | </ | ||
multiple_regression.txt · Last modified: 2023/10/19 08:39 by hkimscil