The dataset contains 10 individuals' self-esteem score on three time points during a specific diet to determine whether their self-esteem improved.

One-way repeated measures ANOVA can be performed in order to determine the effect of time on the self-esteem score.

It is the data set used in the Datanovia tutorial “Repeated Measures ANOVA in R: Compare Means Across Time” (https://www.datanovia.com/learn/biostatistics/anova/repeated-measures-anova-in-r).

data("selfesteem")

Format

A data frame with 10 rows and 4 columns (stored as a tibble).

id

participant identifier (1 to 10).

t1

the self-esteem score at the first time point.

t2

the self-esteem score at the second time point.

t3

the self-esteem score at the third time point.

The self-esteem score is a simulated measure on an arbitrary scale with no real-world units.

Source

A simulated dataset created for teaching one-way repeated measures ANOVA.

See also

selfesteem2, the two-way (treatment x time) companion data set. Datanovia tutorial: Repeated Measures ANOVA in R: Compare Means Across Time.

Examples

data(selfesteem)
head(selfesteem)
#> # A tibble: 6 × 4
#>      id    t1    t2    t3
#>   <int> <dbl> <dbl> <dbl>
#> 1     1  4.01  5.18  7.11
#> 2     2  2.56  6.91  6.31
#> 3     3  3.24  4.44  9.78
#> 4     4  3.42  4.71  8.35
#> 5     5  2.87  3.91  6.46
#> 6     6  2.05  5.34  6.65

# One-way repeated measures ANOVA of the self-esteem score over time
selfesteem_long <- reshape(selfesteem, varying = c("t1", "t2", "t3"),
                           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
summary(aov(score ~ factor(time) + Error(factor(id)/factor(time)),
            data = selfesteem_long))
#> Warning: Error() model is singular
#> 
#> Error: factor(id)
#>              Df Sum Sq Mean Sq F value  Pr(>F)    
#> factor(time)  1 11.566   11.57    42.8 0.00061 ***
#> Residuals     6  1.621    0.27                    
#> ---
#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#> 
#> Error: factor(id):factor(time)
#>              Df Sum Sq Mean Sq
#> factor(time)  2  4.907   2.454