Statystyki opisowe

performance <- performance %>%
  gather(key = "time", value = "score", t1, t2) %>%
  convert_as_factor(id,gender,time)
head(performance, 3)
## # A tibble: 3 x 5
##   id    gender stress time  score
##   <fct> <fct>  <fct>  <fct> <dbl>
## 1 1     male   low    t1     5.96
## 2 2     male   low    t1     5.51
## 3 3     male   low    t1     5.63

Założenia

performance %>%
  group_by(gender,stress,time) %>%
  shapiro_test(score)
## # A tibble: 12 x 6
##    gender stress   time  variable statistic      p
##    <fct>  <fct>    <fct> <chr>        <dbl>  <dbl>
##  1 male   low      t1    score        0.942 0.574 
##  2 male   low      t2    score        0.966 0.849 
##  3 male   moderate t1    score        0.848 0.0547
##  4 male   moderate t2    score        0.958 0.761 
##  5 male   high     t1    score        0.915 0.319 
##  6 male   high     t2    score        0.925 0.403 
##  7 female low      t1    score        0.898 0.207 
##  8 female low      t2    score        0.886 0.154 
##  9 female moderate t1    score        0.946 0.626 
## 10 female moderate t2    score        0.865 0.0880
## 11 female high     t1    score        0.989 0.996 
## 12 female high     t2    score        0.930 0.452

Dla wszystkich wariantów zachododzi normalność

performance %>%
  group_by(gender,stress,time) %>%
   identify_outliers(score)
## # A tibble: 1 x 7
##   gender stress time  id    score is.outlier is.extreme
##   <fct>  <fct>  <fct> <fct> <dbl> <lgl>      <lgl>     
## 1 female low    t2    36     6.15 TRUE       FALSE

Brak istotnych odchyleń.

wyniki<-anova_test(data=performance, formula = score~gender*time*stress,wid = id, within = time)
## Coefficient covariances computed by hccm()
get_anova_table(wyniki)
## ANOVA Table (type II tests)
## 
##               Effect DFn DFd      F        p p<.05      ges
## 1             gender   1 108  2.487 1.18e-01       0.023000
## 2               time   1 108  0.061 8.06e-01       0.000564
## 3             stress   2 108 21.878 1.05e-08     * 0.288000
## 4        gender:time   1 108  4.571 3.50e-02     * 0.041000
## 5      gender:stress   2 108  1.607 2.05e-01       0.029000
## 6        time:stress   2 108  1.759 1.77e-01       0.032000
## 7 gender:time:stress   2 108  5.896 4.00e-03     * 0.098000

Wyniki istotnie różnią się dla różnych wariantów płci oraz stresu.

performance %>%
  group_by(gender,stress) %>%
  emmeans_test(score~time)
## # A tibble: 6 x 11
##   gender stress   term  .y.   group1 group2    df statistic       p   p.adj
## * <chr>  <chr>    <chr> <chr> <chr>  <chr>  <dbl>     <dbl>   <dbl>   <dbl>
## 1 female high     time  score t1     t2       108     2.13  0.0351  0.0351 
## 2 female low      time  score t1     t2       108    -1.93  0.0561  0.0561 
## 3 female moderate time  score t1     t2       108     2.72  0.00767 0.00767
## 4 male   high     time  score t1     t2       108    -1.95  0.0537  0.0537 
## 5 male   low      time  score t1     t2       108     0.266 0.791   0.791  
## 6 male   moderate time  score t1     t2       108    -0.631 0.529   0.529  
## # ... with 1 more variable: p.adj.signif <chr>
performance %>%
  group_by(gender,stress) %>%
  emmeans_test(score~time)
## # A tibble: 6 x 11
##   gender stress   term  .y.   group1 group2    df statistic       p   p.adj
## * <chr>  <chr>    <chr> <chr> <chr>  <chr>  <dbl>     <dbl>   <dbl>   <dbl>
## 1 female high     time  score t1     t2       108     2.13  0.0351  0.0351 
## 2 female low      time  score t1     t2       108    -1.93  0.0561  0.0561 
## 3 female moderate time  score t1     t2       108     2.72  0.00767 0.00767
## 4 male   high     time  score t1     t2       108    -1.95  0.0537  0.0537 
## 5 male   low      time  score t1     t2       108     0.266 0.791   0.791  
## 6 male   moderate time  score t1     t2       108    -0.631 0.529   0.529  
## # ... with 1 more variable: p.adj.signif <chr>

Pomiędzy tylko dwoma parami występują istotne różnice.