regression
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
regression [2023/05/24 08:41] – [E.g., 3. Simple regression: Adjusted R squared & Slope test] hkimscil | regression [2023/05/24 08:53] (current) – [Slope test] hkimscil | ||
---|---|---|---|
Line 729: | Line 729: | ||
* Why do we do t-test for the slope of X variable? The below is a mathematical explanation for this. | * Why do we do t-test for the slope of X variable? The below is a mathematical explanation for this. | ||
- | * Sampling distribution of b: | + | * Sampling distribution of error around the slope line b: |
* $\displaystyle \sigma_{b_{1}} = \frac{\sigma}{\sqrt{SS_{x}}}$ | * $\displaystyle \sigma_{b_{1}} = \frac{\sigma}{\sqrt{SS_{x}}}$ | ||
+ | * We remember that $\displaystyle \sigma_{\bar{x}} = \frac{\sigma}{\sqrt{n}}$ ? | ||
* estimation of $\sigma_{b_{1}}$ : substitute sigma with s | * estimation of $\sigma_{b_{1}}$ : substitute sigma with s | ||
+ | 만약에 error들이 (residual들) slope b를 중심으로 포진해 있고, 이것을 따로 떼어내서 distribution curve를 그려보면 평균이 0이고 standard deviation이 위의 standard error값을 갖는 normal distribution을 이루게 될 것이다. | ||
* t-test | * t-test | ||
* $\displaystyle t=\frac{b_{1} - \text{Hypothesized value of }\beta_{1}}{s_{b_{1}}}$ | * $\displaystyle t=\frac{b_{1} - \text{Hypothesized value of }\beta_{1}}{s_{b_{1}}}$ | ||
- | * Hypothesized value of beta 값은 | + | * Hypothesized value of b 값은 |
* $\displaystyle t=\frac{b_{1}}{s_{b_{1}}}$ | * $\displaystyle t=\frac{b_{1}}{s_{b_{1}}}$ | ||
* 기울기에 대한 표준오차는 (se) 아래와 같이 구한다 | * 기울기에 대한 표준오차는 (se) 아래와 같이 구한다 | ||
Line 757: | Line 757: | ||
Regression formula: y< | Regression formula: y< | ||
- | SSE = Sum of Square Error | + | SSE = Sum of Square Error = SS_residual |
기울기 beta(b)에 대한 표준오차값은 아래와 같이 구한다. | 기울기 beta(b)에 대한 표준오차값은 아래와 같이 구한다. | ||
Line 768: | Line 768: | ||
따라서 t = b / se = 3.655631 | 따라서 t = b / se = 3.655631 | ||
- | < | ||
- | y <- c(1, 1, 2, 2, 4) | ||
- | mody <- lm(y ~ x) | ||
- | </ | ||
- | |||
- | < | ||
- | > x <- c(1, 2, 3, 4, 5) | ||
- | > y <- c(1, 1, 2, 2, 4) | ||
- | > mody <- lm(y ~ x) | ||
- | > summary(mody) | ||
- | |||
- | Call: | ||
- | lm(formula = y ~ x) | ||
- | |||
- | Residuals: | ||
- | | ||
- | | ||
- | |||
- | Coefficients: | ||
- | Estimate Std. Error t value Pr(> | ||
- | (Intercept) | ||
- | x | ||
- | --- | ||
- | Signif. codes: | ||
- | |||
- | Residual standard error: 0.6055 on 3 degrees of freedom | ||
- | Multiple R-squared: | ||
- | F-statistic: | ||
- | > | ||
- | </ | ||
====== E.g., 4. Simple regression ====== | ====== E.g., 4. Simple regression ====== | ||
Another example of simple regression: from {{: | Another example of simple regression: from {{: |
regression.1684885317.txt.gz · Last modified: 2023/05/24 08:41 by hkimscil