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:53] – [Slope test] hkimscil | regression [2024/09/30 01:13] (current) – [E.g., Simple regression] hkimscil | ||
---|---|---|---|
Line 23: | Line 23: | ||
상관관계에서 살펴 본것처럼, | 상관관계에서 살펴 본것처럼, | ||
- | + | \begin{eqnarray*} | |
- | $$b = \displaystyle \frac{SP}{SS_X}$$ | + | b & = & \displaystyle \frac{SP}{SS_X} |
- | $$a = \displaystyle \overline{Y} - b \overline{X} | + | a & = & \displaystyle \overline{Y} - b \overline{X} |
+ | \end{eqnarray*} | ||
+ | 참조: [[deriviation of a and b in a simple regression|리그레션에서 a와 b 구하기]] | ||
[{{: | [{{: | ||
Line 301: | Line 303: | ||
위의 표에서 (Anova table), | 위의 표에서 (Anova table), | ||
- | | for SS | for degrees of freedom | + | | @grey: |
| @white: white \\ = explained error (E) \\ = $SS{reg}$ | | @white: white \\ = explained error (E) \\ = $SS{reg}$ | ||
| @orange: orange \\ = unexplained error (U) \\ = $SS{res}$ | | @orange: orange \\ = unexplained error (U) \\ = $SS{res}$ | ||
Line 350: | Line 352: | ||
{{: | {{: | ||
{{: | {{: | ||
+ | |||
+ | <file csv acidity.csv> | ||
+ | stream spec83 ph83 | ||
+ | Moss 6 6.30 | ||
+ | Orcutt 9 6.30 | ||
+ | Ellinwood 6 6.30 | ||
+ | Jacks 3 6.20 | ||
+ | Riceville 5 6.20 | ||
+ | Lyons 3 6.10 | ||
+ | Osgood 5 5.80 | ||
+ | Whetstone 4 5.70 | ||
+ | UpperKeyup 1 5.70 | ||
+ | West 7 5.70 | ||
+ | Boyce 4 5.60 | ||
+ | MormonHollow 4 5.50 | ||
+ | Lawrence 5 5.40 | ||
+ | Wilder 0 4.70 | ||
+ | Templeton 0 4.50 | ||
+ | </ | ||
+ | < | ||
+ | df <- read.csv(" | ||
+ | </ | ||
< | < | ||
Line 768: | Line 792: | ||
따라서 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.1684885994.txt.gz · Last modified: 2023/05/24 08:53 by hkimscil