5.4 Friedman
Als je blokeffecten hebt, en per blok maar een waarneming hebt per behandeling, dan kan je de Friedmantest gebruiken.
Als voorbeeld effect van alcohol op wiskundetoets:
library(readxl)
<- read_excel("../TV_statwebsites/data/alcohol.xlsx")
alcohol ::kable(alcohol) knitr
persoon | geen | drie | zes | negen |
---|---|---|---|---|
s1 | 83 | 64 | 32 | 25 |
s2 | 62 | 50 | 26 | 22 |
s3 | 88 | 90 | 62 | 51 |
s4 | 61 | 42 | 25 | 16 |
s5 | 80 | 67 | 45 | 25 |
s6 | 92 | 88 | 55 | 57 |
library(tidyverse)
<- alcohol %>%
alcohol_long gather(key = "aantal", value = "score", -persoon)
friedman.test(score~aantal | persoon ,data = alcohol_long)
##
## Friedman rank sum test
##
## data: score and aantal and persoon
## Friedman chi-squared = 16, df = 3, p-value = 0.001134