multiple_regression
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 [2019/05/21 21:31] – [e.g.] hkimscil | multiple_regression [2019/11/01 08:36] – [Resources] hkimscil | ||
---|---|---|---|
Line 153: | Line 153: | ||
| | | | ||
| a Dependent Variable: bankbook | | a Dependent Variable: bankbook | ||
+ | |||
+ | |||
+ | ====== Slope test ====== | ||
b에 대한 (coefficients) 유의도 테스트는 t-test를 이용하여 한다. t-test는 기본적으로 트리트먼트효과 (독립변인효과 혹은 차이)를 랜덤에러인 standard error로 나누어서 구하므로, | b에 대한 (coefficients) 유의도 테스트는 t-test를 이용하여 한다. t-test는 기본적으로 트리트먼트효과 (독립변인효과 혹은 차이)를 랜덤에러인 standard error로 나누어서 구하므로, | ||
- | + | 독립변인이 하나일 경우에 구한 t 값은 해당 리그레션 모델의 F test값의 제곱근을 씌운 값이 된다. 독립변인이 둘 이상인 경우에는 독립변인 간의 상관관계가 존재하는 경우가 대다수이므로 t 값의 제곱이 꼭 F 값이 되지는 않는다. | |
+ | |||
+ | ====== Beta coefficients ====== | ||
+ | [[:beta coefficients]] 혹은 Standardized coefficients 참조 | ||
====== e.g., ====== | ====== e.g., ====== | ||
Line 322: | Line 328: | ||
</ | </ | ||
- | ====== | + | ====== |
+ | see https:// | ||
+ | |||
+ | < | ||
+ | RSS = 3:10 #Right shoe size | ||
+ | LSS = rnorm(RSS, RSS, 0.1) #Left shoe size - similar to RSS | ||
+ | cor(LSS, RSS) # | ||
+ | |||
+ | 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) | ||
+ | </ | ||
+ | |||
+ | |||
+ | < | ||
+ | > LSS = rnorm(RSS, RSS, 0.1) #Left shoe size - similar to RSS | ||
+ | > cor(LSS, RSS) # | ||
+ | [1] 0.9994836 | ||
+ | > | ||
+ | > 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 | ||
+ | | ||
+ | |||
+ | Coefficients: | ||
+ | Estimate Std. Error t value Pr(> | ||
+ | (Intercept) | ||
+ | LSS -14.162 | ||
+ | RSS | ||
+ | --- | ||
+ | Signif. codes: | ||
+ | |||
+ | Residual standard error: 7.296 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: | ||
+ | | ||
+ | -6.055 -4.930 -2.925 | ||
+ | |||
+ | Coefficients: | ||
+ | Estimate Std. Error t value Pr(> | ||
+ | (Intercept) | ||
+ | LSS | ||
+ | --- | ||
+ | Signif. codes: | ||
+ | |||
+ | Residual standard error: 7.026 on 6 degrees of freedom | ||
+ | Multiple R-squared: | ||
+ | F-statistic: | ||
+ | |||
+ | > | ||
+ | </ | ||
+ | |||
+ | |||
+ | ====== The problem of "which one is entered first?" | ||
__그림 여기쯤 수록__ | __그림 여기쯤 수록__ | ||
Line 420: | Line 502: | ||
* https:// | * https:// | ||
* http:// | * http:// | ||
+ | |||
+ | https:// | ||
+ | |||
+ | |||
{{tag> " | {{tag> " | ||
+ |
multiple_regression.txt · Last modified: 2024/06/12 08:36 by hkimscil