r:dummy_variables_with_significant_interaction
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
r:dummy_variables_with_significant_interaction [2023/06/02 01:48] – [output] hkimscil | r:dummy_variables_with_significant_interaction [2023/06/05 22:01] (current) – [Regression with a continous + a categorical variables: ANCOVA] hkimscil | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Regression with two categorical variables (IVs): Two way anova ====== | ====== Regression with two categorical variables (IVs): Two way anova ====== | ||
+ | https:// | ||
< | < | ||
college <- read.csv(" | college <- read.csv(" | ||
Line 142: | Line 142: | ||
====== Regression with a continous + a categorical variables: ANCOVA ====== | ====== Regression with a continous + a categorical variables: ANCOVA ====== | ||
+ | < | ||
+ | summary(mod< | ||
+ | anova(mod) | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | > summary(mod< | ||
+ | |||
+ | Call: | ||
+ | lm(formula = salary ~ cost + location) | ||
+ | |||
+ | Residuals: | ||
+ | Min 1Q Median | ||
+ | -20.244 | ||
+ | |||
+ | Coefficients: | ||
+ | | ||
+ | (Intercept) | ||
+ | cost | ||
+ | locationMW | ||
+ | locationNE | ||
+ | locationW | ||
+ | --- | ||
+ | Signif. codes: | ||
+ | |||
+ | Residual standard error: 8.02 on 80 degrees of freedom | ||
+ | Multiple R-squared: | ||
+ | F-statistic: | ||
+ | |||
+ | > anova(mod) | ||
+ | Analysis of Variance Table | ||
+ | |||
+ | Response: salary | ||
+ | Df Sum Sq Mean Sq F value Pr(> | ||
+ | cost | ||
+ | location | ||
+ | Residuals 80 | ||
+ | --- | ||
+ | Signif. codes: | ||
+ | > | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | (Intercept) | ||
+ | cost | ||
+ | locationMW | ||
+ | locationNE | ||
+ | locationW | ||
+ | |||
+ | </ | ||
+ | |||
+ | '' | ||
+ | |||
+ | * S, MW, NE, W 중에서 S가 default | ||
+ | * y hat ~ 87.8 + .00006*cost | ||
+ | * MW: | ||
+ | * y hat ~ 87.8 - 2.8 + .00006*cost | ||
+ | * y hat ~ 85 + .00006*cost | ||
+ | * NE: | ||
+ | * y hat ~ 87.8 - 9.23 + .00006*cost | ||
+ | * y hat ~ 78.57 + .00006*cost | ||
+ | * E: | ||
+ | * y hat ~ 87.8 - 10.5 + .00006*cost | ||
+ | * y hat ~ 77.3 + .00006*cost | ||
+ | |||
+ | < | ||
+ | > summary(mod2< | ||
+ | |||
+ | Call: | ||
+ | lm(formula = salary ~ cost * location) | ||
+ | |||
+ | Residuals: | ||
+ | | ||
+ | -17.1126 | ||
+ | |||
+ | Coefficients: | ||
+ | Estimate Std. Error t value Pr(> | ||
+ | (Intercept) | ||
+ | cost | ||
+ | locationMW | ||
+ | locationNE | ||
+ | locationW | ||
+ | cost: | ||
+ | cost: | ||
+ | cost: | ||
+ | --- | ||
+ | Signif. codes: | ||
+ | |||
+ | Residual standard error: 7.644 on 77 degrees of freedom | ||
+ | Multiple R-squared: | ||
+ | F-statistic: | ||
+ | |||
+ | > anova(mod2) | ||
+ | Analysis of Variance Table | ||
+ | |||
+ | Response: salary | ||
+ | Df Sum Sq Mean Sq F value Pr(> | ||
+ | cost 1 2757.0 2756.97 | ||
+ | location | ||
+ | cost: | ||
+ | Residuals | ||
+ | --- | ||
+ | Signif. codes: | ||
+ | > | ||
+ | </ | ||
+ | |||
r/dummy_variables_with_significant_interaction.1685638134.txt.gz · Last modified: 2023/06/02 01:48 by hkimscil