using_dummy_variables
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| using_dummy_variables [2015/11/04 09:36] – hkimscil | using_dummy_variables [2019/10/18 10:18] (current) – hkimscil | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | |||
| - | | | Sum of Squares | ||
| - | | Between Groups | ||
| - | | Within Groups | ||
| - | | Total | 8073671.998 | ||
| - | |||
| - | |||
| ====== Categorical variables ====== | ====== Categorical variables ====== | ||
| - | ====== 2 groups | + | ===== 2 groups ===== |
| data: | data: | ||
| - | {{: | + | {{: |
| - | {{:elemapi2_Categoriies.sps}} | + | {{:elemapi2_categories.sps}} |
| + | |||
| + | {{: | ||
| + | in r < | ||
| < | < | ||
| Line 21: | Line 17: | ||
| meals 6 pct free meals | meals 6 pct free meals | ||
| ell 7 english language learners | ell 7 english language learners | ||
| - | yr_rnd 8 year round school 무방학학교 | + | yr_rnd 8 year round school 무방학학교 |
| mobility 9 pct 1st year in school | mobility 9 pct 1st year in school | ||
| acs_k3 10 avg class size k-3 | acs_k3 10 avg class size k-3 | ||
| Line 52: | Line 48: | ||
| </ | </ | ||
| - | ''' | + | | **Model Summary** ||||| |
| | Model | R | R Square | | Model | R | R Square | ||
| | 1 | .475a | 0.226 | 0.224 | 125.3 | | 1 | .475a | 0.226 | 0.224 | 125.3 | ||
| | a. Predictors: (Constant), year round school | | a. Predictors: (Constant), year round school | ||
| - | ANOVA(b) | + | | **ANOVA(b)** ||||||| |
| | Model | | Model | ||
| | 1 | Regression | | 1 | Regression | ||
| Line 65: | Line 61: | ||
| - | Coefficients(a) | + | | **Coefficients(a)** ||||||| |
| | | | Unstandardized Coefficients | | | | Unstandardized Coefficients | ||
| | Model | | Model | ||
| Line 102: | Line 98: | ||
| </ | </ | ||
| - | ''' | + | | **Report** |||| |
| - | |api 2000 |||| | + | | api 2000 |||| |
| | year round school | | year round school | ||
| | No | 684.54 | | No | 684.54 | ||
| Line 111: | Line 107: | ||
| 이와 같이 종류변인(category, | 이와 같이 종류변인(category, | ||
| - | ====== 3 or more groups | + | ===== 3 or more groups ===== |
| 만약에 ANOVA 테스트에서와 같이 종류가 3개 이상인 변인은 어떻게 처리해야 할까? 아래는 이를 regression으로 테스트 한 결과이다. | 만약에 ANOVA 테스트에서와 같이 종류가 3개 이상인 변인은 어떻게 처리해야 할까? 아래는 이를 regression으로 테스트 한 결과이다. | ||
| - | < | + | < |
| - | Model R R Square Adjusted R Square Std. Error of the Estimate | + | > mod2 <- lm(api00 ~ factor(mealcat), data=datavar) |
| - | 1 .867a .752 .752 70.908 | + | > mod2 |
| - | a. Predictors: | + | |
| - | ANOVA(b) | + | Call: |
| - | Model Sum of Squares df Mean Square F Sig. | + | lm(formula = api00 ~ factor(mealcat), data = datavar) |
| - | 1 Regression 6072527.519 1 6072527.519 1207.742 .000a | + | |
| - | Residual 2001144.479 398 5028.001 | + | |
| - | Total 8073671.997 399 | + | |
| - | a. Predictors: | + | |
| - | b. Dependent Variable: api 2000 | + | |
| - | Coefficients(a) | + | Coefficients: |
| - | Unstandardized Coefficients Standardized | + | (Intercept) |
| - | Model B Std. Error Beta t Sig. | + | |
| - | 1 (Constant) 950.987 9.422 100.935 .000 | + | |
| - | Percentage free meals in 3 categories -150.553 4.332 -.867 -34.753 .000 | + | > summary(mod2) |
| - | a. Dependent Variable: api 2000 | + | |
| + | Call: | ||
| + | lm(formula = api00 ~ factor(mealcat), | ||
| + | |||
| + | Residuals: | ||
| + | | ||
| + | -253.394 | ||
| + | |||
| + | Coefficients: | ||
| + | Estimate | ||
| + | (Intercept) 805.718 6.169 130.60 < | ||
| + | factor(mealcat)2 -166.324 8.708 -19.10 | ||
| + | factor(mealcat)3 -301.338 8.629 | ||
| + | --- | ||
| + | Signif. codes: | ||
| + | |||
| + | Residual standard error: 70.61 on 397 degrees of freedom | ||
| + | Multiple R-squared: | ||
| + | F-statistic: | ||
| + | |||
| + | > | ||
| </ | </ | ||
| Line 180: | Line 190: | ||
| </ | </ | ||
| - | Coefficients(a) | + | | **Coefficients(a)** ||||||| |
| | | | Unstandardized Coefficients | | | | Unstandardized Coefficients | ||
| | Model | | Model | ||
| Line 200: | Line 210: | ||
| api 2000 | api 2000 | ||
| Percentage free meals in 3 categories Mean N Std. Deviation | Percentage free meals in 3 categories Mean N Std. Deviation | ||
| - | 0-46% free meals 805.72 131 65.669 | + | 0-46% free meals 805.72 131 65.669 |
| - | 47-80% free meals 639.39 132 82.135 | + | 47-80% free meals 639.39 132 82.135 |
| - | 81-100% free meals 504.38 137 62.727 | + | 81-100% free meals 504.38 137 62.727 |
| - | Total 647.62 400 142.249 | + | Total 647.62 400 142.249 |
| </ | </ | ||
| Line 215: | Line 225: | ||
| </ | </ | ||
| - | ''' | + | | **Between-Subjects Factors** |||| |
| | | | Value Label | N | | | | | Value Label | N | | ||
| | Percentage free meals in 3 categories | | Percentage free meals in 3 categories | ||
| Line 221: | Line 231: | ||
| | | 3 | 81-100% free meals | 137 | | | | 3 | 81-100% free meals | 137 | | ||
| - | ''' | + | | **Tests of Between-Subjects Effects** |||||| |
| | Dependent Variable: | | Dependent Variable: | ||
| | Source | | Source | ||
| Line 232: | Line 242: | ||
| |a. R Squared = .755 (Adjusted R Squared = .754) | |a. R Squared = .755 (Adjusted R Squared = .754) | ||
| - | ''' | + | | **Parameter Estimates** |
| - | | Dependent Variable: | + | | Dependent Variable: |
| | | | | | | 95% Confidence Interval | | | | | | | 95% Confidence Interval | ||
| | Parameter | | Parameter | ||
| Line 251: | Line 261: | ||
| </ | </ | ||
| - | ====== 2 variables, categorical | + | | | Sum of Squares |
| + | | Between Groups | ||
| + | | Within Groups | ||
| + | | Total | 8073671.998 | ||
| + | |||
| + | |||
| + | ===== 2 variables, categorical ===== | ||
| 위에서 사용된 __2 개의 독립변인을 모두__ 넣어서 regression을 할 수도 있다. 위에서 언급한 경로를 따른다면, | 위에서 사용된 __2 개의 독립변인을 모두__ 넣어서 regression을 할 수도 있다. 위에서 언급한 경로를 따른다면, | ||
| Line 259: | Line 275: | ||
| </ | </ | ||
| - | ''' | + | | **Model Summary** ||||| |
| | Model | R | R Square | | Model | R | R Square | ||
| | 1 | .876a | .767 | .765 | 68.893 | | 1 | .876a | .767 | .765 | 68.893 | ||
| | a. Predictors: (Constant), mealcat2, year round school, mealcat1 | | a. Predictors: (Constant), mealcat2, year round school, mealcat1 | ||
| - | ''' | + | | **ANOVA(b)** ||||||| |
| - | | Model | + | | Model |
| - | | 1 | + | | 1 |
| - | | | Residual | + | | |
| - | | | Total | + | | |
| - | | a. Predictors: (Constant), mealcat2, year round school, mealcat1 | + | | a. Predictors: (Constant), mealcat2, year round school, mealcat1 |
| - | | b. Dependent Variable: api 2000 |||||||| | + | | b. Dependent Variable: api 2000 |
| - | | | | | | | | | Coefficients(a) | + | ^ **Coefficients(a)** |
| - | | | | Unstandardized Coefficients | + | | | | Unstandardized |
| | Model | | Model | ||
| | 1 | (Constant) | | 1 | (Constant) | ||
| Line 321: | Line 337: | ||
| - | ^ Excluded Variables(b) | + | ^ **Excluded Variables(b)** ^^^^^^^ |
| | | | | | | | Collinearity Statistics | | | | | | | | Collinearity Statistics | ||
| | Model | | Model | ||
| Line 330: | Line 346: | ||
| 해석에 대해서 . . . . | 해석에 대해서 . . . . | ||
| - | ^ '' | + | ^ **interpretation** |
| - | | | mealcat=1 | + | | | mealcat=1 |
| |yr_rnd=0 | |yr_rnd=0 | ||
| |yr_rnd=1 | |yr_rnd=1 | ||
| - | ^ '' | + | ^ **interpretation** |
| - | | | mealcat=1 | + | | | mealcat=1 |
| + | | | mealcat=1-> | ||
| | yr_rnd=0 | | yr_rnd=0 | ||
| | ::: | intercept + \\ BMealCat1 | | ::: | intercept + \\ BMealCat1 | ||
| Line 349: | Line 366: | ||
| </ | </ | ||
| - | ====== continuous + categorical variables | + | ===== continuous + categorical variables ===== |
| < | < | ||
| /dep = api00 | /dep = api00 | ||
using_dummy_variables.1446599176.txt.gz · Last modified: by hkimscil
