repeated_measure_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 | ||
repeated_measure_anova [2023/05/03 08:00] – [demo1] hkimscil | repeated_measure_anova [2024/05/08 08:16] – [demo 2] hkimscil | ||
---|---|---|---|
Line 79: | Line 79: | ||
-- Picture about here -- | -- Picture about here -- | ||
+ | {{: | ||
+ | ---- | ||
+ | {{: | ||
+ | ---- | ||
* but, $\text{SS}_\text{{within}}$ can be partitioned as | * but, $\text{SS}_\text{{within}}$ can be partitioned as | ||
* $\text{SS}_{\text{ subjects}}$ and $\text{SS}_{\text{ error}}$ | * $\text{SS}_{\text{ subjects}}$ and $\text{SS}_{\text{ error}}$ | ||
Line 258: | Line 261: | ||
see {{: | see {{: | ||
===== demo 2 ===== | ===== demo 2 ===== | ||
- | < | + | see [[:r:repeated measure |
- | # create data | + | |
- | df <- data.frame(patient=rep(1:5, each=4), | + | |
- | | + | |
- | | + | |
- | 14, 18, 10, 22, | + | |
- | 24, 20, 18, 30, | + | |
- | 38, 34, 20, 44, | + | |
- | 26, 28, 14, 30)) | + | |
- | + | ||
- | # view data | + | |
- | df | + | |
- | + | ||
- | # within sujbect | + | |
- | within.aov.mod <- aov(response~drug+Error(patient), | + | |
- | </ | + | |
- | + | ||
- | < | + | |
- | > #create data | + | |
- | > df <- data.frame(patient=rep(1: | + | |
- | + drug=rep(1: | + | |
- | + response=c(30, | + | |
- | + 14, 18, 10, 22, | + | |
- | + 24, 20, 18, 30, | + | |
- | + 38, 34, 20, 44, | + | |
- | + 26, 28, 14, 30)) | + | |
- | > | + | |
- | > #view data | + | |
- | > df | + | |
- | | + | |
- | 1 1 1 30 | + | |
- | 2 1 2 28 | + | |
- | 3 1 3 16 | + | |
- | 4 1 4 34 | + | |
- | 5 2 1 14 | + | |
- | 6 2 2 18 | + | |
- | 7 2 3 10 | + | |
- | 8 2 4 22 | + | |
- | 9 3 1 24 | + | |
- | 10 | + | |
- | 11 | + | |
- | 12 | + | |
- | 13 | + | |
- | 14 | + | |
- | 15 | + | |
- | 16 | + | |
- | 17 | + | |
- | 18 | + | |
- | 19 | + | |
- | 20 | + | |
- | > | + | |
- | > #within sujbect anova | + | |
- | > within.aov.mod <- aov(response~drug+Error(patient), | + | |
- | > | + | |
- | > | + | |
- | > summary(within.aov.mod) | + | |
- | + | ||
- | Error: patient | + | |
- | Df Sum Sq Mean Sq F value Pr(>F) | + | |
- | Residuals | + | |
- | + | ||
- | Error: Within | + | |
- | Df Sum Sq Mean Sq F value Pr(>F) | + | |
- | drug | + | |
- | Residuals 17 1412.6 | + | |
- | </ | + | |
====== two way ====== | ====== two way ====== | ||
< | < |
repeated_measure_anova.txt · Last modified: 2024/05/13 08:39 by hkimscil