Letzte Änderung am 19. February 2025 um 19:09:04

“The ‘C’ students run the world” — Harry Truman

Stand des Kapitels: Konstruktion (seit 02.2025)

Dieses Kapitel wird in den nächsten Wochen geschrieben. Ich plane zum Ende des SoSe 2025 eine neue Version des Kapitels erstellt zu haben. Während das Kapitel entsteht, funktioniert so manaches dann nicht so wie es soll.

Die ANOVA

32.1 Allgemeiner Hintergrund

Gueorguieva und Krystal (2004) mit der wissenschaftlichen Veröffentlichung Move Over ANOVA

“Mixed-effects models use all available data, can properly account for correlation between repeated measurements on the same subject, have greater flexibility to model time effects, and can handle missing data more appropriately. Their flexibility makes them the preferred choice for the analysis of repeatedmeasures data”Gueorguieva und Krystal (2004)

“However, the fundamental difference is that in a mixed ANOVA, the subjects that undergo each condition (e.g., a control and treatment) are different, whereas in a two-way repeated measures ANOVA, the subjects undergo both conditions (e.g., they undergo the control and the treatment).”Two-way repeated measures ANOVA using SPSS Statistics

32.2 Theoretischer Hintergrund

Tabelle 32.1— Datentabelle von einem Faktor A mit drei Gruppen \(A.1\), \(A.2\) und \(A.3\) je drei Beobachtungen.
tinytable_dziyyaulolcr2qe0ohqh
Faktor A Messwert $y$
A.1 7
A.1 8
A.1 9
A.2 2
A.2 3
A.2 4
A.3 11
A.3 12
A.3 13
R Code [zeigen / verbergen]
aov(rsp ~ Error(fa), data = f1_ancova_theo_tbl) |> 
  tidy()
# A tibble: 2 × 7
  stratum term         df  sumsq meansq statistic p.value
  <chr>   <chr>     <dbl>  <dbl>  <dbl>     <dbl>   <dbl>
1 fa      Residuals     2 122.    61.0         NA      NA
2 Within  Residuals     6   6.00   1.00        NA      NA
Weitere Tutorien für die repeated & mixed ANOVA

Wir oben schon erwähnt, kann dieses Kapitel nicht alle Themen der ANOVA abarbeiten. Daher präsentiere ich hier eine Liste von Literatur und Links, die mich für dieses Kapitel hier inspiriert haben. Nicht alles habe ich genutzt, aber vielleicht ist für dich was dabei.

32.3 Genutzte R Pakete

Wir wollen folgende R Pakete in diesem Kapitel nutzen.

R Code [zeigen / verbergen]
pacman::p_load(tidyverse, magrittr, broom, WRS2, scales,
               readxl, see, car, patchwork, emmeans,
               interactions, effectsize, afex, report,
               conflicted)
conflicts_prefer(dplyr::mutate)
conflicts_prefer(dplyr::summarize)
conflicts_prefer(dplyr::filter)
cbbPalette <- c("#000000", "#E69F00", "#56B4E9", "#009E73", 
                "#F0E442", "#0072B2", "#D55E00", "#CC79A7")

An der Seite des Kapitels findest du den Link Quellcode anzeigen, über den du Zugang zum gesamten R-Code dieses Kapitels erhältst.

32.4 Daten

Mit Messwiederholung und Subjekt gleich

R Code [zeigen / verbergen]
repated_fac3_tbl <- read_excel("data/fleas_complex_data.xlsx", sheet = "repeated") |> 
  select(animal, stage, t0:t3) |> 
  rowid_to_column(".id") |>   
  pivot_longer(cols = t0:t3,
               values_to = "jump_length",
               names_to = "time_num") |> 
  mutate(animal = as_factor(animal),
         stage = factor(stage, level = c("juvenile", "adult")),
         time_fac = as_factor(time_num),
         jump_length = round(jump_length, 2))
Tabelle 32.2— foo.
tinytable_got1x4cbpl5v9leiwp2g
animal stage t0 t1 t2 t3
cat adult 25.38 23.65 25.69 26.7
cat adult 30.03 18.85 14.13 20.09
cat adult 25.09 18.55 16.33 18.87
... ... ... ... ... ...
fox juvenile 46.28 31.85 29.87 21.36
fox juvenile 41.43 39.68 27.66 27.44
fox juvenile 36.18 36.48 30.1 31.28
Abbildung 32.1— Darstellung der Varianzhomogenität und Varianzheterogenität in einem Barplot. [Zum Vergrößern anklicken]

Mit Messwiederholung und Subjekt ungleich

R Code [zeigen / verbergen]
mixed_fac3_tbl <- read_excel("data/fleas_complex_data.xlsx", sheet = "mixed") |> 
  select(animal, stage, spring:winter) |> 
  rowid_to_column(".id") |>   
  pivot_longer(cols = spring:winter,
               values_to = "jump_length",
               names_to = "season_num") |> 
  mutate(animal = as_factor(animal),
         stage = factor(stage, level = c("juvenile", "adult")),
         season_fac = as_factor(season_num),
         jump_length = round(jump_length, 2))
Tabelle 32.3— foo.
tinytable_qpcdrf6i1r67y1i4apfz
animal stage spring summer autumn winter
cat adult 28.71 31.84 17.92 26.85
cat adult 26.02 33.32 20.01 17.1
cat adult 22.39 23.6 10.29 15.51
... ... ... ... ... ...
fox juvenile 48.88 54.36 24.94 41.92
fox juvenile 51.16 55.93 37.93 46.02
fox juvenile 47.61 57.66 30.3 40.39
Abbildung 32.2— Darstellung der Varianzhomogenität und Varianzheterogenität in einem Barplot. [Zum Vergrößern anklicken]

32.5 Random ANOVA

32.6 Repeated measurement ANOVA

Hier eine kurze Betrachtung. Mehr dazu in dem Kapitel zu gemischten Modellen

32.7 Mixed ANOVA

Hier eine kurze Betrachtung. Mehr dazu in dem Kapitel zu gemischten Modellen

Referenzen

Gueorguieva R, Krystal JH. 2004. Move over anova: progress in analyzing repeated-measures data andits reflection in papers published in the archives of general psychiatry. Archives of general psychiatry 61: 310–317.