A pharmaceutical company tested three treatments for migraine headache sufferers. 72 participants were enrolled in the experiments. The aim is to examine the potential of new class of treatments in lowering the pain score associated with the migraine headache episode.

The participants include 36 males and 36 females. Males and females were further (equally) subdivided into whether they were at low or high risk of migraine headache.

This data set is suited for three way Anova test.

It is the data set used in the Datanovia tutorial “Three-Way ANOVA in R: Three Factors and Their Interaction” (https://www.datanovia.com/learn/biostatistics/anova/three-way-anova-in-r).

data("headache")

Format

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

id

participant identifier (1 to 72).

gender

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

risk

the participant's migraine risk, "high" or "low".

treatment

the treatment received, "X", "Y" or "Z".

pain_score

a simulated migraine pain score (an arbitrary scale with no real-world units).

Source

A simulated dataset for teaching three-way ANOVA.

See also

heartattack, the companion three-way ANOVA data set. Datanovia tutorial: Three-Way ANOVA in R: Three Factors and Their Interaction.

Examples

data(headache)
head(headache)
#> # A tibble: 6 × 5
#>      id gender risk  treatment pain_score
#>   <int> <fct>  <fct> <fct>          <dbl>
#> 1     1 male   low   X               79.3
#> 2     2 male   low   X               76.8
#> 3     3 male   low   X               70.8
#> 4     4 male   low   X               81.2
#> 5     5 male   low   X               75.1
#> 6     6 male   low   X               73.1

# Three-way ANOVA of the pain score
summary(aov(pain_score ~ gender * risk * treatment, data = headache))
#>                       Df Sum Sq Mean Sq F value   Pr(>F)    
#> gender                 1  313.4   313.4  16.196 0.000163 ***
#> risk                   1 1793.6  1793.6  92.699  8.8e-14 ***
#> treatment              2  283.2   141.6   7.318 0.001433 ** 
#> gender:risk            1    2.7     2.7   0.141 0.708487    
#> gender:treatment       2  129.2    64.6   3.338 0.042200 *  
#> risk:treatment         2   27.6    13.8   0.713 0.494221    
#> gender:risk:treatment  2  286.6   143.3   7.406 0.001334 ** 
#> Residuals             60 1160.9    19.3                     
#> ---
#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1