Contains the performance score measures of participants at two time points. The aim of this study is to evaluate the effect of gender and stress on performance score. The three-way mixed ANOVA test can be used to investigate this question.

The data include two between-subjects factors (gender and stress) and one within-subject factor (time, repeated measures).

It is the data set used in the Datanovia tutorial “Mixed ANOVA in R: One Between- and One Within-Subjects Factor” (https://www.datanovia.com/learn/biostatistics/anova/mixed-anova-in-r).

data("performance")

Format

A data frame with 60 rows and 5 columns (stored as a tibble).

id

participant identifier (1 to 60).

gender

the participant's gender, "male" or "female".

stress

the stress level, "low", "moderate" or "high".

t1

a simulated performance score at the first time point (an arbitrary scale with no real-world units).

t2

the performance score at the second time point (same scale as t1).

Source

A simulated dataset for teaching three-way mixed ANOVA.

Examples

data(performance)
head(performance)
#> # A tibble: 6 × 5
#>      id gender stress    t1    t2
#>   <int> <fct>  <fct>  <dbl> <dbl>
#> 1     1 male   low     5.96  5.58
#> 2     2 male   low     5.51  5.82
#> 3     3 male   low     5.63  5.47
#> 4     4 male   low     5.71  5.79
#> 5     5 male   low     5.74  5.72
#> 6     6 male   low     5.62  5.68

# Three-way mixed ANOVA: gender and stress (between) x time (within)
perf_long <- reshape(performance, varying = c("t1", "t2"),
                     v.names = "score", timevar = "time", direction = "long")
#> Warning: number of items to replace is not a multiple of replacement length
#> Warning: number of items to replace is not a multiple of replacement length
#> Warning: number of items to replace is not a multiple of replacement length
#> Warning: number of items to replace is not a multiple of replacement length
#> Warning: number of items to replace is not a multiple of replacement length
#> Warning: number of items to replace is not a multiple of replacement length
#> Warning: number of items to replace is not a multiple of replacement length
#> Warning: number of items to replace is not a multiple of replacement length
#> Warning: number of items to replace is not a multiple of replacement length
#> Warning: number of items to replace is not a multiple of replacement length
summary(aov(score ~ gender * stress * factor(time) + Error(factor(id)/factor(time)),
            data = perf_long))
#> Warning: Error() model is singular
#> 
#> Error: factor(id)
#>               Df Sum Sq Mean Sq F value   Pr(>F)    
#> gender         1 0.0039  0.0039   0.146    0.704    
#> stress         2 0.8272  0.4136  15.459 5.39e-06 ***
#> factor(time)   1 0.0245  0.0245   0.918    0.343    
#> gender:stress  2 0.1058  0.0529   1.978    0.149    
#> Residuals     52 1.3912  0.0268                     
#> ---
#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#> 
#> Error: factor(id):factor(time)
#>              Df  Sum Sq Mean Sq
#> factor(time)  1 0.07446 0.07446