r:repeated_measures_anova
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| r:repeated_measures_anova [2020/06/03 15:51] – hkimscil | r:repeated_measures_anova [2020/06/03 15:53] (current) – [e.g. 4] hkimscil | ||
|---|---|---|---|
| Line 249: | Line 249: | ||
| Signif. codes: | Signif. codes: | ||
| > | > | ||
| + | </ | ||
| + | |||
| + | ====== e.g. 4 ====== | ||
| + | < | ||
| + | demo4 <- read.csv(" | ||
| + | ## Convert variables to factor | ||
| + | demo4 <- within(demo4, | ||
| + | group <- factor(group) | ||
| + | time <- factor(time) | ||
| + | id <- factor(id) | ||
| + | }) | ||
| + | |||
| + | demo4 | ||
| + | |||
| + | par(cex = .6) | ||
| + | |||
| + | with(demo4, interaction.plot(time, | ||
| + | ylim = c(10, 60), lty = c(1, 12), lwd = 3, | ||
| + | ylab = "mean of pulse", | ||
| + | |||
| + | demo4.aov <- aov(pulse ~ group * time + Error(id), data = demo4) | ||
| + | summary(demo4.aov) | ||
| + | |||
| + | </ | ||
| + | {{: | ||
| + | < | ||
| + | > | ||
| + | > demo4 <- read.csv(" | ||
| + | > ## Convert variables to factor | ||
| + | > demo4 <- within(demo4, | ||
| + | + group <- factor(group) | ||
| + | + time <- factor(time) | ||
| + | + id <- factor(id) | ||
| + | + }) | ||
| + | > | ||
| + | > demo4 | ||
| + | id group pulse time | ||
| + | 1 | ||
| + | 2 | ||
| + | 3 | ||
| + | 4 | ||
| + | 5 | ||
| + | 6 | ||
| + | 7 | ||
| + | 8 | ||
| + | 9 | ||
| + | 10 4 | ||
| + | 11 4 | ||
| + | 12 4 | ||
| + | 13 5 | ||
| + | 14 5 | ||
| + | 15 5 | ||
| + | 16 6 | ||
| + | 17 6 | ||
| + | 18 6 | ||
| + | 19 7 | ||
| + | 20 7 | ||
| + | 21 7 | ||
| + | 22 8 | ||
| + | 23 8 | ||
| + | 24 8 | ||
| + | > | ||
| + | > par(cex = .6) | ||
| + | > | ||
| + | > with(demo4, interaction.plot(time, | ||
| + | + ylim = c(10, 60), lty = c(1, 12), lwd = 3, | ||
| + | + ylab = "mean of pulse", | ||
| + | > | ||
| + | > demo4.aov <- aov(pulse ~ group * time + Error(id), data = demo4) | ||
| + | > summary(demo4.aov) | ||
| + | |||
| + | Error: id | ||
| + | Df Sum Sq Mean Sq F value | ||
| + | group 1 2542.0 | ||
| + | Residuals | ||
| + | --- | ||
| + | Signif. codes: | ||
| + | |||
| + | Error: Within | ||
| + | Df Sum Sq Mean Sq F value | ||
| + | time 2 1 | ||
| + | group: | ||
| + | Residuals | ||
| + | --- | ||
| + | Signif. codes: | ||
| + | > | ||
| </ | </ | ||
r/repeated_measures_anova.1591199476.txt.gz · Last modified: by hkimscil
