factorial_anova
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
factorial_anova [2020/05/28 22:10] – [예] hkimscil | factorial_anova [2020/06/02 16:42] – [Interpreting interaction] hkimscil | ||
---|---|---|---|
Line 285: | Line 285: | ||
- Given that the between-treatments SS is equal to 100, what is the SS for the interaction? | - Given that the between-treatments SS is equal to 100, what is the SS for the interaction? | ||
- Calculate the within-treatments SS, df, and MS for these data. | - Calculate the within-treatments SS, df, and MS for these data. | ||
+ | ===== 예 1 ===== | ||
+ | {{detergent.csv}} | ||
+ | detergent 는 세탁의 정도를 세제의 종류와 물온도를 독립변인으로 (팩터로) 가설검증을 한 것이다. 데이터는 위의 {{detergent.csv}} 이다. 또한 손으로 Factorial ANOVA를 하기 위해 이 데이터를 엑셀에 정리하여 {{: | ||
+ | |||
+ | < | ||
+ | de <- read.csv(" | ||
+ | de | ||
+ | |||
+ | de$type <- factor(de$type, | ||
+ | de$w.temp <- factor(de$w.temp, | ||
+ | de | ||
+ | |||
+ | de.anova <- aov(cleanness ~ type * w.temp, data=de) | ||
+ | summary(de.anova) | ||
+ | |||
+ | with(de, interaction.plot(x.factor=type, | ||
+ | trace.factor=w.temp, | ||
+ | fun=mean, type=" | ||
+ | ylab=" | ||
+ | pch=c(1, | ||
+ | | ||
+ | |||
+ | </ | ||
+ | |||
+ | {{: | ||
===== 예 ===== | ===== 예 ===== | ||
Line 370: | Line 395: | ||
| a R Squared = .102 (Adjusted R Squared = .066) |||||| | | a R Squared = .102 (Adjusted R Squared = .066) |||||| | ||
- | < | ||
- | > cookies | ||
- | > str(cookies) | ||
- | </ | ||
- | |||
- | < | ||
- | > cookies$fullness <- factor(cookies$fullness) | ||
- | </ | ||
+ | {{http:// | ||
< | < | ||
- | > attach(cookies) | + | cookies <- read.csv(" |
- | > cookies.aov | + | cookies |
- | </ | + | |
- | < | + | str(cookies) |
- | > summary(cookies.aov) | + | |
- | Df Sum Sq Mean Sq F value Pr(>F) | + | cookies$weight = factor(cookies$weight, levels=c(1,2), labels=c(" |
- | weight | + | cookies$fullness |
- | fullness | + | |
- | weight: | + | str(cookies) |
- | Residuals | + | cookies |
- | | + | |
- | weight | + | with(cookies, |
- | fullness | + | |
- | weight:fullness * | + | |
- | Residuals | + | |
- | --- | + | |
- | Signif. codes: | + | |
- | 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 | + | cookies.aov <- aov(ncookies ~ weight |
- | > | + | summary(cookies.aov) |
</ | </ | ||
Line 487: | Line 503: | ||
79 2 2 27 | 79 2 2 27 | ||
80 2 2 32 | 80 2 2 32 | ||
+ | > | ||
+ | > str(cookies) | ||
+ | ' | ||
+ | $ weight | ||
+ | $ fullness: int 1 1 1 1 1 1 1 1 1 1 ... | ||
+ | $ ncookies: int 15 17 32 12 34 27 13 24 41 20 ... | ||
+ | > | ||
+ | > cookies$weight = factor(cookies$weight, | ||
+ | > cookies$fullness = factor(cookies$fullness, | ||
+ | > | ||
+ | |||
+ | > str(cookies) | ||
+ | ' | ||
+ | $ weight | ||
+ | $ fullness: Factor w/ 2 levels " | ||
+ | $ ncookies: int 15 17 32 12 34 27 13 24 41 20 ... | ||
+ | > | ||
+ | > cookies | ||
+ | | ||
+ | 1 normal | ||
+ | 2 normal | ||
+ | 3 normal | ||
+ | 4 normal | ||
+ | 5 normal | ||
+ | 6 normal | ||
+ | 7 normal | ||
+ | 8 normal | ||
+ | 9 normal | ||
+ | 10 normal | ||
+ | 11 normal | ||
+ | 12 normal | ||
+ | 13 normal | ||
+ | 14 normal | ||
+ | 15 normal | ||
+ | 16 normal | ||
+ | 17 normal | ||
+ | 18 normal | ||
+ | 19 normal | ||
+ | 20 normal | ||
+ | 21 normal | ||
+ | 22 normal | ||
+ | 23 normal | ||
+ | 24 normal | ||
+ | 25 normal | ||
+ | 26 normal | ||
+ | 27 normal | ||
+ | 28 normal | ||
+ | 29 normal | ||
+ | 30 normal | ||
+ | 31 normal | ||
+ | 32 normal | ||
+ | 33 normal | ||
+ | 34 normal | ||
+ | 35 normal | ||
+ | 36 normal | ||
+ | 37 normal | ||
+ | 38 normal | ||
+ | 39 normal | ||
+ | 40 normal | ||
+ | 41 obese empty 7 | ||
+ | 42 obese empty 19 | ||
+ | 43 obese empty 8 | ||
+ | 44 obese empty 23 | ||
+ | 45 obese empty 6 | ||
+ | 46 obese empty 11 | ||
+ | 47 obese empty 18 | ||
+ | 48 obese empty 23 | ||
+ | 49 obese empty 22 | ||
+ | 50 obese empty 16 | ||
+ | 51 obese empty 28 | ||
+ | 52 obese empty 19 | ||
+ | 53 obese empty 2 | ||
+ | 54 obese empty 27 | ||
+ | 55 obese empty 20 | ||
+ | 56 obese empty 25 | ||
+ | 57 obese empty 23 | ||
+ | 58 obese empty 10 | ||
+ | 59 obese empty 19 | ||
+ | 60 obese empty 14 | ||
+ | 61 obese | ||
+ | 62 obese | ||
+ | 63 obese | ||
+ | 64 obese | ||
+ | 65 obese | ||
+ | 66 obese | ||
+ | 67 obese | ||
+ | 68 obese | ||
+ | 69 obese | ||
+ | 70 obese | ||
+ | 71 obese | ||
+ | 72 obese | ||
+ | 73 obese | ||
+ | 74 obese | ||
+ | 75 obese | ||
+ | 76 obese | ||
+ | 77 obese | ||
+ | 78 obese | ||
+ | 79 obese | ||
+ | 80 obese | ||
+ | > | ||
+ | |||
+ | > with(cookies, | ||
+ | + trace.factor=weight, | ||
+ | + fun=mean, type=" | ||
+ | + ylab=" | ||
+ | + pch=c(1, | ||
+ | > | ||
+ | </ | ||
+ | |||
+ | {{: | ||
+ | < | ||
+ | > cookies.aov <- aov(ncookies ~ weight * fullness, data=cookies) | ||
+ | > summary(cookies.aov) | ||
+ | Df Sum Sq Mean Sq F value Pr(> | ||
+ | weight | ||
+ | fullness | ||
+ | weight: | ||
+ | Residuals | ||
+ | --- | ||
+ | Signif. codes: | ||
> | > | ||
</ | </ | ||
===== Interpreting interaction ===== | ===== Interpreting interaction ===== | ||
+ | 위에서 두개 독립변인에 대한 주효과가 없었으므로 각 독립변인의 종류 (특성) 별로 어디에서 차이가 났는가를 살피는 것은 의미가 없음. 따라서 아래는 필요한 절차가 아님. | ||
< | < | ||
Tukey multiple comparisons of means | Tukey multiple comparisons of means |
factorial_anova.txt · Last modified: 2023/05/08 13:13 by hkimscil