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 [2018/10/30 07:36] – hkimscil | factorial_anova [2020/06/02 14:01] – [예] hkimscil | ||
---|---|---|---|
Line 1: | Line 1: | ||
{{keywords> | {{keywords> | ||
See [[:anova]], [[:repeated measure anova]] | See [[:anova]], [[:repeated measure anova]] | ||
- | ====== Factorial | + | ====== Factorial |
t-test와 ANOVA의 섹션까지 다룬것은 모두 하나의 독립변인([[types_of_variables# | t-test와 ANOVA의 섹션까지 다룬것은 모두 하나의 독립변인([[types_of_variables# | ||
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) | ||
- | </ | ||
- | < | + | {{http:// |
- | > cookies$fullness | + | < |
+ | cookies <- read.csv(" | ||
+ | cookies | ||
+ | |||
+ | str(cookies) | ||
+ | |||
+ | cookies$weight = factor(cookies$weight, levels=c(1, | ||
+ | cookies$fullness | ||
+ | |||
+ | str(cookies) | ||
+ | cookies | ||
+ | |||
+ | with(cookies, | ||
+ | trace.factor=weight, | ||
+ | fun=mean, type=" | ||
+ | ylab=" | ||
+ | pch=c(1, | ||
+ | |||
+ | cookies.aov <- aov(ncookies ~ weight * fullness, data=cookies) | ||
+ | summary(cookies.aov) | ||
</ | </ | ||
< | < | ||
- | > attach(cookies) | + | > cookies <- read.csv(" |
- | > cookies.aov <- aov(ncookies | + | > cookies |
+ | | ||
+ | 1 | ||
+ | 2 | ||
+ | 3 | ||
+ | 4 | ||
+ | 5 | ||
+ | 6 | ||
+ | 7 | ||
+ | 8 | ||
+ | 9 | ||
+ | 10 1 1 20 | ||
+ | 11 1 1 23 | ||
+ | 12 1 1 25 | ||
+ | 13 1 1 9 | ||
+ | 14 1 1 21 | ||
+ | 15 1 1 22 | ||
+ | 16 1 1 26 | ||
+ | 17 1 1 26 | ||
+ | 18 1 1 28 | ||
+ | 19 1 1 22 | ||
+ | 20 1 1 3 | ||
+ | 21 1 2 22 | ||
+ | 22 1 2 7 | ||
+ | 23 1 2 15 | ||
+ | 24 1 2 6 | ||
+ | 25 1 2 8 | ||
+ | 26 1 2 18 | ||
+ | 27 1 2 24 | ||
+ | 28 1 2 19 | ||
+ | 29 1 2 11 | ||
+ | 30 1 2 9 | ||
+ | 31 1 2 24 | ||
+ | 32 1 2 19 | ||
+ | 33 1 2 9 | ||
+ | 34 1 2 19 | ||
+ | 35 1 2 29 | ||
+ | 36 1 2 9 | ||
+ | 37 1 2 18 | ||
+ | 38 1 2 17 | ||
+ | 39 1 2 3 | ||
+ | 40 1 2 14 | ||
+ | 41 2 1 7 | ||
+ | 42 2 1 19 | ||
+ | 43 2 1 8 | ||
+ | 44 2 1 23 | ||
+ | 45 2 1 6 | ||
+ | 46 2 1 11 | ||
+ | 47 2 1 18 | ||
+ | 48 2 1 23 | ||
+ | 49 2 1 22 | ||
+ | 50 2 1 16 | ||
+ | 51 2 1 28 | ||
+ | 52 2 1 19 | ||
+ | 53 2 1 2 | ||
+ | 54 2 1 27 | ||
+ | 55 2 1 20 | ||
+ | 56 2 1 25 | ||
+ | 57 2 1 23 | ||
+ | 58 2 1 10 | ||
+ | 59 2 1 19 | ||
+ | 60 2 1 14 | ||
+ | 61 2 2 14 | ||
+ | 62 2 2 21 | ||
+ | 63 2 2 16 | ||
+ | 64 2 2 14 | ||
+ | 65 2 2 17 | ||
+ | 66 2 2 20 | ||
+ | 67 2 2 20 | ||
+ | 68 2 2 21 | ||
+ | 69 2 2 32 | ||
+ | 70 2 2 26 | ||
+ | 71 2 2 9 | ||
+ | 72 2 2 14 | ||
+ | 73 2 2 16 | ||
+ | 74 2 2 15 | ||
+ | 75 2 2 6 | ||
+ | 76 2 2 5 | ||
+ | 77 2 2 12 | ||
+ | 78 2 2 23 | ||
+ | 79 2 2 27 | ||
+ | 80 2 2 32 | ||
+ | > | ||
+ | > str(cookies) | ||
+ | ' | ||
+ | $ weight | ||
+ | $ fullness: int 1 1 1 1 1 1 1 1 1 1 ... | ||
+ | | ||
+ | > | ||
+ | > cookies$weight | ||
+ | > cookies$fullness = factor(cookies$fullness, | ||
+ | > | ||
+ | |||
+ | > str(cookies) | ||
+ | 'data.frame': | ||
+ | $ 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,19))) | ||
+ | > | ||
</ | </ | ||
+ | {{: | ||
< | < | ||
+ | > cookies.aov <- aov(ncookies ~ weight * fullness, data=cookies) | ||
> summary(cookies.aov) | > summary(cookies.aov) | ||
- | + | | |
- | | + | weight |
- | weight | + | fullness |
- | fullness | + | weight: |
- | weight: | + | Residuals |
- | Residuals | + | |
- | | + | |
- | weight | + | |
- | fullness | + | |
- | weight: | + | |
- | Residuals | + | |
--- | --- | ||
- | Signif. codes: | + | Signif. codes: |
- | 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 | + | |
> | > | ||
</ | </ | ||
- | |||
- | |||
===== Interpreting interaction ===== | ===== Interpreting interaction ===== | ||
< | < |
factorial_anova.txt · Last modified: 2024/05/01 08:36 by hkimscil