This RMarkdown shows the analysis of the questionnaire data using ANOVAs and correlations using R (version 4.3.1).

Loading R packages and importing dataset

library(tidyverse) # for cleaning up data / plotting
library(dplyr) # to manipulate data set
library(ggpubr) # to plot data
library(ggplot2) # to plot data
library(qqplotr) # to plot data
library(rstatix) # for calculating effect sizes t-tests
library(car) # for statistical analysis
library(lsr) # for statistical analysis
library(stats) # for statistical analysis
library(PermutationR)
library(sjstats)
# set working directory, where the questionnaire_data.txt file is stored
setwd("C:/Users/lisab/Documents")
myData <- read.table("EEG_questionnaireN89.txt", header = T, dec = ".")
head(myData) 
##             slope sex age Task_2DvAR RvS PANAS_pos_pre PANAS_neg_pre
## aaai -0.242213503   2  19          2   1           3.1           1.2
## appa  0.652958229   2  21          2   1           3.8           1.0
## aqsd -0.282977520   2  30          2   2           3.6           1.1
## asdf  0.635896520   1  22          1   2           3.9           1.2
## balu -0.004130111   2  24          1   2           2.1           1.1
## bbbo  0.918664371   1  26          2   1           4.0           1.0
##      PANAS_pos_post PANAS_neg_post PANAS_diff_pos PANAS_diff_neg SSQ_pre_N
## aaai            3.3              1            0.2           -0.2  12.26571
## appa            3.9              1            0.1            0.0   9.54000
## aqsd            4.0              1            0.4           -0.1   9.54000
## asdf            3.5              2           -0.4            0.8  10.90286
## balu            2.9              1            0.8           -0.1  12.26571
## bbbo            4.6              1            0.6            0.0  12.26571
##      SSQ_pre_O SSQ_pre_D SSQ_pre_TS SSQ_post_N SSQ_post_O SSQ_post_D
## aaai 18.408571  21.87429    6.07750   11.11143  12.994286   15.90857
## appa  8.662857  13.92000    3.97375   10.54000   8.662857   13.92000
## aqsd  8.662857  13.92000    3.97375   10.68286  10.828571   13.92000
## asdf 10.828571  15.90857    4.44125   10.82571  11.911429   15.90857
## balu 14.077143  13.92000    5.14250   10.54000  10.828571   15.90857
## bbbo  9.745714  13.92000    4.44125   10.54000   9.745714   17.89714
##      SSQ_post_TS  SSQ_diff_N SSQ_diff_O SSQ_diff_D SSQ_diff_TS TUI_Neugierde
## aaai     5.37625 -1.15428571  -5.414286  -5.965714    -0.70125          3.50
## appa     3.97375  1.00000000   0.000000   0.000000     0.00000          5.25
## aqsd     4.44125  1.14285714   2.165714   0.000000     0.46750          4.50
## asdf     4.90875 -0.07714286   1.082857   0.000000     0.46750          4.25
## balu     4.44125 -1.72571429  -3.248571   1.988571    -0.70125          6.50
## bbbo     4.67500 -1.72571429   0.000000   3.977143     0.23375          7.00
##      TUI_Technologieaengstlichkeit TUI_Interesse TUI_Benutzerfreundlichkeit
## aaai                          2.00          3.50                   4.000000
## appa                          2.25          2.00                   4.666667
## aqsd                          1.00          2.00                   3.666667
## asdf                          1.75          2.25                   3.666667
## balu                          1.25          1.50                   4.333333
## bbbo                          1.25          4.50                   5.000000
##      TUI_Immersion TUI_Nuetzlichkeit TUI_Skepsis TUI_Zugaenglichkeit
## aaai          5.25              4.00        3.50            1.333333
## appa          4.75              4.00        2.25            4.333333
## aqsd          6.25              2.25        1.25            3.000000
## asdf          3.00              1.75        3.75            1.333333
## balu          5.75              1.50        1.00            1.666667
## bbbo          4.50              6.00        1.25            3.000000
##      Flow_Glatter_Verlauf Flow_Absorbiertheit Flow_Besorgnis Flow_Total
## aaai             4.666667                4.25       1.000000        4.5
## appa             3.500000                4.25       1.333333        3.8
## aqsd             5.333333                6.00       1.000000        5.6
## asdf             3.333333                3.00       2.333333        3.2
## balu             4.833333                4.00       1.000000        4.5
## bbbo             6.833333                6.25       3.666667        6.6
##      Kontrolle Konzentration Erfolg_Strategie Spass Pain Pressure_on_head
## aaai         7             7                9    10    1                5
## appa         4             9                3     9    0                1
## aqsd         3             9                5    10    0               13
## asdf         2             5                6     2    1               27
## balu         5             9                8     9   10               11
## bbbo        10            10               10    10    0               33
##      Headache Eye_burning Neck_pain
## aaai        1           0         0
## appa        0           1         0
## aqsd        0           0         0
## asdf       14           1         0
## balu        0           0         1
## bbbo        0           0         1
# Code: Participant code
# Slope: individual regression slopes with feedback run number as predictor and SMR power as criterion
# Sex: 1 = Male, 2 = Female
# Age: age of the participants in years
# Task_2DvAR: 1 = 2D, 2 = AR
# RvS: 1 = real feedback, 2 = sham feedback
# PANAS_pos_pre: PANAS subscale positive affect assessed before the task
# PANAS_neg_pre: PANAS subscale negative affect assessed before the task
# PANAS_pos_post: PANAS subscale positive affect assessed after the task
# PANAS_neg_post: PANAS subscale negative affect assessed after the task
# PANAS_diff_pos: PANAS subscale positive affect, difference value between post-pre
# PANAS_diff_neg: PANAS subscale negative affect, difference value between post-pre
# SSQ_pre_N: SSQ subscale nausea assessed before the task
# SSQ_pre_O: SSQ subscale oculomotor disturbance assessed before the task
# SSQ_pre_D: SSQ subscale disorientation assessed before the task
# SSQ_pre_TS: SSQ total score assessed before the task
# SSQ_post_N: SSQ subscale nausea assessed after the task
# SSQ_post_O: SSQ subscale oculomotor disturbance assessed after the task
# SSQ_post_D: SSQ subscale disorientation assessed after the task
# SSQ_post_TS: SSQ total score assessed after the task
# SSQ_diff_N: SSQ subscale nausea, difference value between post-pre
# SSQ_diff_O: SSQ subscale oculomotor disturbance, difference value between post-pre
# SSQ_diff_D: SSQ subscale disorientation, difference value between post-pre
# SSQ_diff_TS: SSQ total score, difference value between post-pre
# TUI_Neugierde: TUI subscale curiosity
# TUI_Technologieaengstlichkeit: TUI subsclae technology fear
# TUI_Interesse: TUI subscale interest
# TUI_Benutzerfreundlichkeit: TUI subscale usability
# TUI_Immersion: TUI subscale immersion
# TUI_Nuetzlichkeit: TUI subscale usefulness
# TUI_Skepsis: TUI subscale skepticism
# TUI_Zugaenglichkeit: TUI subscale accessibility
# Flow_Glatter_Verlauf: FKS Flow Short Scale - subscale "Fluency"
# Flow_Absorbiertheit: FKS FLow Short Scale - subscale "Absorption"
# Flow_Besorgnis: FKS Flow Short Scale - subscale "Concern"
# Flow_Total: FKS Flow Short Scale - subscale "General factor"
# Kontrolle: Feeling of control over the movement of the bars/flowers
# Konzentration: Level of concentration during task
# Erfolg_Strategie: Perceived success of used mental strategies used to control the movement of the bars/flowers
# Spass: Fun during the task
# Pain: Perceived pain when wearing the headset including AR system
# Pressure_on_head: Perceived pressure on the head when wearing the headset including AR system
# Headache: Perceived headache when wearing the headset including AR system
# Eye_burning: Perceived eye burning when wearing the headset including AR system
# Neck_pain: Neck pain when wearing the headset including AR system, 1 = yes, 0 = no

Prepare dataset

myData$Kontrolle <- as.numeric(myData$Kontrolle)
myData$Konzentration <- as.numeric(myData$Konzentration)
myData$Erfolg_Strategie <- as.numeric(myData$Erfolg_Strategie)
myData$Spass <- as.numeric(myData$Spass)

#Designate Task_2DvAR and RvS as a categorical factor
myData$Task_2DvAR<-as.factor(myData$Task_2DvAR)
myData$RvS<-as.factor(myData$RvS)

Task_2D <- myData[myData[,"Task_2DvAR"]=="1",]
Task_AR <- myData[myData[,"Task_2DvAR"]=="2",]

PANAS - Positive / Negative Affect

Checking for outliers using Box-Plots

plot_PANAS_diff_pos <- ggplot(myData,aes(Task_2DvAR,PANAS_diff_pos))+geom_boxplot(aes(fill=RvS)) + 
  geom_point(aes(colour = Task_2DvAR),
    ## draw bigger points
    size = 2,
    ## add some transparency
    alpha = .5, show.legend = FALSE,
    ## add some jittering
    position = position_jitter(
      ## control randomness and range of jitter
      seed = 1, width = .2
    )) +
  scale_fill_brewer(palette = "Dark2",
  ) +
  theme_classic() +
    scale_x_discrete(name = "Condition",
    labels = c("2D", "AR")) +
  scale_y_continuous(name = "Difference positive affect")+
  theme(axis.text.x = element_text(color = "grey20", size = 16, angle = 0, hjust = .5, vjust = .5, face = "plain"),
        axis.text.y = element_text(color = "grey20", size = 16, angle = 0, hjust = 1, vjust = 0, face = "plain"),  
        axis.title.x = element_text(color = "grey20", size = 20, angle = 0, hjust = .5, vjust = 0, face = "plain"),
        axis.title.y = element_text(color = "grey20", size = 20, angle = 90, hjust = .5, vjust = .5, face = "plain"))

plot_PANAS_diff_pos <- ggplot(myData,aes(Task_2DvAR,PANAS_diff_pos))+geom_boxplot(aes(fill=RvS))

plot_PANAS_diff_pos

ggplot(myData,aes(Task_2DvAR,PANAS_diff_pos))+geom_boxplot(aes(fill=RvS))

plot_PANAS_diff_neg <- ggplot(myData, aes(factor(Task_2DvAR), PANAS_diff_neg, )) + 
  geom_boxplot(fill = "grey92") +
  geom_point(aes(colour = Task_2DvAR),
             ## draw bigger points
             size = 2,
             ## add some transparency
             alpha = .5, show.legend = FALSE,
             ## add some jittering
             position = position_jitter(
               ## control randomness and range of jitter
               seed = 1, width = .2
             )) +
  scale_fill_brewer(palette = "Dark2",
  ) +
  theme_classic() +
  scale_x_discrete(name = "Condition",
                   labels = c("2D", "AR")) +
  scale_y_continuous(name = "Difference negative affect")+
  theme(axis.text.x = element_text(color = "grey20", size = 16, angle = 0, hjust = .5, vjust = .5, face = "plain"),
        axis.text.y = element_text(color = "grey20", size = 16, angle = 0, hjust = 1, vjust = 0, face = "plain"),  
        axis.title.x = element_text(color = "grey20", size = 20, angle = 0, hjust = .5, vjust = 0, face = "plain"),
        axis.title.y = element_text(color = "grey20", size = 20, angle = 90, hjust = .5, vjust = .5, face = "plain"))


plot_PANAS_diff_neg <- ggplot(myData,aes(Task_2DvAR,PANAS_diff_neg))+geom_boxplot(aes(fill=RvS))

plot_PANAS_diff_neg

ggarrange(plot_PANAS_diff_pos, plot_PANAS_diff_neg, 
        # labels = c("PANAS positive affect", "PANAS negative affect"),
           ncol = 2, nrow = 1)

Removing outliers when Interquartile Range IQR > 1.5

PANAS_diff_pos_2D <- subset(myData[myData$Task_2DvAR == 1, ], )

# create a vector of outliers for the numeric factor
outliers_PANAS_diff_pos_2D <- boxplot(PANAS_diff_pos_2D$PANAS_diff_pos, plot = FALSE)$out

# Replace the values with NA
PANAS_diff_pos_2D[PANAS_diff_pos_2D$PANAS_diff_pos %in% outliers_PANAS_diff_pos_2D, "PANAS_diff_pos"] = NA

PANAS_diff_pos_AR <- subset(myData[myData$Task_2DvAR == 2, ], )


# create a vector of outliers for the numeric factor
outliers_PANAS_diff_pos_AR <- boxplot(PANAS_diff_pos_AR$PANAS_diff_pos, plot = FALSE)$out

# Replace the values with NA
PANAS_diff_pos_AR[PANAS_diff_pos_AR$PANAS_diff_pos %in% outliers_PANAS_diff_pos_AR, "PANAS_diff_pos"] = NA

myData_PANAS_diff_pos_noOutliers <- rbind(PANAS_diff_pos_2D, PANAS_diff_pos_AR)

PANAS_diff_neg_2D <- subset(myData[myData$Task_2DvAR == 1, ], )

# create a vector of outliers for the numeric factor
outliers_PANAS_diff_neg_2D <- boxplot(PANAS_diff_neg_2D$PANAS_diff_neg, plot = FALSE)$out

# Replace the values with NA
PANAS_diff_neg_2D[PANAS_diff_neg_2D$PANAS_diff_neg %in% outliers_PANAS_diff_neg_2D, "PANAS_diff_neg"] = NA

PANAS_diff_neg_AR <- subset(myData[myData$Task_2DvAR == 2, ], )

# create a vector of outliers for the numeric factor
outliers_PANAS_diff_neg_AR <- boxplot(PANAS_diff_neg_AR$PANAS_diff_neg, plot = FALSE)$out

# Replace the values with NA
PANAS_diff_neg_AR[PANAS_diff_neg_AR$PANAS_diff_neg %in% outliers_PANAS_diff_neg_AR, "PANAS_diff_neg"] = NA

myData_PANAS_diff_neg_noOutliers <- rbind(PANAS_diff_neg_2D, PANAS_diff_neg_AR)

Checking normal distribution

#Perform the Shapiro-Wilk Test for Normality on each group
myData_PANAS_diff_pos_noOutliers %>%
  group_by(Task_2DvAR, RvS) %>%
  summarise(`W Statistic` = shapiro.test(PANAS_diff_pos)$statistic,
            `p-value` = shapiro.test(PANAS_diff_pos)$p.value)
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 4
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS   `W Statistic` `p-value`
##   <fct>      <fct>         <dbl>     <dbl>
## 1 1          1             0.947     0.319
## 2 1          2             0.974     0.765
## 3 2          1             0.935     0.124
## 4 2          2             0.962     0.606
myData_PANAS_diff_neg_noOutliers %>%
  group_by(Task_2DvAR, RvS) %>%
  summarise(`W Statistic` = shapiro.test(PANAS_diff_neg)$statistic,
            `p-value` = shapiro.test(PANAS_diff_neg)$p.value)
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 4
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS   `W Statistic` `p-value`
##   <fct>      <fct>         <dbl>     <dbl>
## 1 1          1             0.937    0.236 
## 2 1          2             0.971    0.721 
## 3 2          1             0.913    0.0468
## 4 2          2             0.910    0.0627
#Perform QQ plots by group
ggplot(data = myData_PANAS_diff_pos_noOutliers, mapping = aes(sample = PANAS_diff_pos, color = Task_2DvAR, fill = Task_2DvAR)) +
  #stat_qq_band(alpha=0.5, conf=0.95, qtype=1, bandType = "ts") +
  stat_qq_line(identity=TRUE) +
  stat_qq_point(col="black") +
  facet_wrap(~ Task_2DvAR, scales = "free") +
  labs(x = "Theoretical Quantiles", y = "Sample Quantiles") + theme_bw() 

ggplot(data = myData_PANAS_diff_neg_noOutliers, mapping = aes(sample = PANAS_diff_pos, color = Task_2DvAR, fill = Task_2DvAR)) +
  #stat_qq_band(alpha=0.5, conf=0.95, qtype=1, bandType = "ts") +
  stat_qq_line(identity=TRUE) +
  stat_qq_point(col="black") +
  facet_wrap(~ Task_2DvAR, scales = "free") +
  labs(x = "Theoretical Quantiles", y = "Sample Quantiles") + theme_bw() 

To compare groups (2D vs AR) and conditions (real vs sham) we are calculating 2x2 ANOVAs

ANOVA_PANAS_diff_pos <- aov(PANAS_diff_pos ~ Task_2DvAR * RvS, data = myData_PANAS_diff_pos_noOutliers)
summary(ANOVA_PANAS_diff_pos)
##                Df Sum Sq Mean Sq F value Pr(>F)
## Task_2DvAR      1  0.143  0.1428   0.388  0.535
## RvS             1  0.000  0.0001   0.000  0.987
## Task_2DvAR:RvS  1  0.171  0.1711   0.465  0.497
## Residuals      83 30.525  0.3678               
## 2 Beobachtungen als fehlend gelöscht
leveneTest(ANOVA_PANAS_diff_pos)
## Levene's Test for Homogeneity of Variance (center = median)
##       Df F value Pr(>F)
## group  3  0.2011 0.8954
##       83
ANOVA_PANAS_diff_neg <- aov(PANAS_diff_neg ~ Task_2DvAR * RvS, data = myData_PANAS_diff_neg_noOutliers)
summary(ANOVA_PANAS_diff_neg)
##                Df Sum Sq Mean Sq F value Pr(>F)  
## Task_2DvAR      1  0.107 0.10723   2.663 0.1066  
## RvS             1  0.236 0.23649   5.873 0.0176 *
## Task_2DvAR:RvS  1  0.005 0.00474   0.118 0.7325  
## Residuals      81  3.261 0.04026                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 4 Beobachtungen als fehlend gelöscht
leveneTest(ANOVA_PANAS_diff_neg)
## Levene's Test for Homogeneity of Variance (center = median)
##       Df F value  Pr(>F)  
## group  3  3.4436 0.02051 *
##       81                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
effectsize::eta_squared(ANOVA_PANAS_diff_neg, partial = TRUE)
## # Effect Size for ANOVA (Type I)
## 
## Parameter      | Eta2 (partial) |       95% CI
## ----------------------------------------------
## Task_2DvAR     |           0.03 | [0.00, 1.00]
## RvS            |           0.07 | [0.01, 1.00]
## Task_2DvAR:RvS |       1.45e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].

Descriptive statistic per group

# Positive affect

myData_PANAS_diff_pos_noOutliers %>% select(PANAS_diff_pos, Task_2DvAR, RvS) %>% group_by(Task_2DvAR, RvS) %>% 
  summarise(n = n(), 
            mean = mean(PANAS_diff_pos, na.rm = TRUE), 
            sd = sd(PANAS_diff_pos, na.rm = TRUE),
            stderr = sd/sqrt(n), 
            LCL = mean - qt(1 - (0.05 / 2), n - 1) * stderr,
            UCL = mean + qt(1 - (0.05 / 2), n - 1) * stderr,
            median=median(PANAS_diff_pos, na.rm = TRUE),
            min=min(PANAS_diff_pos, na.rm = TRUE), 
            max=max(PANAS_diff_pos, na.rm = TRUE),
            IQR=IQR(PANAS_diff_pos, na.rm = TRUE))
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 12
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS       n    mean    sd stderr    LCL   UCL median   min   max
##   <fct>      <fct> <int>   <dbl> <dbl>  <dbl>  <dbl> <dbl>  <dbl> <dbl> <dbl>
## 1 1          1        20  0.065  0.591  0.132 -0.212 0.342    0.1  -1.3   1  
## 2 1          2        24 -0.025  0.652  0.133 -0.300 0.250    0    -1.4   1.2
## 3 2          1        25 -0.104  0.597  0.119 -0.350 0.142    0    -1.3   0.8
## 4 2          2        20 -0.0158 0.574  0.128 -0.284 0.253    0.1  -1.2   0.9
## # ℹ 1 more variable: IQR <dbl>
# Negative affect

myData_PANAS_diff_neg_noOutliers %>% select(PANAS_diff_neg, Task_2DvAR, RvS) %>% group_by(Task_2DvAR, RvS) %>% 
  summarise(n = n(), 
            mean = mean(PANAS_diff_neg, na.rm = TRUE), 
            sd = sd(PANAS_diff_neg, na.rm = TRUE),
            stderr = sd/sqrt(n), 
            LCL = mean - qt(1 - (0.05 / 2), n - 1) * stderr,
            UCL = mean + qt(1 - (0.05 / 2), n - 1) * stderr,
            median=median(PANAS_diff_neg, na.rm = TRUE),
            min=min(PANAS_diff_neg, na.rm = TRUE), 
            max=max(PANAS_diff_neg, na.rm = TRUE),
            IQR=IQR(PANAS_diff_neg, na.rm = TRUE))
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 12
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS       n    mean    sd stderr     LCL     UCL median   min   max
##   <fct>      <fct> <int>   <dbl> <dbl>  <dbl>   <dbl>   <dbl>  <dbl> <dbl> <dbl>
## 1 1          1        20  0.0211 0.196 0.0438 -0.0707  0.113    0     -0.3   0.4
## 2 1          2        24 -0.1    0.278 0.0567 -0.217   0.0174  -0.1   -0.7   0.4
## 3 2          1        25 -0.0739 0.132 0.0264 -0.128  -0.0194   0     -0.4   0.2
## 4 2          2        20 -0.165  0.160 0.0357 -0.240  -0.0902  -0.15  -0.4   0.1
## # ℹ 1 more variable: IQR <dbl>

SSQ - Cybersickness

Checking for outliers using Box-Plots

plot_SSQ_diff_N <- ggplot(myData, aes(factor(Task_2DvAR), SSQ_diff_N, )) + geom_boxplot() +
  geom_boxplot(fill = "grey92") +
  geom_point(aes(colour = Task_2DvAR),
    ## draw bigger points
    size = 2,
    ## add some transparency
    alpha = .5, show.legend = FALSE,
    ## add some jittering
    position = position_jitter(
      ## control randomness and range of jitter
      seed = 1, width = .2
    )) +
  scale_fill_brewer(palette = "Dark2",
  ) +
  theme_classic() +
    scale_x_discrete(name = "Condition",
    labels = c("2D", "AR")) +
  scale_y_continuous(name = "Difference Nausea")+
  theme(axis.text.x = element_text(color = "grey20", size = 8, angle = 0, hjust = .5, vjust = .5, face = "plain"),
        axis.text.y = element_text(color = "grey20", size = 8, angle = 0, hjust = 1, vjust = 0, face = "plain"),  
        axis.title.x = element_text(color = "grey20", size = 10, angle = 0, hjust = .5, vjust = 0, face = "plain"),
        axis.title.y = element_text(color = "grey20", size = 10, angle = 90, hjust = .5, vjust = .5, face = "plain"))


plot_SSQ_diff_O <- ggplot(myData, aes(factor(Task_2DvAR), SSQ_diff_O, )) + geom_boxplot() +
  geom_boxplot(fill = "grey92") +
  geom_point(aes(colour = Task_2DvAR),
    ## draw bigger points
    size = 2,
    ## add some transparency
    alpha = .5, show.legend = FALSE,
    ## add some jittering
    position = position_jitter(
      ## control randomness and range of jitter
      seed = 1, width = .2
    )) +
  scale_fill_brewer(palette = "Dark2",
  ) +
  theme_classic() +
    scale_x_discrete(name = "Condition",
    labels = c("2D", "AR")) +
  scale_y_continuous(name = "Difference Oc. Disturbance")+
  theme(axis.text.x = element_text(color = "grey20", size = 8, angle = 0, hjust = .5, vjust = .5, face = "plain"),
        axis.text.y = element_text(color = "grey20", size = 8, angle = 0, hjust = 1, vjust = 0, face = "plain"),  
        axis.title.x = element_text(color = "grey20", size = 10, angle = 0, hjust = .5, vjust = 0, face = "plain"),
        axis.title.y = element_text(color = "grey20", size = 10, angle = 90, hjust = .5, vjust = .5, face = "plain"))


plot_SSQ_diff_D <- ggplot(myData, aes(factor(Task_2DvAR), SSQ_diff_D, )) + geom_boxplot() +
  geom_boxplot(fill = "grey92") +
  geom_point(aes(colour = Task_2DvAR),
    ## draw bigger points
    size = 2,
    ## add some transparency
    alpha = .5, show.legend = FALSE,
    ## add some jittering
    position = position_jitter(
      ## control randomness and range of jitter
      seed = 1, width = .2
    )) +
  scale_fill_brewer(palette = "Dark2",
  ) +
  theme_classic() +
    scale_x_discrete(name = "Condition",
    labels = c("2D", "AR")) +
  scale_y_continuous(name = "Difference Disorientation")+
  theme(axis.text.x = element_text(color = "grey20", size = 8, angle = 0, hjust = .5, vjust = .5, face = "plain"),
        axis.text.y = element_text(color = "grey20", size = 8, angle = 0, hjust = 1, vjust = 0, face = "plain"),  
        axis.title.x = element_text(color = "grey20", size = 10, angle = 0, hjust = .5, vjust = 0, face = "plain"),
        axis.title.y = element_text(color = "grey20", size = 10, angle = 90, hjust = .5, vjust = .5, face = "plain"))

plot_SSQ_diff_TS <- ggplot(myData, aes(factor(Task_2DvAR), SSQ_diff_TS, )) + geom_boxplot() +
  geom_boxplot(fill = "grey92") +
  geom_point(aes(colour = Task_2DvAR),
    ## draw bigger points
    size = 2,
    ## add some transparency
    alpha = .5, show.legend = FALSE,
    ## add some jittering
    position = position_jitter(
      ## control randomness and range of jitter
      seed = 1, width = .2
    )) +
  scale_fill_brewer(palette = "Dark2",
  ) +
  theme_classic() +
    scale_x_discrete(name = "Condition",
    labels = c("2D", "AR")) +
  scale_y_continuous(name = "Difference Total Score")+
  theme(axis.text.x = element_text(color = "grey20", size = 8, angle = 0, hjust = .5, vjust = .5, face = "plain"),
        axis.text.y = element_text(color = "grey20", size = 8, angle = 0, hjust = 1, vjust = 0, face = "plain"),  
        axis.title.x = element_text(color = "grey20", size = 10, angle = 0, hjust = .5, vjust = 0, face = "plain"),
        axis.title.y = element_text(color = "grey20", size = 10, angle = 90, hjust = .5, vjust = .5, face = "plain"))

ggarrange(plot_SSQ_diff_N, plot_SSQ_diff_O, plot_SSQ_diff_D, plot_SSQ_diff_TS, 
         #labels = c("Nausea", "Oculomotor Disturbance", "Disorientation", "Total Score"),
           ncol = 2, nrow = 2)

Removing outliers when Interquartile Range IQR > 1.5

SSQ_diff_N_2D <- subset(myData[myData$Task_2DvAR == 1, ], )

# create a vector of outliers for the numeric factor
outliers_SSQ_diff_N_2D <- boxplot(SSQ_diff_N_2D$SSQ_diff_N, plot = FALSE)$out

# Replace the values with NA
SSQ_diff_N_2D[SSQ_diff_N_2D$SSQ_diff_N %in% outliers_SSQ_diff_N_2D, "SSQ_diff_N"] = NA

SSQ_diff_N_AR <- subset(myData[myData$Task_2DvAR == 2, ], )

# create a vector of outliers for the numeric factor
outliers_SSQ_diff_N_AR <- boxplot(SSQ_diff_N_AR$SSQ_diff_N, plot = FALSE)$out

# Replace the values with NA
SSQ_diff_N_AR[SSQ_diff_N_AR$SSQ_diff_N %in% outliers_SSQ_diff_N_AR, "SSQ_diff_N"] = NA

myData_SSQ_diff_N_noOutliers <- rbind(SSQ_diff_N_2D, SSQ_diff_N_AR)

SSQ_diff_O_2D <- subset(myData[myData$Task_2DvAR == 1, ], )

# create a vector of outliers for the numeric factor
outliers_SSQ_diff_O_2D <- boxplot(SSQ_diff_O_2D$SSQ_diff_O, plot = FALSE)$out

# Replace the values with NA
SSQ_diff_O_2D[SSQ_diff_O_2D$SSQ_diff_O %in% outliers_SSQ_diff_O_2D, "SSQ_diff_O"] = NA

SSQ_diff_O_AR <- subset(myData[myData$Task_2DvAR == 2, ], )

# create a vector of outliers for the numeric factor
outliers_SSQ_diff_O_AR <- boxplot(SSQ_diff_O_AR$SSQ_diff_O, plot = FALSE)$out

# Replace the values with NA
SSQ_diff_O_AR[SSQ_diff_O_AR$SSQ_diff_O %in% outliers_SSQ_diff_O_AR, "SSQ_diff_O"] = NA

myData_SSQ_diff_O_noOutliers <- rbind(SSQ_diff_O_2D, SSQ_diff_O_AR)


SSQ_diff_D_2D <- subset(myData[myData$Task_2DvAR == 1, ], )

# create a vector of outliers for the numeric factor
outliers_SSQ_diff_D_2D <- boxplot(SSQ_diff_D_2D$SSQ_diff_D, plot = FALSE)$out

# Replace the values with NA
SSQ_diff_D_2D[SSQ_diff_D_2D$SSQ_diff_D %in% outliers_SSQ_diff_D_2D, "SSQ_diff_D"] = NA

SSQ_diff_D_AR <- subset(myData[myData$Task_2DvAR == 2, ], )

# create a vector of outliers for the numeric factor
outliers_SSQ_diff_D_AR <- boxplot(SSQ_diff_D_AR$SSQ_diff_D, plot = FALSE)$out

# Replace the values with NA
SSQ_diff_D_AR[SSQ_diff_D_AR$SSQ_diff_D %in% outliers_SSQ_diff_D_AR, "SSQ_diff_D"] = NA

myData_SSQ_diff_D_noOutliers <- rbind(SSQ_diff_D_2D, SSQ_diff_D_AR)

SSQ_diff_TS_2D <- subset(myData[myData$Task_2DvAR == 1, ], )

# create a vector of outliers for the numeric factor
outliers_SSQ_diff_TS_2D <- boxplot(SSQ_diff_TS_2D$SSQ_diff_TS, plot = FALSE)$out

# Replace the values with NA
SSQ_diff_TS_2D[SSQ_diff_TS_2D$SSQ_diff_TS %in% outliers_SSQ_diff_TS_2D, "SSQ_diff_TS"] = NA

SSQ_diff_TS_AR <- subset(myData[myData$Task_2DvAR == 2, ], )

# create a vector of outliers for the numeric factor
outliers_SSQ_diff_TS_AR <- boxplot(SSQ_diff_TS_AR$SSQ_diff_TS, plot = FALSE)$out

# Replace the values with NA
SSQ_diff_TS_AR[SSQ_diff_TS_AR$SSQ_diff_TS %in% outliers_SSQ_diff_TS_AR, "SSQ_diff_TS"] = NA

myData_SSQ_diff_TS_noOutliers <- rbind(SSQ_diff_TS_2D, SSQ_diff_TS_AR)

Checking normal distribution

#Perform the Shapiro-Wilk Test for Normality on each group
myData_SSQ_diff_N_noOutliers %>%
  group_by(Task_2DvAR, RvS) %>%
  summarise(`W Statistic` = shapiro.test(SSQ_diff_N)$statistic,
            `p-value` = shapiro.test(SSQ_diff_N)$p.value)
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 4
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS   `W Statistic` `p-value`
##   <fct>      <fct>         <dbl>     <dbl>
## 1 1          1             0.879   0.0202 
## 2 1          2             0.877   0.00889
## 3 2          1             0.864   0.00332
## 4 2          2             0.921   0.116
myData_SSQ_diff_O_noOutliers %>%
  group_by(Task_2DvAR, RvS) %>%
  summarise(`W Statistic` = shapiro.test(SSQ_diff_O)$statistic,
            `p-value` = shapiro.test(SSQ_diff_O)$p.value)
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 4
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS   `W Statistic` `p-value`
##   <fct>      <fct>         <dbl>     <dbl>
## 1 1          1             0.972     0.820
## 2 1          2             0.959     0.418
## 3 2          1             0.956     0.372
## 4 2          2             0.937     0.236
myData_SSQ_diff_D_noOutliers %>%
  group_by(Task_2DvAR, RvS) %>%
  summarise(`W Statistic` = shapiro.test(SSQ_diff_D)$statistic,
            `p-value` = shapiro.test(SSQ_diff_D)$p.value)
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 4
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS   `W Statistic` `p-value`
##   <fct>      <fct>         <dbl>     <dbl>
## 1 1          1             0.861   0.0103 
## 2 1          2             0.846   0.00235
## 3 2          1             0.879   0.0115 
## 4 2          2             0.826   0.00358
myData_SSQ_diff_TS_noOutliers %>%
  group_by(Task_2DvAR, RvS) %>%
  summarise(`W Statistic` = shapiro.test(SSQ_diff_TS)$statistic,
            `p-value` = shapiro.test(SSQ_diff_TS)$p.value)
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 4
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS   `W Statistic` `p-value`
##   <fct>      <fct>         <dbl>     <dbl>
## 1 1          1             0.935    0.214 
## 2 1          2             0.900    0.0257
## 3 2          1             0.968    0.699 
## 4 2          2             0.860    0.0389
#Perform QQ plots by group
ggplot(data = myData_SSQ_diff_N_noOutliers, mapping = aes(sample = SSQ_diff_N, color = Task_2DvAR, fill = Task_2DvAR)) +
  #stat_qq_band(alpha=0.5, conf=0.95, qtype=1, bandType = "ts") +
  stat_qq_line(identity=TRUE) +
  stat_qq_point(col="black") +
  facet_wrap(~ Task_2DvAR, scales = "free") +
  labs(x = "Theoretical Quantiles", y = "Sample Quantiles") + theme_bw() 

ggplot(data = myData_SSQ_diff_O_noOutliers, mapping = aes(sample = SSQ_diff_O, color = Task_2DvAR, fill = Task_2DvAR)) +
  #stat_qq_band(alpha=0.5, conf=0.95, qtype=1, bandType = "ts") +
  stat_qq_line(identity=TRUE) +
  stat_qq_point(col="black") +
  facet_wrap(~ Task_2DvAR, scales = "free") +
  labs(x = "Theoretical Quantiles", y = "Sample Quantiles") + theme_bw() 

ggplot(data = myData_SSQ_diff_D_noOutliers, mapping = aes(sample = SSQ_diff_D, color = Task_2DvAR, fill = Task_2DvAR)) +
  #stat_qq_band(alpha=0.5, conf=0.95, qtype=1, bandType = "ts") +
  stat_qq_line(identity=TRUE) +
  stat_qq_point(col="black") +
  facet_wrap(~ Task_2DvAR, scales = "free") +
  labs(x = "Theoretical Quantiles", y = "Sample Quantiles") + theme_bw() 

ggplot(data = myData_SSQ_diff_TS_noOutliers, mapping = aes(sample = SSQ_diff_TS, color = Task_2DvAR, fill = Task_2DvAR)) +
  #stat_qq_band(alpha=0.5, conf=0.95, qtype=1, bandType = "ts") +
  stat_qq_line(identity=TRUE) +
  stat_qq_point(col="black") +
  facet_wrap(~ Task_2DvAR, scales = "free") +
  labs(x = "Theoretical Quantiles", y = "Sample Quantiles") + theme_bw() 

To compare groups (2D vs AR) and conditions (real vs sham) we are calculating 2x2 ANOVAs

ANOVA_SSQ_diff_N <- aov(SSQ_diff_N ~ Task_2DvAR *RvS, data = myData_SSQ_diff_N_noOutliers)
summary(ANOVA_SSQ_diff_N)
##                Df Sum Sq Mean Sq F value Pr(>F)  
## Task_2DvAR      1   0.09   0.094   0.046 0.8315  
## RvS             1   6.64   6.641   3.215 0.0766 .
## Task_2DvAR:RvS  1   7.54   7.535   3.648 0.0596 .
## Residuals      82 169.37   2.066                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 3 Beobachtungen als fehlend gelöscht
leveneTest(ANOVA_SSQ_diff_N)
## Levene's Test for Homogeneity of Variance (center = median)
##       Df F value Pr(>F)
## group  3  1.8715 0.1408
##       82
TukeyHSD(ANOVA_SSQ_diff_N)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = SSQ_diff_N ~ Task_2DvAR * RvS, data = myData_SSQ_diff_N_noOutliers)
## 
## $Task_2DvAR
##           diff        lwr       upr     p adj
## 2-1 -0.0661812 -0.6829452 0.5505828 0.8314967
## 
## $RvS
##           diff       lwr        upr     p adj
## 2-1 -0.5521784 -1.168942 0.06458558 0.0786151
## 
## $`Task_2DvAR:RvS`
##                diff        lwr         upr     p adj
## 2:1-1:1  0.45430376 -0.6928257 1.601433184 0.7273438
## 1:2-1:1  0.04759072 -1.1208773 1.216058688 0.9995603
## 2:2-1:1 -0.69067669 -1.9135208 0.532167383 0.4534149
## 1:2-2:1 -0.40671304 -1.4956922 0.682266151 0.7615055
## 2:2-2:1 -1.14498045 -2.2921099 0.002148973 0.0506143
## 2:2-1:2 -0.73826741 -1.9067354 0.430200565 0.3530443
effectsize::eta_squared(ANOVA_SSQ_diff_N, partial = TRUE)
## # Effect Size for ANOVA (Type I)
## 
## Parameter      | Eta2 (partial) |       95% CI
## ----------------------------------------------
## Task_2DvAR     |       5.55e-04 | [0.00, 1.00]
## RvS            |           0.04 | [0.00, 1.00]
## Task_2DvAR:RvS |           0.04 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
ANOVA_SSQ_diff_O <- aov(SSQ_diff_O ~ Task_2DvAR *RvS, data = myData_SSQ_diff_O_noOutliers)
summary(ANOVA_SSQ_diff_O)
##                Df Sum Sq Mean Sq F value Pr(>F)
## Task_2DvAR      1    0.0   0.014   0.002  0.964
## RvS             1    2.4   2.378   0.350  0.556
## Task_2DvAR:RvS  1    4.2   4.227   0.622  0.433
## Residuals      82  557.4   6.798               
## 3 Beobachtungen als fehlend gelöscht
leveneTest(ANOVA_SSQ_diff_O)
## Levene's Test for Homogeneity of Variance (center = median)
##       Df F value Pr(>F)
## group  3  0.2815 0.8386
##       82
ANOVA_SSQ_diff_D <- aov(SSQ_diff_D ~ Task_2DvAR *RvS, data = myData_SSQ_diff_D_noOutliers)
summary(ANOVA_SSQ_diff_D)
##                Df Sum Sq Mean Sq F value Pr(>F)
## Task_2DvAR      1    1.6   1.599   0.330  0.568
## RvS             1    4.5   4.452   0.918  0.341
## Task_2DvAR:RvS  1    0.3   0.252   0.052  0.820
## Residuals      78  378.4   4.851               
## 7 Beobachtungen als fehlend gelöscht
leveneTest(ANOVA_SSQ_diff_D)
## Levene's Test for Homogeneity of Variance (center = median)
##       Df F value Pr(>F)
## group  3  1.7093 0.1719
##       78
ANOVA_SSQ_diff_TS <- aov(SSQ_diff_TS ~ Task_2DvAR *RvS, data = myData_SSQ_diff_TS_noOutliers)
summary(ANOVA_SSQ_diff_TS)
##                Df Sum Sq Mean Sq F value Pr(>F)
## Task_2DvAR      1  0.000 0.00039   0.001  0.970
## RvS             1  0.067 0.06674   0.247  0.620
## Task_2DvAR:RvS  1  0.022 0.02181   0.081  0.777
## Residuals      72 19.423 0.26976               
## 13 Beobachtungen als fehlend gelöscht
leveneTest(ANOVA_SSQ_diff_TS)
## Levene's Test for Homogeneity of Variance (center = median)
##       Df F value  Pr(>F)  
## group  3  3.0898 0.03238 *
##       72                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Descriptive statistic per group

# Nausea

myData_SSQ_diff_N_noOutliers %>% select(SSQ_diff_N, RvS) %>% group_by(RvS) %>% 
  summarise(n = n(), 
            mean = mean(SSQ_diff_N, na.rm = TRUE), 
            sd = sd(SSQ_diff_N, na.rm = TRUE),
            stderr = sd/sqrt(n), 
            LCL = mean - qt(1 - (0.05 / 2), n - 1) * stderr,
            UCL = mean + qt(1 - (0.05 / 2), n - 1) * stderr,
            median=median(SSQ_diff_N, na.rm = TRUE),
            min=min(SSQ_diff_N, na.rm = TRUE), 
            max=max(SSQ_diff_N, na.rm = TRUE),
            IQR=IQR(SSQ_diff_N, na.rm = TRUE))
## # A tibble: 2 × 11
##   RvS       n    mean    sd stderr    LCL     UCL   median   min   max   IQR
##   <fct> <int>   <dbl> <dbl>  <dbl>  <dbl>   <dbl>    <dbl> <dbl> <dbl> <dbl>
## 1 1        45 -0.0377  1.24  0.185 -0.411  0.336  -0.00571 -4.02  1.57  1.73
## 2 2        44 -0.582   1.64  0.248 -1.08  -0.0822 -0.22    -4.45  1.43  2.58
# Oculomotor Disturbance

myData_SSQ_diff_O_noOutliers %>% select(SSQ_diff_O, Task_2DvAR, RvS) %>% group_by(Task_2DvAR, RvS) %>% 
  summarise(n = n(), 
            mean = mean(SSQ_diff_O, na.rm = TRUE), 
            sd = sd(SSQ_diff_O, na.rm = TRUE),
            stderr = sd/sqrt(n), 
            LCL = mean - qt(1 - (0.05 / 2), n - 1) * stderr,
            UCL = mean + qt(1 - (0.05 / 2), n - 1) * stderr,
            median=median(SSQ_diff_O, na.rm = TRUE),
            min=min(SSQ_diff_O, na.rm = TRUE), 
            max=max(SSQ_diff_O, na.rm = TRUE),
            IQR=IQR(SSQ_diff_O, na.rm = TRUE))
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 12
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS       n  mean    sd stderr     LCL   UCL median   min   max
##   <fct>      <fct> <int> <dbl> <dbl>  <dbl>   <dbl> <dbl>  <dbl> <dbl> <dbl>
## 1 1          1        20 1.20   2.65  0.593 -0.0433  2.44   1.08 -3.25  6.50
## 2 1          2        24 1.31   2.26  0.461  0.355   2.26   1.08 -3.25  5.41
## 3 2          1        25 1.58   2.63  0.527  0.492   2.67   1.08 -4.33  7.58
## 4 2          2        20 0.798  2.93  0.655 -0.573   2.17   1.08 -4.33  7.58
## # ℹ 1 more variable: IQR <dbl>
# Disorientation

myData_SSQ_diff_D_noOutliers %>% select(SSQ_diff_D, Task_2DvAR, RvS) %>% group_by(Task_2DvAR, RvS) %>% 
  summarise(n = n(), 
            mean = mean(SSQ_diff_D, na.rm = TRUE), 
            sd = sd(SSQ_diff_D, na.rm = TRUE),
            stderr = sd/sqrt(n), 
            LCL = mean - qt(1 - (0.05 / 2), n - 1) * stderr,
            UCL = mean + qt(1 - (0.05 / 2), n - 1) * stderr,
            median=median(SSQ_diff_D, na.rm = TRUE),
            min=min(SSQ_diff_D, na.rm = TRUE), 
            max=max(SSQ_diff_D, na.rm = TRUE),
            IQR=IQR(SSQ_diff_D, na.rm = TRUE))
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 12
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS       n  mean    sd stderr     LCL   UCL median   min   max
##   <fct>      <fct> <int> <dbl> <dbl>  <dbl>   <dbl> <dbl>  <dbl> <dbl> <dbl>
## 1 1          1        20 1.57   3.15  0.704  0.0958  3.04   0    -1.99  7.95
## 2 1          2        24 1.21   1.77  0.362  0.462   1.96   0    -1.99  5.97
## 3 2          1        25 1.36   1.88  0.376  0.580   2.13   1.99 -1.99  3.98
## 4 2          2        20 0.773  1.82  0.408 -0.0796  1.63   0    -1.99  3.98
## # ℹ 1 more variable: IQR <dbl>
# Total Score

myData_SSQ_diff_TS_noOutliers %>% select(SSQ_diff_TS, Task_2DvAR, RvS) %>% group_by(Task_2DvAR, RvS) %>% 
  summarise(n = n(), 
            mean = mean(SSQ_diff_TS, na.rm = TRUE), 
            sd = sd(SSQ_diff_TS, na.rm = TRUE),
            stderr = sd/sqrt(n), 
            LCL = mean - qt(1 - (0.05 / 2), n - 1) * stderr,
            UCL = mean + qt(1 - (0.05 / 2), n - 1) * stderr,
            median=median(SSQ_diff_TS, na.rm = TRUE),
            min=min(SSQ_diff_TS, na.rm = TRUE), 
            max=max(SSQ_diff_TS, na.rm = TRUE),
            IQR=IQR(SSQ_diff_TS, na.rm = TRUE))
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 12
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS       n  mean    sd stderr     LCL   UCL median    min   max
##   <fct>      <fct> <int> <dbl> <dbl>  <dbl>   <dbl> <dbl>  <dbl>  <dbl> <dbl>
## 1 1          1        20 0.295 0.683 0.153  -0.0244 0.615  0.234 -0.701  1.40
## 2 1          2        24 0.325 0.502 0.102   0.113  0.537  0.468 -0.701  1.17
## 3 2          1        25 0.278 0.447 0.0895  0.0936 0.463  0.234 -0.701  1.17
## 4 2          2        20 0.378 0.351 0.0785  0.213  0.542  0.234  0      1.17
## # ℹ 1 more variable: IQR <dbl>

FSK - Flow

Checking for outliers using Box-Plots

plot_Flow_Glatter_Verlauf <- ggplot(myData, aes(factor(Task_2DvAR), Flow_Glatter_Verlauf, )) + geom_boxplot() +
  geom_boxplot(fill = "grey92") +
  geom_point(aes(colour = Task_2DvAR),
    ## draw bigger points
    size = 2,
    ## add some transparency
    alpha = .5, show.legend = FALSE,
    ## add some jittering
    position = position_jitter(
      ## control randomness and range of jitter
      seed = 1, width = .2
    )) +
  scale_fill_brewer(palette = "Dark2",
  ) +
  theme_classic() +
    scale_x_discrete(name = "Condition",
    labels = c("2D", "AR")) +
  scale_y_continuous(name = "Fluency")+
  theme(axis.text.x = element_text(color = "grey20", size = 8, angle = 0, hjust = .5, vjust = .5, face = "plain"),
        axis.text.y = element_text(color = "grey20", size = 8, angle = 0, hjust = 1, vjust = 0, face = "plain"),  
        axis.title.x = element_text(color = "grey20", size = 10, angle = 0, hjust = .5, vjust = 0, face = "plain"),
        axis.title.y = element_text(color = "grey20", size = 10, angle = 90, hjust = .5, vjust = .5, face = "plain"))

plot_Flow_Absorbiertheit <- ggplot(myData, aes(factor(Task_2DvAR), Flow_Absorbiertheit, )) + geom_boxplot() +
  geom_boxplot(fill = "grey92") +
  geom_point(aes(colour = Task_2DvAR),
    ## draw bigger points
    size = 2,
    ## add some transparency
    alpha = .5, show.legend = FALSE,
    ## add some jittering
    position = position_jitter(
      ## control randomness and range of jitter
      seed = 1, width = .2
    )) +
  scale_fill_brewer(palette = "Dark2",
  ) +
  theme_classic() +
    scale_x_discrete(name = "Condition",
    labels = c("2D", "AR")) +
  scale_y_continuous(name = "Absorption")+
  theme(axis.text.x = element_text(color = "grey20", size = 8, angle = 0, hjust = .5, vjust = .5, face = "plain"),
        axis.text.y = element_text(color = "grey20", size = 8, angle = 0, hjust = 1, vjust = 0, face = "plain"),  
        axis.title.x = element_text(color = "grey20", size = 10, angle = 0, hjust = .5, vjust = 0, face = "plain"),
        axis.title.y = element_text(color = "grey20", size = 10, angle = 90, hjust = .5, vjust = .5, face = "plain"))

plot_Flow_Besorgnis <- ggplot(myData, aes(factor(Task_2DvAR), Flow_Besorgnis, )) + geom_boxplot() +
  geom_boxplot(fill = "grey92") +
  geom_point(aes(colour = Task_2DvAR),
    ## draw bigger points
    size = 2,
    ## add some transparency
    alpha = .5, show.legend = FALSE,
    ## add some jittering
    position = position_jitter(
      ## control randomness and range of jitter
      seed = 1, width = .2
    )) +
  scale_fill_brewer(palette = "Dark2",
  ) +
  theme_classic() +
    scale_x_discrete(name = "Condition",
    labels = c("2D", "AR")) +
  scale_y_continuous(name = "Concern")+
  theme(axis.text.x = element_text(color = "grey20", size = 8, angle = 0, hjust = .5, vjust = .5, face = "plain"),
        axis.text.y = element_text(color = "grey20", size = 8, angle = 0, hjust = 1, vjust = 0, face = "plain"),  
        axis.title.x = element_text(color = "grey20", size = 10, angle = 0, hjust = .5, vjust = 0, face = "plain"),
        axis.title.y = element_text(color = "grey20", size = 10, angle = 90, hjust = .5, vjust = .5, face = "plain"))

plot_Flow_Total <- ggplot(myData, aes(factor(Task_2DvAR), Flow_Total, )) + geom_boxplot() +
  geom_boxplot(fill = "grey92") +
  geom_point(aes(colour = Task_2DvAR),
    ## draw bigger points
    size = 2,
    ## add some transparency
    alpha = .5, show.legend = FALSE,
    ## add some jittering
    position = position_jitter(
      ## control randomness and range of jitter
      seed = 1, width = .2
    )) +
  scale_fill_brewer(palette = "Dark2",
  ) +
  theme_classic() +
    scale_x_discrete(name = "Condition",
    labels = c("2D", "AR")) +
  scale_y_continuous(name = "General factor")+
  theme(axis.text.x = element_text(color = "grey20", size = 8, angle = 0, hjust = .5, vjust = .5, face = "plain"),
        axis.text.y = element_text(color = "grey20", size = 8, angle = 0, hjust = 1, vjust = 0, face = "plain"),  
        axis.title.x = element_text(color = "grey20", size = 10, angle = 0, hjust = .5, vjust = 0, face = "plain"),
        axis.title.y = element_text(color = "grey20", size = 10, angle = 90, hjust = .5, vjust = .5, face = "plain"))

ggarrange(plot_Flow_Glatter_Verlauf, plot_Flow_Absorbiertheit, plot_Flow_Besorgnis, plot_Flow_Total, 
      #   labels = c("Fluency", "Absorption", "Concern", "General factor"),
           ncol = 2, nrow = 2)

Removing outliers when Interquartile Range IQR > 1.5

Flow_Glatter_Verlauf_2D <- subset(myData[myData$Task_2DvAR == 1, ], )

# create a vector of outliers for the numeric factor
outliers_Flow_Glatter_Verlauf_2D <- boxplot(Flow_Glatter_Verlauf_2D$Flow_Glatter_Verlauf, plot = FALSE)$out

# Replace the values with NA
Flow_Glatter_Verlauf_2D[Flow_Glatter_Verlauf_2D$Flow_Glatter_Verlauf %in% outliers_Flow_Glatter_Verlauf_2D, "Flow_Glatter_Verlauf"] = NA

Flow_Glatter_Verlauf_AR <- subset(myData[myData$Task_2DvAR == 2, ], )

# create a vector of outliers for the numeric factor
outliers_Flow_Glatter_Verlauf_AR <- boxplot(Flow_Glatter_Verlauf_AR$Flow_Glatter_Verlauf, plot = FALSE)$out

# Replace the values with NA
Flow_Glatter_Verlauf_AR[Flow_Glatter_Verlauf_AR$Flow_Glatter_Verlauf %in% outliers_Flow_Glatter_Verlauf_AR, "Flow_Glatter_Verlauf"] = NA

myData_Flow_Glatter_Verlauf_noOutliers <- rbind(Flow_Glatter_Verlauf_2D, Flow_Glatter_Verlauf_AR)

Flow_Absorbiertheit_2D <- subset(myData[myData$Task_2DvAR == 1, ], )

# create a vector of outliers for the numeric factor
outliers_Flow_Absorbiertheit_2D <- boxplot(Flow_Absorbiertheit_2D$Flow_Absorbiertheit, plot = FALSE)$out

# Replace the values with NA
Flow_Absorbiertheit_2D[Flow_Absorbiertheit_2D$Flow_Absorbiertheit %in% outliers_Flow_Absorbiertheit_2D, "Flow_Absorbiertheit"] = NA

Flow_Absorbiertheit_AR <- subset(myData[myData$Task_2DvAR == 2, ], )

# create a vector of outliers for the numeric factor
outliers_Flow_Absorbiertheit_AR <- boxplot(Flow_Absorbiertheit_AR$Flow_Absorbiertheit, plot = FALSE)$out

# Replace the values with NA
Flow_Absorbiertheit_AR[Flow_Absorbiertheit_AR$Flow_Absorbiertheit %in% outliers_Flow_Absorbiertheit_AR, "Flow_Absorbiertheit"] = NA

myData_Flow_Absorbiertheit_noOutliers <- rbind(Flow_Absorbiertheit_2D, Flow_Absorbiertheit_AR)

Flow_Besorgnis_2D <- subset(myData[myData$Task_2DvAR == 1, ], )

# create a vector of outliers for the numeric factor
outliers_Flow_Besorgnis_2D <- boxplot(Flow_Besorgnis_2D$Flow_Besorgnis, plot = FALSE)$out

# Replace the values with NA
Flow_Besorgnis_2D[Flow_Besorgnis_2D$Flow_Besorgnis %in% outliers_Flow_Besorgnis_2D, "Flow_Besorgnis"] = NA

Flow_Besorgnis_AR <- subset(myData[myData$Task_2DvAR == 2, ], )

# create a vector of outliers for the numeric factor
outliers_Flow_Besorgnis_AR <- boxplot(Flow_Besorgnis_AR$Flow_Besorgnis, plot = FALSE)$out

# Replace the values with NA
Flow_Besorgnis_AR[Flow_Besorgnis_AR$Flow_Besorgnis %in% outliers_Flow_Besorgnis_AR, "Flow_Besorgnis"] = NA

myData_Flow_Besorgnis_noOutliers <- rbind(Flow_Besorgnis_2D, Flow_Besorgnis_AR)

Flow_Total_2D <- subset(myData[myData$Task_2DvAR == 1, ], )

# create a vector of outliers for the numeric factor
outliers_Flow_Total_2D <- boxplot(Flow_Total_2D$Flow_Total, plot = FALSE)$out

# Replace the values with NA
Flow_Total_2D[Flow_Total_2D$Flow_Total %in% outliers_Flow_Total_2D, "Flow_Total"] = NA

Flow_Total_AR <- subset(myData[myData$Task_2DvAR == 2, ], )

# create a vector of outliers for the numeric factor
outliers_Flow_Total_AR <- boxplot(Flow_Total_AR$Flow_Total, plot = FALSE)$out

# Replace the values with NA
Flow_Total_AR[Flow_Total_AR$Flow_Total %in% outliers_Flow_Total_AR, "Flow_Total"] = NA

myData_Flow_Total_noOutliers <- rbind(Flow_Total_2D, Flow_Total_AR)

Checking normal distribution

#Perform the Shapiro-Wilk Test for Normality on each group
myData_Flow_Glatter_Verlauf_noOutliers %>%
  group_by(Task_2DvAR, RvS) %>%
  summarise(`W Statistic` = shapiro.test(Flow_Glatter_Verlauf)$statistic,
            `p-value` = shapiro.test(Flow_Glatter_Verlauf)$p.value)
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 4
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS   `W Statistic` `p-value`
##   <fct>      <fct>         <dbl>     <dbl>
## 1 1          1             0.991     0.999
## 2 1          2             0.968     0.606
## 3 2          1             0.968     0.604
## 4 2          2             0.983     0.965
myData_Flow_Absorbiertheit_noOutliers %>%
  group_by(Task_2DvAR, RvS) %>%
  summarise(`W Statistic` = shapiro.test(Flow_Absorbiertheit)$statistic,
            `p-value` = shapiro.test(Flow_Absorbiertheit)$p.value)
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 4
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS   `W Statistic` `p-value`
##   <fct>      <fct>         <dbl>     <dbl>
## 1 1          1             0.959    0.533 
## 2 1          2             0.939    0.152 
## 3 2          1             0.913    0.0474
## 4 2          2             0.938    0.221
myData_Flow_Besorgnis_noOutliers %>%
  group_by(Task_2DvAR, RvS) %>%
  summarise(`W Statistic` = shapiro.test(Flow_Besorgnis)$statistic,
            `p-value` = shapiro.test(Flow_Besorgnis)$p.value)
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 4
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS   `W Statistic` `p-value`
##   <fct>      <fct>         <dbl>     <dbl>
## 1 1          1             0.855   0.00648
## 2 1          2             0.917   0.0490 
## 3 2          1             0.893   0.0155 
## 4 2          2             0.881   0.0276
myData_Flow_Total_noOutliers %>%
  group_by(Task_2DvAR, RvS) %>%
  summarise(`W Statistic` = shapiro.test(Flow_Total)$statistic,
            `p-value` = shapiro.test(Flow_Total)$p.value)
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 4
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS   `W Statistic` `p-value`
##   <fct>      <fct>         <dbl>     <dbl>
## 1 1          1             0.938     0.217
## 2 1          2             0.969     0.654
## 3 2          1             0.982     0.933
## 4 2          2             0.971     0.782
#Perform QQ plots by group
ggplot(data = myData_Flow_Glatter_Verlauf_noOutliers, mapping = aes(sample = Flow_Glatter_Verlauf, color = Task_2DvAR, fill = Task_2DvAR)) +
  #stat_qq_band(alpha=0.5, conf=0.95, qtype=1, bandType = "ts") +
  stat_qq_line(identity=TRUE) +
  stat_qq_point(col="black") +
  facet_wrap(~ Task_2DvAR, scales = "free") +
  labs(x = "Theoretical Quantiles", y = "Sample Quantiles") + theme_bw() 

ggplot(data = myData_Flow_Absorbiertheit_noOutliers, mapping = aes(sample = Flow_Absorbiertheit, color = Task_2DvAR, fill = Task_2DvAR)) +
  #stat_qq_band(alpha=0.5, conf=0.95, qtype=1, bandType = "ts") +
  stat_qq_line(identity=TRUE) +
  stat_qq_point(col="black") +
  facet_wrap(~ Task_2DvAR, scales = "free") +
  labs(x = "Theoretical Quantiles", y = "Sample Quantiles") + theme_bw() 

ggplot(data = myData_Flow_Besorgnis_noOutliers, mapping = aes(sample = Flow_Besorgnis, color = Task_2DvAR, fill = Task_2DvAR)) +
  #stat_qq_band(alpha=0.5, conf=0.95, qtype=1, bandType = "ts") +
  stat_qq_line(identity=TRUE) +
  stat_qq_point(col="black") +
  facet_wrap(~ Task_2DvAR, scales = "free") +
  labs(x = "Theoretical Quantiles", y = "Sample Quantiles") + theme_bw() 

ggplot(data = myData_Flow_Total_noOutliers, mapping = aes(sample = Flow_Total, color = Task_2DvAR, fill = Task_2DvAR)) +
  #stat_qq_band(alpha=0.5, conf=0.95, qtype=1, bandType = "ts") +
  stat_qq_line(identity=TRUE) +
  stat_qq_point(col="black") +
  facet_wrap(~ Task_2DvAR, scales = "free") +
  labs(x = "Theoretical Quantiles", y = "Sample Quantiles") + theme_bw() 

To compare groups (2D vs AR) and conditions (real vs sham) we are calculating 2x2 ANOVAs

ANOVA_Flow_Glatter_Verlauf <- aov(Flow_Glatter_Verlauf ~ Task_2DvAR *RvS, data = myData_Flow_Glatter_Verlauf_noOutliers)
summary(ANOVA_Flow_Glatter_Verlauf)
##                Df Sum Sq Mean Sq F value Pr(>F)  
## Task_2DvAR      1   4.95   4.949   3.369 0.0699 .
## RvS             1   1.17   1.166   0.794 0.3754  
## Task_2DvAR:RvS  1   5.79   5.793   3.944 0.0503 .
## Residuals      85 124.85   1.469                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
leveneTest(ANOVA_Flow_Glatter_Verlauf)
## Levene's Test for Homogeneity of Variance (center = median)
##       Df F value Pr(>F)
## group  3  0.3547 0.7858
##       85
TukeyHSD(ANOVA_Flow_Glatter_Verlauf)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = Flow_Glatter_Verlauf ~ Task_2DvAR * RvS, data = myData_Flow_Glatter_Verlauf_noOutliers)
## 
## $Task_2DvAR
##         diff         lwr       upr     p adj
## 2-1 0.471633 -0.03925164 0.9825176 0.0699276
## 
## $RvS
##          diff        lwr      upr     p adj
## 2-1 0.2277744 -0.2831103 0.738659 0.3778733
## 
## $`Task_2DvAR:RvS`
##                diff         lwr       upr     p adj
## 2:1-1:1 -0.01333333 -0.96614274 0.9394761 0.9999821
## 1:2-1:1 -0.28750000 -1.24909125 0.6740912 0.8617388
## 2:2-1:1  0.72500000 -0.27934930 1.7293493 0.2393234
## 1:2-2:1 -0.27416667 -1.18179323 0.6334599 0.8580758
## 2:2-2:1  0.73833333 -0.21447607 1.6911427 0.1849493
## 2:2-1:2  1.01250000  0.05090875 1.9740912 0.0350802
effectsize::eta_squared(ANOVA_Flow_Glatter_Verlauf, partial = TRUE)
## # Effect Size for ANOVA (Type I)
## 
## Parameter      | Eta2 (partial) |       95% CI
## ----------------------------------------------
## Task_2DvAR     |           0.04 | [0.00, 1.00]
## RvS            |       9.25e-03 | [0.00, 1.00]
## Task_2DvAR:RvS |           0.04 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
ANOVA_Flow_Absorbiertheit <- aov(Flow_Absorbiertheit ~ Task_2DvAR *RvS, data = myData_Flow_Absorbiertheit_noOutliers)
summary(ANOVA_Flow_Absorbiertheit)
##                Df Sum Sq Mean Sq F value Pr(>F)
## Task_2DvAR      1   2.54  2.5392   2.123  0.149
## RvS             1   0.39  0.3935   0.329  0.568
## Task_2DvAR:RvS  1   0.00  0.0022   0.002  0.966
## Residuals      83  99.28  1.1962               
## 2 Beobachtungen als fehlend gelöscht
leveneTest(ANOVA_Flow_Absorbiertheit)
## Levene's Test for Homogeneity of Variance (center = median)
##       Df F value Pr(>F)
## group  3  1.6474 0.1847
##       83
ANOVA_Flow_Besorgnis <- aov(Flow_Besorgnis ~ Task_2DvAR *RvS, data = myData_Flow_Besorgnis_noOutliers)
summary(ANOVA_Flow_Besorgnis)
##                Df Sum Sq Mean Sq F value Pr(>F)  
## Task_2DvAR      1   6.33   6.326   4.243 0.0426 *
## RvS             1   3.00   3.003   2.014 0.1596  
## Task_2DvAR:RvS  1   0.19   0.194   0.130 0.7189  
## Residuals      82 122.25   1.491                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 3 Beobachtungen als fehlend gelöscht
leveneTest(ANOVA_Flow_Besorgnis)
## Levene's Test for Homogeneity of Variance (center = median)
##       Df F value Pr(>F)
## group  3  1.5103  0.218
##       82
effectsize::eta_squared(ANOVA_Flow_Besorgnis, partial = TRUE)
## # Effect Size for ANOVA (Type I)
## 
## Parameter      | Eta2 (partial) |       95% CI
## ----------------------------------------------
## Task_2DvAR     |           0.05 | [0.00, 1.00]
## RvS            |           0.02 | [0.00, 1.00]
## Task_2DvAR:RvS |       1.59e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
ANOVA_Flow_Total <- aov(Flow_Total ~ Task_2DvAR *RvS, data = myData_Flow_Total_noOutliers)
summary(ANOVA_Flow_Total)
##                Df Sum Sq Mean Sq F value Pr(>F)  
## Task_2DvAR      1   4.10   4.102   3.949 0.0501 .
## RvS             1   0.72   0.720   0.693 0.4074  
## Task_2DvAR:RvS  1   2.02   2.019   1.943 0.1670  
## Residuals      84  87.25   1.039                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 1 Beobachtung als fehlend gelöscht
leveneTest(ANOVA_Flow_Total)
## Levene's Test for Homogeneity of Variance (center = median)
##       Df F value Pr(>F)
## group  3  0.2762 0.8424
##       84
effectsize::eta_squared(ANOVA_Flow_Total, partial = TRUE)
## # Effect Size for ANOVA (Type I)
## 
## Parameter      | Eta2 (partial) |       95% CI
## ----------------------------------------------
## Task_2DvAR     |           0.04 | [0.00, 1.00]
## RvS            |       8.19e-03 | [0.00, 1.00]
## Task_2DvAR:RvS |           0.02 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].

Descriptive statistic per group

# Fluency

myData_Flow_Glatter_Verlauf_noOutliers %>% select(Flow_Glatter_Verlauf, Task_2DvAR, RvS) %>% group_by(Task_2DvAR, RvS) %>% 
  summarise(n = n(), 
            mean = mean(Flow_Glatter_Verlauf, na.rm = TRUE), 
            sd = sd(Flow_Glatter_Verlauf, na.rm = TRUE),
            stderr = sd/sqrt(n), 
            LCL = mean - qt(1 - (0.05 / 2), n - 1) * stderr,
            UCL = mean + qt(1 - (0.05 / 2), n - 1) * stderr,
            median=median(Flow_Glatter_Verlauf, na.rm = TRUE),
            min=min(Flow_Glatter_Verlauf, na.rm = TRUE), 
            max=max(Flow_Glatter_Verlauf, na.rm = TRUE),
            IQR=IQR(Flow_Glatter_Verlauf, na.rm = TRUE))
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 12
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS       n  mean    sd stderr   LCL   UCL median   min   max   IQR
##   <fct>      <fct> <int> <dbl> <dbl>  <dbl> <dbl> <dbl>  <dbl> <dbl> <dbl> <dbl>
## 1 1          1        20  3.93  1.06  0.238  3.44  4.43   3.92  1.67  6     1.25
## 2 1          2        24  3.65  1.18  0.241  3.15  4.14   3.42  1.5   5.67  1.83
## 3 2          1        25  3.92  1.35  0.270  3.36  4.48   4.17  1.5   6.83  1.83
## 4 2          2        20  4.66  1.21  0.270  4.09  5.22   4.58  2     6.67  1.54
# Absorption

myData_Flow_Absorbiertheit_noOutliers %>% select(Flow_Absorbiertheit, Task_2DvAR, RvS) %>% group_by(Task_2DvAR, RvS) %>% 
  summarise(n = n(), 
            mean = mean(Flow_Absorbiertheit, na.rm = TRUE), 
            sd = sd(Flow_Absorbiertheit, na.rm = TRUE),
            stderr = sd/sqrt(n), 
            LCL = mean - qt(1 - (0.05 / 2), n - 1) * stderr,
            UCL = mean + qt(1 - (0.05 / 2), n - 1) * stderr,
            median=median(Flow_Absorbiertheit, na.rm = TRUE),
            min=min(Flow_Absorbiertheit, na.rm = TRUE), 
            max=max(Flow_Absorbiertheit, na.rm = TRUE),
            IQR=IQR(Flow_Absorbiertheit, na.rm = TRUE))
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 12
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS       n  mean    sd stderr   LCL   UCL median   min   max   IQR
##   <fct>      <fct> <int> <dbl> <dbl>  <dbl> <dbl> <dbl>  <dbl> <dbl> <dbl> <dbl>
## 1 1          1        20  4.12 1.37   0.307  3.48  4.77   4     2     6.75  2.06
## 2 1          2        24  4.25 0.953  0.194  3.85  4.65   4     3     6.5   1.31
## 3 2          1        25  4.47 0.981  0.196  4.06  4.87   4.25  2.5   6.5   1.25
## 4 2          2        20  4.61 1.06   0.238  4.12  5.11   4.75  2.25  6     1.56
# Concern

myData_Flow_Besorgnis_noOutliers %>% select(Flow_Besorgnis, Task_2DvAR, RvS) %>% group_by(Task_2DvAR, RvS) %>% 
  summarise(n = n(), 
            mean = mean(Flow_Besorgnis, na.rm = TRUE), 
            sd = sd(Flow_Besorgnis, na.rm = TRUE),
            stderr = sd/sqrt(n), 
            LCL = mean - qt(1 - (0.05 / 2), n - 1) * stderr,
            UCL = mean + qt(1 - (0.05 / 2), n - 1) * stderr,
            median=median(Flow_Besorgnis, na.rm = TRUE),
            min=min(Flow_Besorgnis, na.rm = TRUE), 
            max=max(Flow_Besorgnis, na.rm = TRUE),
            IQR=IQR(Flow_Besorgnis, na.rm = TRUE))
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 12
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS       n  mean    sd stderr   LCL   UCL median   min   max   IQR
##   <fct>      <fct> <int> <dbl> <dbl>  <dbl> <dbl> <dbl>  <dbl> <dbl> <dbl> <dbl>
## 1 1          1        20  2.35 1.35   0.302  1.72  2.98   1.83     1  5.33  2   
## 2 1          2        24  2.82 1.41   0.289  2.22  3.42   2.67     1  5.33  2.67
## 3 2          1        25  1.94 0.866  0.173  1.59  2.30   1.67     1  3.67  1.42
## 4 2          2        20  2.22 1.20   0.268  1.66  2.78   2.17     1  4.67  2.00
# General Factor

myData_Flow_Total_noOutliers %>% select(Flow_Total, Task_2DvAR, RvS) %>% group_by(Task_2DvAR, RvS) %>% 
  summarise(n = n(), 
            mean = mean(Flow_Total, na.rm = TRUE), 
            sd = sd(Flow_Total, na.rm = TRUE),
            stderr = sd/sqrt(n), 
            LCL = mean - qt(1 - (0.05 / 2), n - 1) * stderr,
            UCL = mean + qt(1 - (0.05 / 2), n - 1) * stderr,
            median=median(Flow_Total, na.rm = TRUE),
            min=min(Flow_Total, na.rm = TRUE), 
            max=max(Flow_Total, na.rm = TRUE),
            IQR=IQR(Flow_Total, na.rm = TRUE))
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 12
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS       n  mean    sd stderr   LCL   UCL median   min   max   IQR
##   <fct>      <fct> <int> <dbl> <dbl>  <dbl> <dbl> <dbl>  <dbl> <dbl> <dbl> <dbl>
## 1 1          1        20  4.01 1.02   0.228  3.53  4.49   4.2    2.2   5.6  1.50
## 2 1          2        24  3.89 0.922  0.188  3.50  4.28   3.85   2.3   6    1.45
## 3 2          1        25  4.15 1.12   0.224  3.69  4.62   4.2    1.9   6.6  1.08
## 4 2          2        20  4.64 1.01   0.225  4.17  5.11   4.75   2.7   6.3  1.17

TUI

Checking for outliers using Box-Plots

plot_TUI_Neugierde <- ggplot(myData, aes(factor(Task_2DvAR), TUI_Neugierde, )) + geom_boxplot() +
  geom_boxplot(fill = "grey92") +
  geom_point(aes(colour = Task_2DvAR),
    ## draw bigger points
    size = 2,
    ## add some transparency
    alpha = .5, show.legend = FALSE,
    ## add some jittering
    position = position_jitter(
      ## control randomness and range of jitter
      seed = 1, width = .2
    )) +
  scale_fill_brewer(palette = "Dark2",
  ) +
  theme_classic() +
    scale_x_discrete(name = "Condition",
    labels = c("2D", "AR")) +
  scale_y_continuous(name = "Curiosity")+
  theme(axis.text.x = element_text(color = "grey20", size = 8, angle = 0, hjust = .5, vjust = .5, face = "plain"),
        axis.text.y = element_text(color = "grey20", size = 8, angle = 0, hjust = 1, vjust = 0, face = "plain"),  
        axis.title.x = element_text(color = "grey20", size = 10, angle = 0, hjust = .5, vjust = 0, face = "plain"),
        axis.title.y = element_text(color = "grey20", size = 10, angle = 90, hjust = .5, vjust = .5, face = "plain"))

plot_TUI_Technologieaengstlichkeit <- ggplot(myData, aes(factor(Task_2DvAR), TUI_Technologieaengstlichkeit, )) + geom_boxplot() +
  geom_boxplot(fill = "grey92") +
  geom_point(aes(colour = Task_2DvAR),
    ## draw bigger points
    size = 2,
    ## add some transparency
    alpha = .5, show.legend = FALSE,
    ## add some jittering
    position = position_jitter(
      ## control randomness and range of jitter
      seed = 1, width = .2
    )) +
  scale_fill_brewer(palette = "Dark2",
  ) +
  theme_classic() +
    scale_x_discrete(name = "Condition",
    labels = c("2D", "AR")) +
  scale_y_continuous(name = "Tech. Fear")+
  theme(axis.text.x = element_text(color = "grey20", size = 8, angle = 0, hjust = .5, vjust = .5, face = "plain"),
        axis.text.y = element_text(color = "grey20", size = 8, angle = 0, hjust = 1, vjust = 0, face = "plain"),  
        axis.title.x = element_text(color = "grey20", size = 10, angle = 0, hjust = .5, vjust = 0, face = "plain"),
        axis.title.y = element_text(color = "grey20", size = 10, angle = 90, hjust = .5, vjust = .5, face = "plain"))

plot_TUI_Interesse <- ggplot(myData, aes(factor(Task_2DvAR), TUI_Interesse, )) + geom_boxplot() +
  geom_boxplot(fill = "grey92") +
  geom_point(aes(colour = Task_2DvAR),
    ## draw bigger points
    size = 2,
    ## add some transparency
    alpha = .5, show.legend = FALSE,
    ## add some jittering
    position = position_jitter(
      ## control randomness and range of jitter
      seed = 1, width = .2
    )) +
  scale_fill_brewer(palette = "Dark2",
  ) +
  theme_classic() +
    scale_x_discrete(name = "Condition",
    labels = c("2D", "AR")) +
  scale_y_continuous(name = "Interest")+
  theme(axis.text.x = element_text(color = "grey20", size = 8, angle = 0, hjust = .5, vjust = .5, face = "plain"),
        axis.text.y = element_text(color = "grey20", size = 8, angle = 0, hjust = 1, vjust = 0, face = "plain"),  
        axis.title.x = element_text(color = "grey20", size = 10, angle = 0, hjust = .5, vjust = 0, face = "plain"),
        axis.title.y = element_text(color = "grey20", size = 10, angle = 90, hjust = .5, vjust = .5, face = "plain"))

plot_TUI_Benutzerfreundlichkeit <- ggplot(myData, aes(factor(Task_2DvAR), TUI_Benutzerfreundlichkeit, )) + geom_boxplot() +
  geom_boxplot(fill = "grey92") +
  geom_point(aes(colour = Task_2DvAR),
    ## draw bigger points
    size = 2,
    ## add some transparency
    alpha = .5, show.legend = FALSE,
    ## add some jittering
    position = position_jitter(
      ## control randomness and range of jitter
      seed = 1, width = .2
    )) +
  scale_fill_brewer(palette = "Dark2",
  ) +
  theme_classic() +
    scale_x_discrete(name = "Condition",
    labels = c("2D", "AR")) +
  scale_y_continuous(name = "Usability")+
  theme(axis.text.x = element_text(color = "grey20", size = 8, angle = 0, hjust = .5, vjust = .5, face = "plain"),
        axis.text.y = element_text(color = "grey20", size = 8, angle = 0, hjust = 1, vjust = 0, face = "plain"),  
        axis.title.x = element_text(color = "grey20", size = 10, angle = 0, hjust = .5, vjust = 0, face = "plain"),
        axis.title.y = element_text(color = "grey20", size = 10, angle = 90, hjust = .5, vjust = .5, face = "plain"))

plot_TUI_Immersion <- ggplot(myData, aes(factor(Task_2DvAR), TUI_Immersion, )) + geom_boxplot() +
  geom_boxplot(fill = "grey92") +
  geom_point(aes(colour = Task_2DvAR),
    ## draw bigger points
    size = 2,
    ## add some transparency
    alpha = .5, show.legend = FALSE,
    ## add some jittering
    position = position_jitter(
      ## control randomness and range of jitter
      seed = 1, width = .2
    )) +
  scale_fill_brewer(palette = "Dark2",
  ) +
  theme_classic() +
    scale_x_discrete(name = "Condition",
    labels = c("2D", "AR")) +
  scale_y_continuous(name = "Immersion")+
  theme(axis.text.x = element_text(color = "grey20", size = 8, angle = 0, hjust = .5, vjust = .5, face = "plain"),
        axis.text.y = element_text(color = "grey20", size = 8, angle = 0, hjust = 1, vjust = 0, face = "plain"),  
        axis.title.x = element_text(color = "grey20", size = 10, angle = 0, hjust = .5, vjust = 0, face = "plain"),
        axis.title.y = element_text(color = "grey20", size = 10, angle = 90, hjust = .5, vjust = .5, face = "plain"))

plot_TUI_Nuetzlichkeit <- ggplot(myData, aes(factor(Task_2DvAR), TUI_Nuetzlichkeit, )) + geom_boxplot() + geom_boxplot() +
  geom_boxplot(fill = "grey92") +
  geom_point(aes(colour = Task_2DvAR),
    ## draw bigger points
    size = 2,
    ## add some transparency
    alpha = .5, show.legend = FALSE,
    ## add some jittering
    position = position_jitter(
      ## control randomness and range of jitter
      seed = 1, width = .2
    )) +
  scale_fill_brewer(palette = "Dark2",
  ) +
  theme_classic() +
    scale_x_discrete(name = "Condition",
    labels = c("2D", "AR")) +
  scale_y_continuous(name = "Usefulness")+
  theme(axis.text.x = element_text(color = "grey20", size = 8, angle = 0, hjust = .5, vjust = .5, face = "plain"),
        axis.text.y = element_text(color = "grey20", size = 8, angle = 0, hjust = 1, vjust = 0, face = "plain"),  
        axis.title.x = element_text(color = "grey20", size = 10, angle = 0, hjust = .5, vjust = 0, face = "plain"),
        axis.title.y = element_text(color = "grey20", size = 10, angle = 90, hjust = .5, vjust = .5, face = "plain"))

plot_TUI_Skepsis <- ggplot(myData, aes(factor(Task_2DvAR), TUI_Skepsis, )) + geom_boxplot() +
  geom_boxplot(fill = "grey92") +
  geom_point(aes(colour = Task_2DvAR),
    ## draw bigger points
    size = 2,
    ## add some transparency
    alpha = .5, show.legend = FALSE,
    ## add some jittering
    position = position_jitter(
      ## control randomness and range of jitter
      seed = 1, width = .2
    )) +
  scale_fill_brewer(palette = "Dark2",
  ) +
  theme_classic() +
    scale_x_discrete(name = "Condition",
    labels = c("2D", "AR")) +
  scale_y_continuous(name = "Skepticism")+
  theme(axis.text.x = element_text(color = "grey20", size = 8, angle = 0, hjust = .5, vjust = .5, face = "plain"),
        axis.text.y = element_text(color = "grey20", size = 8, angle = 0, hjust = 1, vjust = 0, face = "plain"),  
        axis.title.x = element_text(color = "grey20", size = 10, angle = 0, hjust = .5, vjust = 0, face = "plain"),
        axis.title.y = element_text(color = "grey20", size = 10, angle = 90, hjust = .5, vjust = .5, face = "plain"))

plot_TUI_Zugaenglichkeit <- ggplot(myData, aes(factor(Task_2DvAR), TUI_Zugaenglichkeit, )) + geom_boxplot() + geom_boxplot() +
  geom_boxplot(fill = "grey92") +
  geom_point(aes(colour = Task_2DvAR),
    ## draw bigger points
    size = 2,
    ## add some transparency
    alpha = .5, show.legend = FALSE,
    ## add some jittering
    position = position_jitter(
      ## control randomness and range of jitter
      seed = 1, width = .2
    )) +
  scale_fill_brewer(palette = "Dark2",
  ) +
  theme_classic() +
    scale_x_discrete(name = "Condition",
    labels = c("2D", "AR")) +
  scale_y_continuous(name = "Accessibility")+
  theme(axis.text.x = element_text(color = "grey20", size = 8, angle = 0, hjust = .5, vjust = .5, face = "plain"),
        axis.text.y = element_text(color = "grey20", size = 8, angle = 0, hjust = 1, vjust = 0, face = "plain"),  
        axis.title.x = element_text(color = "grey20", size = 10, angle = 0, hjust = .5, vjust = 0, face = "plain"),
        axis.title.y = element_text(color = "grey20", size = 10, angle = 90, hjust = .5, vjust = .5, face = "plain"))

ggarrange(plot_TUI_Neugierde, plot_TUI_Technologieaengstlichkeit, plot_TUI_Interesse, plot_TUI_Benutzerfreundlichkeit, plot_TUI_Immersion, plot_TUI_Nuetzlichkeit, plot_TUI_Skepsis, plot_TUI_Zugaenglichkeit,
          #labels = c("Curiosity", "Technology Fear", "Interest", "Usability", "Immersion", "Usefulness", #"Skepticism", "Accessibility"),
          ncol = 2, nrow = 4)

Removing outliers when Interquartile Range IQR > 1.5

TUI_Technologieaengstlichkeit_2D <- subset(myData[myData$Task_2DvAR == 1, ], )

# create a vector of outliers for the numeric factor
outliers_TUI_Technologieaengstlichkeit_2D <- boxplot(TUI_Technologieaengstlichkeit_2D$TUI_Technologieaengstlichkeit, plot = FALSE)$out

# Replace the values with NA
TUI_Technologieaengstlichkeit_2D[TUI_Technologieaengstlichkeit_2D$TUI_Technologieaengstlichkeit %in% outliers_TUI_Technologieaengstlichkeit_2D, "TUI_Technologieaengstlichkeit"] = NA

TUI_Technologieaengstlichkeit_AR <- subset(myData[myData$Task_2DvAR == 2, ], )

# create a vector of outliers for the numeric factor
outliers_TUI_Technologieaengstlichkeit_AR <- boxplot(TUI_Technologieaengstlichkeit_AR$TUI_Technologieaengstlichkeit, plot = FALSE)$out

# Replace the values with NA
TUI_Technologieaengstlichkeit_AR[TUI_Technologieaengstlichkeit_AR$TUI_Technologieaengstlichkeit %in% outliers_TUI_Technologieaengstlichkeit_AR, "TUI_Technologieaengstlichkeit"] = NA

myData_TUI_Technologieaengstlichkeit_noOutliers <- rbind(TUI_Technologieaengstlichkeit_2D, TUI_Technologieaengstlichkeit_AR)

TUI_Benutzerfreundlichkeit_2D <- subset(myData[myData$Task_2DvAR == 1, ], )

# create a vector of outliers for the numeric factor
outliers_TUI_Benutzerfreundlichkeit_2D <- boxplot(TUI_Benutzerfreundlichkeit_2D$TUI_Benutzerfreundlichkeit, plot = FALSE)$out

# Replace the values with NA
TUI_Benutzerfreundlichkeit_2D[TUI_Benutzerfreundlichkeit_2D$TUI_Benutzerfreundlichkeit %in% outliers_TUI_Benutzerfreundlichkeit_2D, "TUI_Benutzerfreundlichkeit"] = NA

TUI_Benutzerfreundlichkeit_AR <- subset(myData[myData$Task_2DvAR == 2, ], )

# create a vector of outliers for the numeric factor
outliers_TUI_Benutzerfreundlichkeit_AR <- boxplot(TUI_Benutzerfreundlichkeit_AR$TUI_Benutzerfreundlichkeit, plot = FALSE)$out

# Replace the values with NA
TUI_Benutzerfreundlichkeit_AR[TUI_Benutzerfreundlichkeit_AR$TUI_Benutzerfreundlichkeit %in% outliers_TUI_Benutzerfreundlichkeit_AR, "TUI_Benutzerfreundlichkeit"] = NA

myData_TUI_Benutzerfreundlichkeit_noOutliers <- rbind(TUI_Benutzerfreundlichkeit_2D, TUI_Benutzerfreundlichkeit_AR)

TUI_Nuetzlichkeit_2D <- subset(myData[myData$Task_2DvAR == 1, ], )

# create a vector of outliers for the numeric factor
outliers_TUI_Nuetzlichkeit_2D <- boxplot(TUI_Nuetzlichkeit_2D$TUI_Nuetzlichkeit, plot = FALSE)$out

# Replace the values with NA
TUI_Nuetzlichkeit_2D[TUI_Nuetzlichkeit_2D$TUI_Nuetzlichkeit %in% outliers_TUI_Nuetzlichkeit_2D, "TUI_Nuetzlichkeit"] = NA

TUI_Nuetzlichkeit_AR <- subset(myData[myData$Task_2DvAR == 2, ], )

# create a vector of outliers for the numeric factor
outliers_TUI_Nuetzlichkeit_AR <- boxplot(TUI_Nuetzlichkeit_AR$TUI_Nuetzlichkeit, plot = FALSE)$out

# Replace the values with NA
TUI_Nuetzlichkeit_AR[TUI_Nuetzlichkeit_AR$TUI_Nuetzlichkeit %in% outliers_TUI_Nuetzlichkeit_AR, "TUI_Nuetzlichkeit"] = NA

myData_TUI_Nuetzlichkeit_noOutliers <- rbind(TUI_Nuetzlichkeit_2D, TUI_Nuetzlichkeit_AR)

TUI_Zugaenglichkeit_2D <- subset(myData[myData$Task_2DvAR == 1, ], )

# create a vector of outliers for the numeric factor
outliers_TUI_Zugaenglichkeit_2D <- boxplot(TUI_Zugaenglichkeit_2D$TUI_Zugaenglichkeit, plot = FALSE)$out

# Replace the values with NA
TUI_Zugaenglichkeit_2D[TUI_Zugaenglichkeit_2D$TUI_Zugaenglichkeit %in% outliers_TUI_Zugaenglichkeit_2D, "TUI_Zugaenglichkeit"] = NA

TUI_Zugaenglichkeit_AR <- subset(myData[myData$Task_2DvAR == 2, ], )

# create a vector of outliers for the numeric factor
outliers_TUI_Zugaenglichkeit_AR <- boxplot(TUI_Zugaenglichkeit_AR$TUI_Zugaenglichkeit, plot = FALSE)$out

# Replace the values with NA
TUI_Zugaenglichkeit_AR[TUI_Zugaenglichkeit_AR$TUI_Zugaenglichkeit %in% outliers_TUI_Zugaenglichkeit_AR, "TUI_Zugaenglichkeit"] = NA

myData_TUI_Zugaenglichkeit_noOutliers <- rbind(TUI_Zugaenglichkeit_2D, TUI_Zugaenglichkeit_AR)

Checking normal distribution

#Perform the Shapiro-Wilk Test for Normality on each group
myData %>%
  group_by(Task_2DvAR, RvS) %>%
  summarise(`W Statistic` = shapiro.test(TUI_Neugierde)$statistic,
            `p-value` = shapiro.test(TUI_Neugierde)$p.value)
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 4
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS   `W Statistic` `p-value`
##   <fct>      <fct>         <dbl>     <dbl>
## 1 1          1             0.981     0.950
## 2 1          2             0.947     0.233
## 3 2          1             0.941     0.159
## 4 2          2             0.950     0.374
myData_TUI_Technologieaengstlichkeit_noOutliers %>%
  group_by(Task_2DvAR, RvS) %>%
  summarise(`W Statistic` = shapiro.test(TUI_Technologieaengstlichkeit)$statistic,
            `p-value` = shapiro.test(TUI_Technologieaengstlichkeit)$p.value)
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 4
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS   `W Statistic` `p-value`
##   <fct>      <fct>         <dbl>     <dbl>
## 1 1          1             0.929  0.150   
## 2 1          2             0.924  0.0713  
## 3 2          1             0.773  0.000110
## 4 2          2             0.843  0.00405
myData %>%
  group_by(Task_2DvAR, RvS) %>%
  summarise(`W Statistic` = shapiro.test(TUI_Interesse)$statistic,
            `p-value` = shapiro.test(TUI_Interesse)$p.value)
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 4
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS   `W Statistic` `p-value`
##   <fct>      <fct>         <dbl>     <dbl>
## 1 1          1             0.889    0.0261
## 2 1          2             0.950    0.266 
## 3 2          1             0.928    0.0774
## 4 2          2             0.911    0.0663
myData_TUI_Benutzerfreundlichkeit_noOutliers %>%
  group_by(Task_2DvAR, RvS) %>%
  summarise(`W Statistic` = shapiro.test(TUI_Benutzerfreundlichkeit)$statistic,
            `p-value` = shapiro.test(TUI_Benutzerfreundlichkeit)$p.value)
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 4
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS   `W Statistic` `p-value`
##   <fct>      <fct>         <dbl>     <dbl>
## 1 1          1             0.844   0.00422
## 2 1          2             0.937   0.136  
## 3 2          1             0.917   0.0571 
## 4 2          2             0.944   0.279
myData %>%
  group_by(Task_2DvAR, RvS) %>%
  summarise(`W Statistic` = shapiro.test(TUI_Immersion)$statistic,
            `p-value` = shapiro.test(TUI_Immersion)$p.value)
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 4
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS   `W Statistic` `p-value`
##   <fct>      <fct>         <dbl>     <dbl>
## 1 1          1             0.950     0.374
## 2 1          2             0.940     0.166
## 3 2          1             0.960     0.422
## 4 2          2             0.986     0.987
myData_TUI_Nuetzlichkeit_noOutliers %>%
  group_by(Task_2DvAR, RvS) %>%
  summarise(`W Statistic` = shapiro.test(TUI_Nuetzlichkeit)$statistic,
            `p-value` = shapiro.test(TUI_Nuetzlichkeit)$p.value)
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 4
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS   `W Statistic` `p-value`
##   <fct>      <fct>         <dbl>     <dbl>
## 1 1          1             0.940  0.238   
## 2 1          2             0.819  0.000624
## 3 2          1             0.943  0.191   
## 4 2          2             0.904  0.0500
myData %>%
  group_by(Task_2DvAR, RvS) %>%
  summarise(`W Statistic` = shapiro.test(TUI_Skepsis)$statistic,
            `p-value` = shapiro.test(TUI_Skepsis)$p.value)
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 4
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS   `W Statistic` `p-value`
##   <fct>      <fct>         <dbl>     <dbl>
## 1 1          1             0.954    0.427 
## 2 1          2             0.921    0.0609
## 3 2          1             0.927    0.0723
## 4 2          2             0.917    0.0875
myData_TUI_Zugaenglichkeit_noOutliers %>%
  group_by(Task_2DvAR, RvS) %>%
  summarise(`W Statistic` = shapiro.test(TUI_Zugaenglichkeit)$statistic,
            `p-value` = shapiro.test(TUI_Zugaenglichkeit)$p.value)
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 4
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS   `W Statistic` `p-value`
##   <fct>      <fct>         <dbl>     <dbl>
## 1 1          1             0.948   0.336  
## 2 1          2             0.954   0.337  
## 3 2          1             0.846   0.00182
## 4 2          2             0.903   0.0550
#Perform QQ plots by group
ggplot(data = myData, mapping = aes(sample = TUI_Neugierde, color = Task_2DvAR, fill = Task_2DvAR)) +
  #stat_qq_band(alpha=0.5, conf=0.95, qtype=1, bandType = "ts") +
  stat_qq_line(identity=TRUE) +
  stat_qq_point(col="black") +
  facet_wrap(~ Task_2DvAR, scales = "free") +
  labs(x = "Theoretical Quantiles", y = "Sample Quantiles") + theme_bw() 

ggplot(data = myData_TUI_Technologieaengstlichkeit_noOutliers, mapping = aes(sample = TUI_Technologieaengstlichkeit, color = Task_2DvAR, fill = Task_2DvAR)) +
  #stat_qq_band(alpha=0.5, conf=0.95, qtype=1, bandType = "ts") +
  stat_qq_line(identity=TRUE) +
  stat_qq_point(col="black") +
  facet_wrap(~ Task_2DvAR, scales = "free") +
  labs(x = "Theoretical Quantiles", y = "Sample Quantiles") + theme_bw() 

ggplot(data = myData, mapping = aes(sample = TUI_Interesse, color = Task_2DvAR, fill = Task_2DvAR)) +
  #stat_qq_band(alpha=0.5, conf=0.95, qtype=1, bandType = "ts") +
  stat_qq_line(identity=TRUE) +
  stat_qq_point(col="black") +
  facet_wrap(~ Task_2DvAR, scales = "free") +
  labs(x = "Theoretical Quantiles", y = "Sample Quantiles") + theme_bw() 

ggplot(data = myData_TUI_Benutzerfreundlichkeit_noOutliers, mapping = aes(sample = TUI_Benutzerfreundlichkeit, color = Task_2DvAR, fill = Task_2DvAR)) +
  #stat_qq_band(alpha=0.5, conf=0.95, qtype=1, bandType = "ts") +
  stat_qq_line(identity=TRUE) +
  stat_qq_point(col="black") +
  facet_wrap(~ Task_2DvAR, scales = "free") +
  labs(x = "Theoretical Quantiles", y = "Sample Quantiles") + theme_bw() 

ggplot(data = myData, mapping = aes(sample = TUI_Immersion, color = Task_2DvAR, fill = Task_2DvAR)) +
  #stat_qq_band(alpha=0.5, conf=0.95, qtype=1, bandType = "ts") +
  stat_qq_line(identity=TRUE) +
  stat_qq_point(col="black") +
  facet_wrap(~ Task_2DvAR, scales = "free") +
  labs(x = "Theoretical Quantiles", y = "Sample Quantiles") + theme_bw() 

ggplot(data = myData_TUI_Nuetzlichkeit_noOutliers, mapping = aes(sample = TUI_Nuetzlichkeit, color = Task_2DvAR, fill = Task_2DvAR)) +
  #stat_qq_band(alpha=0.5, conf=0.95, qtype=1, bandType = "ts") +
  stat_qq_line(identity=TRUE) +
  stat_qq_point(col="black") +
  facet_wrap(~ Task_2DvAR, scales = "free") +
  labs(x = "Theoretical Quantiles", y = "Sample Quantiles") + theme_bw() 

ggplot(data = myData, mapping = aes(sample = TUI_Skepsis, color = Task_2DvAR, fill = Task_2DvAR)) +
  #stat_qq_band(alpha=0.5, conf=0.95, qtype=1, bandType = "ts") +
  stat_qq_line(identity=TRUE) +
  stat_qq_point(col="black") +
  facet_wrap(~ Task_2DvAR, scales = "free") +
  labs(x = "Theoretical Quantiles", y = "Sample Quantiles") + theme_bw() 

ggplot(data = myData_TUI_Zugaenglichkeit_noOutliers, mapping = aes(sample = TUI_Zugaenglichkeit, color = Task_2DvAR, fill = Task_2DvAR)) +
  #stat_qq_band(alpha=0.5, conf=0.95, qtype=1, bandType = "ts") +
  stat_qq_line(identity=TRUE) +
  stat_qq_point(col="black") +
  facet_wrap(~ Task_2DvAR, scales = "free") +
  labs(x = "Theoretical Quantiles", y = "Sample Quantiles") + theme_bw() 

To compare groups (2D vs AR) and conditions (real vs sham) we are calculating 2x2 ANOVAs

ANOVA_TUI_Neugierde <- aov(TUI_Neugierde ~ Task_2DvAR *RvS, data = myData)
summary(ANOVA_TUI_Neugierde)
##                Df Sum Sq Mean Sq F value Pr(>F)
## Task_2DvAR      1   3.13  3.1306   1.841  0.178
## RvS             1   0.48  0.4789   0.282  0.597
## Task_2DvAR:RvS  1   0.19  0.1918   0.113  0.738
## Residuals      85 144.58  1.7009
leveneTest(ANOVA_TUI_Neugierde)
## Levene's Test for Homogeneity of Variance (center = median)
##       Df F value Pr(>F)
## group  3  0.1015  0.959
##       85
ANOVA_TUI_Technologieaengstlichkeit <- aov(TUI_Technologieaengstlichkeit ~ Task_2DvAR *RvS, data = myData_TUI_Technologieaengstlichkeit_noOutliers)
summary(ANOVA_TUI_Technologieaengstlichkeit)
##                Df Sum Sq Mean Sq F value Pr(>F)  
## Task_2DvAR      1   1.78  1.7756   3.775 0.0554 .
## RvS             1   0.00  0.0046   0.010 0.9211  
## Task_2DvAR:RvS  1   0.95  0.9470   2.013 0.1596  
## Residuals      84  39.51  0.4704                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 1 Beobachtung als fehlend gelöscht
leveneTest(ANOVA_TUI_Technologieaengstlichkeit)
## Levene's Test for Homogeneity of Variance (center = median)
##       Df F value Pr(>F)
## group  3  1.0966 0.3552
##       84
effectsize::eta_squared(ANOVA_TUI_Technologieaengstlichkeit, partial = TRUE)
## # Effect Size for ANOVA (Type I)
## 
## Parameter      | Eta2 (partial) |       95% CI
## ----------------------------------------------
## Task_2DvAR     |           0.04 | [0.00, 1.00]
## RvS            |       1.17e-04 | [0.00, 1.00]
## Task_2DvAR:RvS |           0.02 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
ANOVA_TUI_Interesse <- aov(TUI_Interesse ~ Task_2DvAR *RvS, data = myData)
summary(ANOVA_TUI_Interesse)
##                Df Sum Sq Mean Sq F value Pr(>F)
## Task_2DvAR      1   3.12  3.1201   1.469  0.229
## RvS             1   0.00  0.0031   0.001  0.970
## Task_2DvAR:RvS  1   0.67  0.6727   0.317  0.575
## Residuals      85 180.59  2.1246
leveneTest(ANOVA_TUI_Interesse)
## Levene's Test for Homogeneity of Variance (center = median)
##       Df F value Pr(>F)
## group  3  1.0326 0.3824
##       85
ANOVA_TUI_Benutzerfreundlichkeit <- aov(TUI_Benutzerfreundlichkeit ~ Task_2DvAR *RvS, data = myData_TUI_Benutzerfreundlichkeit_noOutliers)
summary(ANOVA_TUI_Benutzerfreundlichkeit)
##                Df Sum Sq Mean Sq F value  Pr(>F)   
## Task_2DvAR      1  2.848  2.8479   9.729 0.00249 **
## RvS             1  0.705  0.7054   2.410 0.12437   
## Task_2DvAR:RvS  1  0.245  0.2449   0.837 0.36305   
## Residuals      83 24.296  0.2927                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 2 Beobachtungen als fehlend gelöscht
leveneTest(ANOVA_TUI_Benutzerfreundlichkeit)
## Levene's Test for Homogeneity of Variance (center = median)
##       Df F value Pr(>F)
## group  3  0.6645 0.5762
##       83
effectsize::eta_squared(ANOVA_TUI_Benutzerfreundlichkeit, partial = TRUE)
## # Effect Size for ANOVA (Type I)
## 
## Parameter      | Eta2 (partial) |       95% CI
## ----------------------------------------------
## Task_2DvAR     |           0.10 | [0.02, 1.00]
## RvS            |           0.03 | [0.00, 1.00]
## Task_2DvAR:RvS |       9.98e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
ANOVA_TUI_Immersion <- aov(TUI_Immersion ~ Task_2DvAR *RvS, data = myData)
summary(ANOVA_TUI_Immersion)
##                Df Sum Sq Mean Sq F value Pr(>F)
## Task_2DvAR      1   0.28  0.2835   0.131  0.718
## RvS             1   0.00  0.0027   0.001  0.972
## Task_2DvAR:RvS  1   1.59  1.5928   0.738  0.393
## Residuals      85 183.45  2.1582
leveneTest(ANOVA_TUI_Immersion)
## Levene's Test for Homogeneity of Variance (center = median)
##       Df F value Pr(>F)
## group  3  0.3925 0.7587
##       85
ANOVA_TUI_Nuetzlichkeit <- aov(TUI_Nuetzlichkeit ~ Task_2DvAR *RvS, data = myData_TUI_Nuetzlichkeit_noOutliers)
summary(ANOVA_TUI_Nuetzlichkeit)
##                Df Sum Sq Mean Sq F value Pr(>F)
## Task_2DvAR      1   0.68  0.6825   0.391  0.533
## RvS             1   0.84  0.8367   0.480  0.490
## Task_2DvAR:RvS  1   2.05  2.0463   1.173  0.282
## Residuals      84 146.54  1.7445               
## 1 Beobachtung als fehlend gelöscht
leveneTest(ANOVA_TUI_Nuetzlichkeit)
## Levene's Test for Homogeneity of Variance (center = median)
##       Df F value Pr(>F)
## group  3  0.4956 0.6863
##       84
ANOVA_TUI_Skepsis <- aov(TUI_Skepsis ~ Task_2DvAR *RvS, data = myData)
summary(ANOVA_TUI_Skepsis)
##                Df Sum Sq Mean Sq F value Pr(>F)
## Task_2DvAR      1   1.25  1.2509   0.906  0.344
## RvS             1   0.14  0.1379   0.100  0.753
## Task_2DvAR:RvS  1   2.17  2.1675   1.570  0.214
## Residuals      85 117.34  1.3805
leveneTest(ANOVA_TUI_Skepsis)
## Levene's Test for Homogeneity of Variance (center = median)
##       Df F value Pr(>F)
## group  3  0.3744 0.7717
##       85
ANOVA_TUI_Zugaenglichkeit <- aov(TUI_Zugaenglichkeit ~ Task_2DvAR *RvS, data = myData_TUI_Zugaenglichkeit_noOutliers)
summary(ANOVA_TUI_Zugaenglichkeit)
##                Df Sum Sq Mean Sq F value Pr(>F)  
## Task_2DvAR      1   7.44   7.440   5.196 0.0252 *
## RvS             1   1.03   1.029   0.719 0.3991  
## Task_2DvAR:RvS  1   3.46   3.457   2.414 0.1241  
## Residuals      83 118.85   1.432                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 2 Beobachtungen als fehlend gelöscht
leveneTest(ANOVA_TUI_Zugaenglichkeit)
## Levene's Test for Homogeneity of Variance (center = median)
##       Df F value Pr(>F)
## group  3  1.1423 0.3369
##       83
effectsize::eta_squared(ANOVA_TUI_Zugaenglichkeit, partial = TRUE)
## # Effect Size for ANOVA (Type I)
## 
## Parameter      | Eta2 (partial) |       95% CI
## ----------------------------------------------
## Task_2DvAR     |           0.06 | [0.00, 1.00]
## RvS            |       8.58e-03 | [0.00, 1.00]
## Task_2DvAR:RvS |           0.03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].

Descriptive statistic per group

# Curiosity

myData %>% select(TUI_Neugierde, Task_2DvAR, RvS) %>% group_by(Task_2DvAR, RvS) %>% 
  summarise(n = n(), 
            mean = mean(TUI_Neugierde, na.rm = TRUE), 
            sd = sd(TUI_Neugierde, na.rm = TRUE),
            stderr = sd/sqrt(n), 
            LCL = mean - qt(1 - (0.05 / 2), n - 1) * stderr,
            UCL = mean + qt(1 - (0.05 / 2), n - 1) * stderr,
            median=median(TUI_Neugierde, na.rm = TRUE),
            min=min(TUI_Neugierde, na.rm = TRUE), 
            max=max(TUI_Neugierde, na.rm = TRUE),
            IQR=IQR(TUI_Neugierde, na.rm = TRUE))
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 12
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS       n  mean    sd stderr   LCL   UCL median   min   max   IQR
##   <fct>      <fct> <int> <dbl> <dbl>  <dbl> <dbl> <dbl>  <dbl> <dbl> <dbl> <dbl>
## 1 1          1        20  4.24  1.20  0.269  3.68  4.80   4.38  2.25  6.75  1.75
## 2 1          2        24  4.48  1.38  0.281  3.90  5.06   4.75  1     6.5   2.06
## 3 2          1        25  4.72  1.37  0.274  4.15  5.29   5     1     7     1.75
## 4 2          2        20  4.78  1.22  0.274  4.20  5.35   4.5   2.75  6.75  1.31
# Technology Fear

myData_TUI_Technologieaengstlichkeit_noOutliers %>% select(TUI_Technologieaengstlichkeit, Task_2DvAR, RvS) %>% group_by(Task_2DvAR, RvS) %>% 
  summarise(n = n(), 
            mean = mean(TUI_Technologieaengstlichkeit, na.rm = TRUE), 
            sd = sd(TUI_Technologieaengstlichkeit, na.rm = TRUE),
            stderr = sd/sqrt(n), 
            LCL = mean - qt(1 - (0.05 / 2), n - 1) * stderr,
            UCL = mean + qt(1 - (0.05 / 2), n - 1) * stderr,
            median=median(TUI_Technologieaengstlichkeit, na.rm = TRUE),
            min=min(TUI_Technologieaengstlichkeit, na.rm = TRUE), 
            max=max(TUI_Technologieaengstlichkeit, na.rm = TRUE),
            IQR=IQR(TUI_Technologieaengstlichkeit, na.rm = TRUE))
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 12
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS       n  mean    sd stderr   LCL   UCL median   min   max   IQR
##   <fct>      <fct> <int> <dbl> <dbl>  <dbl> <dbl> <dbl>  <dbl> <dbl> <dbl> <dbl>
## 1 1          1        20  2.02 0.739  0.165  1.68  2.37   2.12     1  3.75  1.25
## 2 1          2        24  1.80 0.630  0.129  1.54  2.07   1.75     1  3     1   
## 3 2          1        25  1.53 0.591  0.118  1.29  1.78   1.38     1  3.5   0.25
## 4 2          2        20  1.72 0.794  0.178  1.35  2.10   1.25     1  3.75  1.25
# Interest

myData %>% select(TUI_Interesse, Task_2DvAR, RvS) %>% group_by(Task_2DvAR, RvS) %>% 
  summarise(n = n(), 
            mean = mean(TUI_Interesse, na.rm = TRUE), 
            sd = sd(TUI_Interesse, na.rm = TRUE),
            stderr = sd/sqrt(n), 
            LCL = mean - qt(1 - (0.05 / 2), n - 1) * stderr,
            UCL = mean + qt(1 - (0.05 / 2), n - 1) * stderr,
            median=median(TUI_Interesse, na.rm = TRUE),
            min=min(TUI_Interesse, na.rm = TRUE), 
            max=max(TUI_Interesse, na.rm = TRUE),
            IQR=IQR(TUI_Interesse, na.rm = TRUE))
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 12
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS       n  mean    sd stderr   LCL   UCL median   min   max   IQR
##   <fct>      <fct> <int> <dbl> <dbl>  <dbl> <dbl> <dbl>  <dbl> <dbl> <dbl> <dbl>
## 1 1          1        20  3.49  1.20  0.269  2.93  4.05   3.75  1.5   5     2   
## 2 1          2        24  3.32  1.42  0.290  2.72  3.92   3     1     6.25  2.19
## 3 2          1        25  3.69  1.49  0.298  3.08  4.30   3.75  1.75  6.5   2.25
## 4 2          2        20  3.88  1.68  0.376  3.09  4.66   3.62  1.75  6.75  2.94
# Usability

myData_TUI_Benutzerfreundlichkeit_noOutliers %>% select(TUI_Benutzerfreundlichkeit, Task_2DvAR, RvS) %>% group_by(Task_2DvAR, RvS) %>% 
  summarise(n = n(), 
            mean = mean(TUI_Benutzerfreundlichkeit, na.rm = TRUE), 
            sd = sd(TUI_Benutzerfreundlichkeit, na.rm = TRUE),
            stderr = sd/sqrt(n), 
            LCL = mean - qt(1 - (0.05 / 2), n - 1) * stderr,
            UCL = mean + qt(1 - (0.05 / 2), n - 1) * stderr,
            median=median(TUI_Benutzerfreundlichkeit, na.rm = TRUE),
            min=min(TUI_Benutzerfreundlichkeit, na.rm = TRUE), 
            max=max(TUI_Benutzerfreundlichkeit, na.rm = TRUE),
            IQR=IQR(TUI_Benutzerfreundlichkeit, na.rm = TRUE))
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 12
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS       n  mean    sd stderr   LCL   UCL median   min   max   IQR
##   <fct>      <fct> <int> <dbl> <dbl>  <dbl> <dbl> <dbl>  <dbl> <dbl> <dbl> <dbl>
## 1 1          1        20  4.38 0.642 0.144   4.08  4.68   4.33  3     5    0.750
## 2 1          2        24  4.10 0.543 0.111   3.87  4.33   4.17  3     5    1    
## 3 2          1        25  4.62 0.485 0.0970  4.42  4.82   4.67  3.33  5.33 0.667
## 4 2          2        20  4.55 0.487 0.109   4.32  4.78   4.67  3.67  5.67 0.750
# Immersion

myData %>% select(TUI_Immersion, Task_2DvAR, RvS) %>% group_by(Task_2DvAR, RvS) %>% 
  summarise(n = n(), 
            mean = mean(TUI_Immersion, na.rm = TRUE), 
            sd = sd(TUI_Immersion, na.rm = TRUE),
            stderr = sd/sqrt(n), 
            LCL = mean - qt(1 - (0.05 / 2), n - 1) * stderr,
            UCL = mean + qt(1 - (0.05 / 2), n - 1) * stderr,
            median=median(TUI_Immersion, na.rm = TRUE),
            min=min(TUI_Immersion, na.rm = TRUE), 
            max=max(TUI_Immersion, na.rm = TRUE),
            IQR=IQR(TUI_Immersion, na.rm = TRUE))
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 12
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS       n  mean    sd stderr   LCL   UCL median   min   max   IQR
##   <fct>      <fct> <int> <dbl> <dbl>  <dbl> <dbl> <dbl>  <dbl> <dbl> <dbl> <dbl>
## 1 1          1        20  4.06  1.56  0.349  3.33  4.79   4      1.5  6.75  2.38
## 2 1          2        24  3.80  1.50  0.305  3.17  4.43   3.5    1.5  6.25  2.31
## 3 2          1        25  3.91  1.43  0.287  3.32  4.50   4      1    6.5   1.75
## 4 2          2        20  4.19  1.38  0.309  3.54  4.83   4.38   1.5  7     1.56
# Usefulness

myData_TUI_Nuetzlichkeit_noOutliers %>% select(TUI_Nuetzlichkeit, Task_2DvAR, RvS) %>% group_by(Task_2DvAR, RvS) %>% 
  summarise(n = n(), 
            mean = mean(TUI_Nuetzlichkeit, na.rm = TRUE), 
            sd = sd(TUI_Nuetzlichkeit, na.rm = TRUE),
            stderr = sd/sqrt(n), 
            LCL = mean - qt(1 - (0.05 / 2), n - 1) * stderr,
            UCL = mean + qt(1 - (0.05 / 2), n - 1) * stderr,
            median=median(TUI_Nuetzlichkeit, na.rm = TRUE),
            min=min(TUI_Nuetzlichkeit, na.rm = TRUE), 
            max=max(TUI_Nuetzlichkeit, na.rm = TRUE),
            IQR=IQR(TUI_Nuetzlichkeit, na.rm = TRUE))
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 12
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS       n  mean    sd stderr   LCL   UCL median   min   max   IQR
##   <fct>      <fct> <int> <dbl> <dbl>  <dbl> <dbl> <dbl>  <dbl> <dbl> <dbl> <dbl>
## 1 1          1        20  3.08  1.25  0.280  2.49  3.66   2.88  1     5.25  2.12
## 2 1          2        24  2.57  1.54  0.315  1.92  3.22   2.12  1     6.75  1.44
## 3 2          1        25  2.93  1.33  0.266  2.38  3.48   2.5   1     6     1.81
## 4 2          2        20  3.04  1.06  0.237  2.54  3.53   3     1.75  6     1.25
# Skepticism

myData %>% select(TUI_Skepsis, Task_2DvAR, RvS) %>% group_by(Task_2DvAR, RvS) %>% 
  summarise(n = n(), 
            mean = mean(TUI_Skepsis, na.rm = TRUE), 
            sd = sd(TUI_Skepsis, na.rm = TRUE),
            stderr = sd/sqrt(n), 
            LCL = mean - qt(1 - (0.05 / 2), n - 1) * stderr,
            UCL = mean + qt(1 - (0.05 / 2), n - 1) * stderr,
            median=median(TUI_Skepsis, na.rm = TRUE),
            min=min(TUI_Skepsis, na.rm = TRUE), 
            max=max(TUI_Skepsis, na.rm = TRUE),
            IQR=IQR(TUI_Skepsis, na.rm = TRUE))
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 12
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS       n  mean    sd stderr   LCL   UCL median   min   max   IQR
##   <fct>      <fct> <int> <dbl> <dbl>  <dbl> <dbl> <dbl>  <dbl> <dbl> <dbl> <dbl>
## 1 1          1        20  3.05  1.10  0.246  2.54  3.56   3.25  1     5.25 0.812
## 2 1          2        24  2.81  1.13  0.231  2.33  3.29   3.12  1     4.5  1.62 
## 3 2          1        25  2.51  1.13  0.226  2.04  2.98   2.25  1     4.75 2    
## 4 2          2        20  2.9   1.34  0.300  2.27  3.53   2.5   1.25  5.5  2.12
# Accessibility

myData_TUI_Zugaenglichkeit_noOutliers %>% select(TUI_Zugaenglichkeit, Task_2DvAR, RvS) %>% group_by(Task_2DvAR, RvS) %>% 
  summarise(n = n(), 
            mean = mean(TUI_Zugaenglichkeit, na.rm = TRUE), 
            sd = sd(TUI_Zugaenglichkeit, na.rm = TRUE),
            stderr = sd/sqrt(n), 
            LCL = mean - qt(1 - (0.05 / 2), n - 1) * stderr,
            UCL = mean + qt(1 - (0.05 / 2), n - 1) * stderr,
            median=median(TUI_Zugaenglichkeit, na.rm = TRUE),
            min=min(TUI_Zugaenglichkeit, na.rm = TRUE), 
            max=max(TUI_Zugaenglichkeit, na.rm = TRUE),
            IQR=IQR(TUI_Zugaenglichkeit, na.rm = TRUE))
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 12
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS       n  mean    sd stderr   LCL   UCL median   min   max   IQR
##   <fct>      <fct> <int> <dbl> <dbl>  <dbl> <dbl> <dbl>  <dbl> <dbl> <dbl> <dbl>
## 1 1          1        20  3.18 1.47   0.328  2.50  3.87   3.33     1  6.33  2.42
## 2 1          2        24  2.57 0.955  0.195  2.17  2.97   2.5      1  5     1.17
## 3 2          1        25  2.18 1.15   0.229  1.71  2.65   1.83     1  5     1.33
## 4 2          2        20  2.37 1.22   0.272  1.80  2.94   2.33     1  5     1.83

Other questions - Concentration, etc.

Checking for outliers using Box-Plots

plot_Kontrolle <- ggplot(myData, aes(factor(Task_2DvAR, RvS), Kontrolle, )) + geom_boxplot() +
  geom_boxplot(fill = "grey92") +
  geom_point(aes(colour = Task_2DvAR),
    ## draw bigger points
    size = 2,
    ## add some transparency
    alpha = .5, show.legend = FALSE,
    ## add some jittering
    position = position_jitter(
      ## control randomness and range of jitter
      seed = 1, width = .2
    )) +
  scale_fill_brewer(palette = "Dark2",
  ) +
  theme_classic() +
    scale_x_discrete(name = "Condition",
    labels = c("2D", "AR")) +
  scale_y_continuous(name = "Control")+
  theme(axis.text.x = element_text(color = "grey20", size = 8, angle = 0, hjust = .5, vjust = .5, face = "plain"),
        axis.text.y = element_text(color = "grey20", size = 8, angle = 0, hjust = 1, vjust = 0, face = "plain"),  
        axis.title.x = element_text(color = "grey20", size = 10, angle = 0, hjust = .5, vjust = 0, face = "plain"),
        axis.title.y = element_text(color = "grey20", size = 10, angle = 90, hjust = .5, vjust = .5, face = "plain"))

plot_Konzentration <- ggplot(myData, aes(factor(Task_2DvAR), Konzentration, )) + geom_boxplot() +
  geom_boxplot(fill = "grey92") +
  geom_point(aes(colour = Task_2DvAR),
    ## draw bigger points
    size = 2,
    ## add some transparency
    alpha = .5, show.legend = FALSE,
    ## add some jittering
    position = position_jitter(
      ## control randomness and range of jitter
      seed = 1, width = .2
    )) +
  scale_fill_brewer(palette = "Dark2",
  ) +
  theme_classic() +
    scale_x_discrete(name = "Condition",
    labels = c("2D", "AR")) +
  scale_y_continuous(name = "Concentration")+
  theme(axis.text.x = element_text(color = "grey20", size = 8, angle = 0, hjust = .5, vjust = .5, face = "plain"),
        axis.text.y = element_text(color = "grey20", size = 8, angle = 0, hjust = 1, vjust = 0, face = "plain"),  
        axis.title.x = element_text(color = "grey20", size = 10, angle = 0, hjust = .5, vjust = 0, face = "plain"),
        axis.title.y = element_text(color = "grey20", size = 10, angle = 90, hjust = .5, vjust = .5, face = "plain"))

plot_Erfolg_Strategie <- ggplot(myData, aes(factor(Task_2DvAR), Erfolg_Strategie, )) + geom_boxplot() +
  geom_boxplot(fill = "grey92") +
  geom_point(aes(colour = Task_2DvAR),
    ## draw bigger points
    size = 2,
    ## add some transparency
    alpha = .5, show.legend = FALSE,
    ## add some jittering
    position = position_jitter(
      ## control randomness and range of jitter
      seed = 1, width = .2
    )) +
  scale_fill_brewer(palette = "Dark2",
  ) +
  theme_classic() +
    scale_x_discrete(name = "Condition",
    labels = c("2D", "AR")) +
  scale_y_continuous(name = "Perceived Success")+
  theme(axis.text.x = element_text(color = "grey20", size = 8, angle = 0, hjust = .5, vjust = .5, face = "plain"),
        axis.text.y = element_text(color = "grey20", size = 8, angle = 0, hjust = 1, vjust = 0, face = "plain"),  
        axis.title.x = element_text(color = "grey20", size = 10, angle = 0, hjust = .5, vjust = 0, face = "plain"),
        axis.title.y = element_text(color = "grey20", size = 10, angle = 90, hjust = .5, vjust = .5, face = "plain"))

plot_Spass <- ggplot(myData, aes(factor(Task_2DvAR), Spass, )) + geom_boxplot() +
  geom_boxplot(fill = "grey92") +
  geom_point(aes(colour = Task_2DvAR),
    ## draw bigger points
    size = 2,
    ## add some transparency
    alpha = .5, show.legend = FALSE,
    ## add some jittering
    position = position_jitter(
      ## control randomness and range of jitter
      seed = 1, width = .2
    )) +
  scale_fill_brewer(palette = "Dark2",
  ) +
  theme_classic() +
    scale_x_discrete(name = "Condition",
    labels = c("2D", "AR")) +
  scale_y_continuous(name = "Fun")+
  theme(axis.text.x = element_text(color = "grey20", size = 8, angle = 0, hjust = .5, vjust = .5, face = "plain"),
        axis.text.y = element_text(color = "grey20", size = 8, angle = 0, hjust = 1, vjust = 0, face = "plain"),  
        axis.title.x = element_text(color = "grey20", size = 10, angle = 0, hjust = .5, vjust = 0, face = "plain"),
        axis.title.y = element_text(color = "grey20", size = 10, angle = 90, hjust = .5, vjust = .5, face = "plain"))

#ggarrange(plot_Kontrolle, plot_Konzentration, plot_Erfolg_Strategie, plot_Spass, 
         #labels = c("Control", "Concentration", "Perceived Success", "Fun"),
           #ncol = 2, nrow = 2)

Removing outliers when Interquartile Range IQR > 1.5

Kontrolle_2D <- subset(myData[myData$Task_2DvAR == 1, ], )

# create a vector of outliers for the numeric factor
outliers_Kontrolle_2D <- boxplot(Kontrolle_2D$Kontrolle, plot = FALSE)$out

# Replace the values with NA
Kontrolle_2D[Kontrolle_2D$Kontrolle %in% outliers_Kontrolle_2D, "Kontrolle"] = NA

Kontrolle_AR <- subset(myData[myData$Task_2DvAR == 2, ], )

# create a vector of outliers for the numeric factor
outliers_Kontrolle_AR <- boxplot(Kontrolle_AR$Kontrolle, plot = FALSE)$out

# Replace the values with NA
Kontrolle_AR[Kontrolle_AR$Kontrolle %in% outliers_Kontrolle_AR, "Kontrolle"] = NA

myData_Kontrolle_noOutliers <- rbind(Kontrolle_2D, Kontrolle_AR)

Konzentration_2D <- subset(myData[myData$Task_2DvAR == 1, ], )

# create a vector of outliers for the numeric factor
outliers_Konzentration_2D <- boxplot(Konzentration_2D$Konzentration, plot = FALSE)$out

# Replace the values with NA
Konzentration_2D[Konzentration_2D$Konzentration %in% outliers_Konzentration_2D, "Konzentration"] = NA

Konzentration_AR <- subset(myData[myData$Task_2DvAR == 2, ], )

# create a vector of outliers for the numeric factor
outliers_Konzentration_AR <- boxplot(Konzentration_AR$Konzentration, plot = FALSE)$out

# Replace the values with NA
Konzentration_AR[Konzentration_AR$Konzentration %in% outliers_Konzentration_AR, "Konzentration"] = NA

myData_Konzentration_noOutliers <- rbind(Konzentration_2D, Konzentration_AR)

Erfolg_Strategie_2D <- subset(myData[myData$Task_2DvAR == 1, ], )

# create a vector of outliers for the numeric factor
outliers_Erfolg_Strategie_2D <- boxplot(Erfolg_Strategie_2D$Erfolg_Strategie, plot = FALSE)$out

# Replace the values with NA
Erfolg_Strategie_2D[Erfolg_Strategie_2D$Erfolg_Strategie %in% outliers_Erfolg_Strategie_2D, "Erfolg_Strategie"] = NA

Erfolg_Strategie_AR <- subset(myData[myData$Task_2DvAR == 2, ], )

# create a vector of outliers for the numeric factor
outliers_Erfolg_Strategie_AR <- boxplot(Erfolg_Strategie_AR$Erfolg_Strategie, plot = FALSE)$out

# Replace the values with NA
Erfolg_Strategie_AR[Erfolg_Strategie_AR$Erfolg_Strategie %in% outliers_Erfolg_Strategie_AR, "Erfolg_Strategie"] = NA

myData_Erfolg_Strategie_noOutliers <- rbind(Erfolg_Strategie_2D, Erfolg_Strategie_AR)

Spass_2D <- subset(myData[myData$Task_2DvAR == 1, ], )

# create a vector of outliers for the numeric factor
outliers_Spass_2D <- boxplot(Spass_2D$Spass, plot = FALSE)$out

# Replace the values with NA
Spass_2D[Spass_2D$Spass %in% outliers_Spass_2D, "Spass"] = NA

Spass_AR <- subset(myData[myData$Task_2DvAR == 2, ], )

# create a vector of outliers for the numeric factor
outliers_Spass_AR <- boxplot(Spass_AR$Spass, plot = FALSE)$out

# Replace the values with NA
Spass_AR[Spass_AR$Spass %in% outliers_Spass_AR, "Spass"] = NA

myData_Spass_noOutliers <- rbind(Spass_2D, Spass_AR)

Checking normal distribution

#Perform the Shapiro-Wilk Test for Normality on each group
myData_Kontrolle_noOutliers %>%
  group_by(Task_2DvAR, RvS) %>%
  summarise(`W Statistic` = shapiro.test(Kontrolle)$statistic,
            `p-value` = shapiro.test(Kontrolle)$p.value)
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 4
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS   `W Statistic` `p-value`
##   <fct>      <fct>         <dbl>     <dbl>
## 1 1          1             0.911    0.0654
## 2 1          2             0.917    0.0507
## 3 2          1             0.958    0.369 
## 4 2          2             0.915    0.0807
myData_Konzentration_noOutliers %>%
  group_by(Task_2DvAR, RvS) %>%
  summarise(`W Statistic` = shapiro.test(Konzentration)$statistic,
            `p-value` = shapiro.test(Konzentration)$p.value)
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 4
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS   `W Statistic` `p-value`
##   <fct>      <fct>         <dbl>     <dbl>
## 1 1          1             0.964    0.620 
## 2 1          2             0.938    0.145 
## 3 2          1             0.901    0.0194
## 4 2          2             0.933    0.176
myData_Erfolg_Strategie_noOutliers %>%
  group_by(Task_2DvAR, RvS) %>%
  summarise(`W Statistic` = shapiro.test(Erfolg_Strategie)$statistic,
            `p-value` = shapiro.test(Erfolg_Strategie)$p.value)
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 4
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS   `W Statistic` `p-value`
##   <fct>      <fct>         <dbl>     <dbl>
## 1 1          1             0.887    0.0240
## 2 1          2             0.941    0.170 
## 3 2          1             0.919    0.0478
## 4 2          2             0.896    0.0341
myData_Spass_noOutliers %>%
  group_by(Task_2DvAR, RvS) %>%
  summarise(`W Statistic` = shapiro.test(Spass)$statistic,
            `p-value` = shapiro.test(Spass)$p.value)
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 4
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS   `W Statistic` `p-value`
##   <fct>      <fct>         <dbl>     <dbl>
## 1 1          1             0.900 0.0574   
## 2 1          2             0.876 0.00821  
## 3 2          1             0.762 0.0000570
## 4 2          2             0.847 0.00472
#Perform QQ plots by group
ggplot(data = myData_Kontrolle_noOutliers, mapping = aes(sample = Kontrolle, color = Task_2DvAR, fill = Task_2DvAR)) +
  #stat_qq_band(alpha=0.5, conf=0.95, qtype=1, bandType = "ts") +
  stat_qq_line(identity=TRUE) +
  stat_qq_point(col="black") +
  facet_wrap(~ Task_2DvAR, scales = "free") +
  labs(x = "Theoretical Quantiles", y = "Sample Quantiles") + theme_bw() 

ggplot(data = myData_Konzentration_noOutliers, mapping = aes(sample = Konzentration, color = Task_2DvAR, fill = Task_2DvAR)) +
  #stat_qq_band(alpha=0.5, conf=0.95, qtype=1, bandType = "ts") +
  stat_qq_line(identity=TRUE) +
  stat_qq_point(col="black") +
  facet_wrap(~ Task_2DvAR, scales = "free") +
  labs(x = "Theoretical Quantiles", y = "Sample Quantiles") + theme_bw() 

ggplot(data = myData_Erfolg_Strategie_noOutliers, mapping = aes(sample = Erfolg_Strategie, color = Task_2DvAR, fill = Task_2DvAR)) +
  #stat_qq_band(alpha=0.5, conf=0.95, qtype=1, bandType = "ts") +
  stat_qq_line(identity=TRUE) +
  stat_qq_point(col="black") +
  facet_wrap(~ Task_2DvAR, scales = "free") +
  labs(x = "Theoretical Quantiles", y = "Sample Quantiles") + theme_bw() 

ggplot(data = myData_Spass_noOutliers, mapping = aes(sample = Spass, color = Task_2DvAR, fill = Task_2DvAR)) +
  #stat_qq_band(alpha=0.5, conf=0.95, qtype=1, bandType = "ts") +
  stat_qq_line(identity=TRUE) +
  stat_qq_point(col="black") +
  facet_wrap(~ Task_2DvAR, scales = "free") +
  labs(x = "Theoretical Quantiles", y = "Sample Quantiles") + theme_bw() 

To compare groups (2D vs AR) and conditions (real vs sham) we are calculating 2x2 ANOVAs

ANOVA_Kontrolle <- aov(Kontrolle ~ Task_2DvAR *RvS, data = myData_Kontrolle_noOutliers)
summary(ANOVA_Kontrolle)
##                Df Sum Sq Mean Sq F value Pr(>F)   
## Task_2DvAR      1   56.0   56.02  10.171  0.002 **
## RvS             1    2.7    2.72   0.494  0.484   
## Task_2DvAR:RvS  1    0.3    0.33   0.060  0.807   
## Residuals      85  468.2    5.51                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
leveneTest(ANOVA_Kontrolle)
## Levene's Test for Homogeneity of Variance (center = median)
##       Df F value Pr(>F)
## group  3  1.1013 0.3532
##       85
effectsize::eta_squared(ANOVA_Kontrolle, partial = TRUE)
## # Effect Size for ANOVA (Type I)
## 
## Parameter      | Eta2 (partial) |       95% CI
## ----------------------------------------------
## Task_2DvAR     |           0.11 | [0.03, 1.00]
## RvS            |       5.77e-03 | [0.00, 1.00]
## Task_2DvAR:RvS |       7.05e-04 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
ANOVA_Konzentration <- aov(Konzentration ~ Task_2DvAR *RvS, data = myData_Konzentration_noOutliers)
summary(ANOVA_Konzentration)
##                Df Sum Sq Mean Sq F value Pr(>F)
## Task_2DvAR      1   13.7  13.651   2.390  0.126
## RvS             1    5.8   5.833   1.021  0.315
## Task_2DvAR:RvS  1    0.1   0.069   0.012  0.913
## Residuals      85  485.5   5.712
leveneTest(ANOVA_Konzentration)
## Levene's Test for Homogeneity of Variance (center = median)
##       Df F value Pr(>F)
## group  3  1.6032 0.1947
##       85
ANOVA_Erfolg_Strategie <- aov(Erfolg_Strategie ~ Task_2DvAR *RvS, data = myData_Erfolg_Strategie_noOutliers)
summary(ANOVA_Erfolg_Strategie)
##                Df Sum Sq Mean Sq F value  Pr(>F)   
## Task_2DvAR      1   57.6   57.64   8.259 0.00512 **
## RvS             1    0.7    0.66   0.094 0.75945   
## Task_2DvAR:RvS  1    5.5    5.54   0.794 0.37539   
## Residuals      85  593.2    6.98                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
leveneTest(ANOVA_Erfolg_Strategie)
## Levene's Test for Homogeneity of Variance (center = median)
##       Df F value Pr(>F)
## group  3  1.4438 0.2358
##       85
effectsize::eta_squared(ANOVA_Erfolg_Strategie, partial = TRUE)
## # Effect Size for ANOVA (Type I)
## 
## Parameter      | Eta2 (partial) |       95% CI
## ----------------------------------------------
## Task_2DvAR     |           0.09 | [0.02, 1.00]
## RvS            |       1.11e-03 | [0.00, 1.00]
## Task_2DvAR:RvS |       9.26e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
ANOVA_Spass <- aov(Spass ~ Task_2DvAR *RvS, data = myData_Spass_noOutliers)
summary(ANOVA_Spass)
##                Df Sum Sq Mean Sq F value Pr(>F)
## Task_2DvAR      1    0.9   0.905   0.133  0.716
## RvS             1    0.0   0.048   0.007  0.933
## Task_2DvAR:RvS  1    2.4   2.423   0.356  0.552
## Residuals      82  557.9   6.804               
## 3 Beobachtungen als fehlend gelöscht
leveneTest(ANOVA_Spass)
## Levene's Test for Homogeneity of Variance (center = median)
##       Df F value Pr(>F)
## group  3  0.3708 0.7743
##       82

Descriptive statistic per group

# Control

myData_Kontrolle_noOutliers %>% select(Kontrolle, Task_2DvAR, RvS) %>% group_by(Task_2DvAR, RvS) %>% 
  summarise(n = n(), 
            mean = mean(Kontrolle, na.rm = TRUE), 
            sd = sd(Kontrolle, na.rm = TRUE),
            stderr = sd/sqrt(n), 
            LCL = mean - qt(1 - (0.05 / 2), n - 1) * stderr,
            UCL = mean + qt(1 - (0.05 / 2), n - 1) * stderr,
            median=median(Kontrolle, na.rm = TRUE),
            min=min(Kontrolle, na.rm = TRUE), 
            max=max(Kontrolle, na.rm = TRUE),
            IQR=IQR(Kontrolle, na.rm = TRUE))
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 12
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS       n  mean    sd stderr   LCL   UCL median   min   max   IQR
##   <fct>      <fct> <int> <dbl> <dbl>  <dbl> <dbl> <dbl>  <dbl> <dbl> <dbl> <dbl>
## 1 1          1        20  3.85  2.28  0.509  2.78  4.92      4     0     7  4.25
## 2 1          2        24  3.38  1.79  0.365  2.62  4.13      3     1     7  2.25
## 3 2          1        25  5.28  2.70  0.540  4.17  6.39      6     0    10  3   
## 4 2          2        20  5.05  2.52  0.564  3.87  6.23      5     1     9  4.25
# Concentration

myData_Konzentration_noOutliers %>% select(Konzentration, Task_2DvAR, RvS) %>% group_by(Task_2DvAR, RvS) %>% 
  summarise(n = n(), 
            mean = mean(Konzentration, na.rm = TRUE), 
            sd = sd(Konzentration, na.rm = TRUE),
            stderr = sd/sqrt(n), 
            LCL = mean - qt(1 - (0.05 / 2), n - 1) * stderr,
            UCL = mean + qt(1 - (0.05 / 2), n - 1) * stderr,
            median=median(Konzentration, na.rm = TRUE),
            min=min(Konzentration, na.rm = TRUE), 
            max=max(Konzentration, na.rm = TRUE),
            IQR=IQR(Konzentration, na.rm = TRUE))
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 12
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS       n  mean    sd stderr   LCL   UCL median   min   max   IQR
##   <fct>      <fct> <int> <dbl> <dbl>  <dbl> <dbl> <dbl>  <dbl> <dbl> <dbl> <dbl>
## 1 1          1        20  5.5   2.65  0.592  4.26  6.74      6     0    10  3   
## 2 1          2        24  5.96  2.27  0.464  5.00  6.92      6     1     9  3.25
## 3 2          1        25  6.28  2.75  0.549  5.15  7.41      7     1    10  5   
## 4 2          2        20  6.85  1.66  0.372  6.07  7.63      7     4    10  2.25
# Perceived Success

myData_Erfolg_Strategie_noOutliers %>% select(Erfolg_Strategie, Task_2DvAR, RvS) %>% group_by(Task_2DvAR, RvS) %>% 
  summarise(n = n(), 
            mean = mean(Erfolg_Strategie, na.rm = TRUE), 
            sd = sd(Erfolg_Strategie, na.rm = TRUE),
            stderr = sd/sqrt(n), 
            LCL = mean - qt(1 - (0.05 / 2), n - 1) * stderr,
            UCL = mean + qt(1 - (0.05 / 2), n - 1) * stderr,
            median=median(Erfolg_Strategie, na.rm = TRUE),
            min=min(Erfolg_Strategie, na.rm = TRUE), 
            max=max(Erfolg_Strategie, na.rm = TRUE),
            IQR=IQR(Erfolg_Strategie, na.rm = TRUE))
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 12
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS       n  mean    sd stderr   LCL   UCL median   min   max   IQR
##   <fct>      <fct> <int> <dbl> <dbl>  <dbl> <dbl> <dbl>  <dbl> <dbl> <dbl> <dbl>
## 1 1          1        20  4.75  2.75  0.615  3.46  6.04      6     1     9  5   
## 2 1          2        24  4.42  2.41  0.492  3.40  5.44      5     0     9  3.25
## 3 2          1        25  5.88  3.15  0.631  4.58  7.18      7     0    10  5   
## 4 2          2        20  6.55  2.01  0.45   5.61  7.49      7     3     9  3
# Fun

myData_Spass_noOutliers %>% select(Spass, Task_2DvAR, RvS) %>% group_by(Task_2DvAR, RvS) %>% 
  summarise(n = n(), 
            mean = mean(Spass, na.rm = TRUE), 
            sd = sd(Spass, na.rm = TRUE),
            stderr = sd/sqrt(n), 
            LCL = mean - qt(1 - (0.05 / 2), n - 1) * stderr,
            UCL = mean + qt(1 - (0.05 / 2), n - 1) * stderr,
            median=median(Spass, na.rm = TRUE),
            min=min(Spass, na.rm = TRUE), 
            max=max(Spass, na.rm = TRUE),
            IQR=IQR(Spass, na.rm = TRUE))
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 12
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS       n  mean    sd stderr   LCL   UCL median   min   max   IQR
##   <fct>      <fct> <int> <dbl> <dbl>  <dbl> <dbl> <dbl>  <dbl> <dbl> <dbl> <dbl>
## 1 1          1        20  7.61  2.06  0.461  6.65  8.58    7       3    10  2.75
## 2 1          2        24  7.30  2.53  0.517  6.24  8.37    8       2    10  3   
## 3 2          1        25  7.48  3.15  0.630  6.18  8.78    9       1    10  4   
## 4 2          2        20  7.85  2.37  0.530  6.74  8.96    8.5     2    10  4

Pain / Discomfort

Checking for outliers using Box-Plots

plot_Pain <- ggplot(myData, aes(factor(Task_2DvAR), Pain, )) + geom_boxplot() +
  geom_boxplot(fill = "grey92") +
  geom_point(aes(colour = Task_2DvAR),
    ## draw bigger points
    size = 2,
    ## add some transparency
    alpha = .5, show.legend = FALSE,
    ## add some jittering
    position = position_jitter(
      ## control randomness and range of jitter
      seed = 1, width = .2
    )) +
  scale_fill_brewer(palette = "Dark2",
  ) +
  theme_classic() +
    scale_x_discrete(name = "Condition",
    labels = c("2D", "AR")) +
  scale_y_continuous(name = "Pain")+
  theme(axis.text.x = element_text(color = "grey20", size = 8, angle = 0, hjust = .5, vjust = .5, face = "plain"),
        axis.text.y = element_text(color = "grey20", size = 8, angle = 0, hjust = 1, vjust = 0, face = "plain"),  
        axis.title.x = element_text(color = "grey20", size = 10, angle = 0, hjust = .5, vjust = 0, face = "plain"),
        axis.title.y = element_text(color = "grey20", size = 10, angle = 90, hjust = .5, vjust = .5, face = "plain"))

plot_Pressure_on_head <- ggplot(myData, aes(factor(Task_2DvAR), Pressure_on_head, )) + geom_boxplot() +
  geom_boxplot(fill = "grey92") +
  geom_point(aes(colour = Task_2DvAR),
    ## draw bigger points
    size = 2,
    ## add some transparency
    alpha = .5, show.legend = FALSE,
    ## add some jittering
    position = position_jitter(
      ## control randomness and range of jitter
      seed = 1, width = .2
    )) +
  scale_fill_brewer(palette = "Dark2",
  ) +
  theme_classic() +
    scale_x_discrete(name = "Condition",
    labels = c("2D", "AR")) +
  scale_y_continuous(name = "Pressure on Head")+
  theme(axis.text.x = element_text(color = "grey20", size = 8, angle = 0, hjust = .5, vjust = .5, face = "plain"),
        axis.text.y = element_text(color = "grey20", size = 8, angle = 0, hjust = 1, vjust = 0, face = "plain"),  
        axis.title.x = element_text(color = "grey20", size = 10, angle = 0, hjust = .5, vjust = 0, face = "plain"),
        axis.title.y = element_text(color = "grey20", size = 10, angle = 90, hjust = .5, vjust = .5, face = "plain"))

plot_Headache <- ggplot(myData, aes(factor(Task_2DvAR), Headache, )) + geom_boxplot() +
  geom_boxplot(fill = "grey92") +
  geom_point(aes(colour = Task_2DvAR),
    ## draw bigger points
    size = 2,
    ## add some transparency
    alpha = .5, show.legend = FALSE,
    ## add some jittering
    position = position_jitter(
      ## control randomness and range of jitter
      seed = 1, width = .2
    )) +
  scale_fill_brewer(palette = "Dark2",
  ) +
  theme_classic() +
    scale_x_discrete(name = "Condition",
    labels = c("2D", "AR")) +
  scale_y_continuous(name = "Headache")+
  theme(axis.text.x = element_text(color = "grey20", size = 8, angle = 0, hjust = .5, vjust = .5, face = "plain"),
        axis.text.y = element_text(color = "grey20", size = 8, angle = 0, hjust = 1, vjust = 0, face = "plain"),  
        axis.title.x = element_text(color = "grey20", size = 10, angle = 0, hjust = .5, vjust = 0, face = "plain"),
        axis.title.y = element_text(color = "grey20", size = 10, angle = 90, hjust = .5, vjust = .5, face = "plain"))

plot_Eye_burning <- ggplot(myData, aes(factor(Task_2DvAR), Eye_burning, )) + geom_boxplot() +
  geom_boxplot(fill = "grey92") +
  geom_point(aes(colour = Task_2DvAR),
    ## draw bigger points
    size = 2,
    ## add some transparency
    alpha = .5, show.legend = FALSE,
    ## add some jittering
    position = position_jitter(
      ## control randomness and range of jitter
      seed = 1, width = .2
    )) +
  scale_fill_brewer(palette = "Dark2",
  ) +
  theme_classic() +
    scale_x_discrete(name = "Condition",
    labels = c("2D", "AR")) +
  scale_y_continuous(name = "Eye Burning")+
  theme(axis.text.x = element_text(color = "grey20", size = 8, angle = 0, hjust = .5, vjust = .5, face = "plain"),
        axis.text.y = element_text(color = "grey20", size = 8, angle = 0, hjust = 1, vjust = 0, face = "plain"),  
        axis.title.x = element_text(color = "grey20", size = 10, angle = 0, hjust = .5, vjust = 0, face = "plain"),
        axis.title.y = element_text(color = "grey20", size = 10, angle = 90, hjust = .5, vjust = .5, face = "plain"))

ggarrange(plot_Pain, plot_Pressure_on_head, plot_Headache, plot_Eye_burning, 
        #  labels = c("Pain", "Pressure on Head", "Headache", "Eye Burning"),
          ncol = 2, nrow = 2)

Removing outliers when Interquartile Range IQR > 1.5

Pain_2D <- subset(myData[myData$Task_2DvAR == 1, ], )

# create a vector of outliers for the numeric factor
outliers_Pain_2D <- boxplot(Pain_2D$Pain, plot = FALSE)$out

# Replace the values with NA
Pain_2D[Pain_2D$Pain %in% outliers_Pain_2D, "Pain"] = NA

Pain_AR <- subset(myData[myData$Task_2DvAR == 2, ], )

# create a vector of outliers for the numeric factor
outliers_Pain_AR <- boxplot(Pain_AR$Pain, plot = FALSE)$out

# Replace the values with NA
Pain_AR[Pain_AR$Pain %in% outliers_Pain_AR, "Pain"] = NA

myData_Pain_noOutliers <- rbind(Pain_2D, Pain_AR)

Pressure_on_head_2D <- subset(myData[myData$Task_2DvAR == 1, ], )

# create a vector of outliers for the numeric factor
outliers_Pressure_on_head_2D <- boxplot(Pressure_on_head_2D$Pressure_on_head, plot = FALSE)$out

# Replace the values with NA
Pressure_on_head_2D[Pressure_on_head_2D$Pressure_on_head %in% outliers_Pressure_on_head_2D, "Pressure_on_head"] = NA

Pressure_on_head_AR <- subset(myData[myData$Task_2DvAR == 2, ], )

# create a vector of outliers for the numeric factor
outliers_Pressure_on_head_AR <- boxplot(Pressure_on_head_AR$Pressure_on_head, plot = FALSE)$out

# Replace the values with NA
Pressure_on_head_AR[Pressure_on_head_AR$Pressure_on_head %in% outliers_Pressure_on_head_AR, "Pressure_on_head"] = NA

myData_Pressure_on_head_noOutliers <- rbind(Pressure_on_head_2D, Pressure_on_head_AR)

Headache_2D <- subset(myData[myData$Task_2DvAR == 1, ], )

# create a vector of outliers for the numeric factor
outliers_Headache_2D <- boxplot(Headache_2D$Headache, plot = FALSE)$out

# Replace the values with NA
Headache_2D[Headache_2D$Headache %in% outliers_Headache_2D, "Headache"] = NA

Headache_AR <- subset(myData[myData$Task_2DvAR == 2, ], )

# create a vector of outliers for the numeric factor
outliers_Headache_AR <- boxplot(Headache_AR$Headache, plot = FALSE)$out

# Replace the values with NA
Headache_AR[Headache_AR$Headache %in% outliers_Headache_AR, "Headache"] = NA

myData_Headache_noOutliers <- rbind(Headache_2D, Headache_AR)

Eye_burning_2D <- subset(myData[myData$Task_2DvAR == 1, ], )

# create a vector of outliers for the numeric factor
outliers_Eye_burning_2D <- boxplot(Eye_burning_2D$Eye_burning, plot = FALSE)$out

# Replace the values with NA
Eye_burning_2D[Eye_burning_2D$Eye_burning %in% outliers_Eye_burning_2D, "Eye_burning"] = NA

Eye_burning_AR <- subset(myData[myData$Task_2DvAR == 2, ], )

# create a vector of outliers for the numeric factor
outliers_Eye_burning_AR <- boxplot(Eye_burning_AR$Eye_burning, plot = FALSE)$out

# Replace the values with NA
Eye_burning_AR[Eye_burning_AR$Eye_burning %in% outliers_Eye_burning_AR, "Eye_burning"] = NA

myData_Eye_burning_noOutliers <- rbind(Eye_burning_2D, Eye_burning_AR)

Checking normal distribution

#Perform the Shapiro-Wilk Test for Normality on each group
myData_Pain_noOutliers %>%
  group_by(Task_2DvAR, RvS) %>%
  summarise(`W Statistic` = shapiro.test(Pain)$statistic,
            `p-value` = shapiro.test(Pain)$p.value)
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 4
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS   `W Statistic` `p-value`
##   <fct>      <fct>         <dbl>     <dbl>
## 1 1          1             0.765 0.000502 
## 2 1          2             0.838 0.00212  
## 3 2          1             0.793 0.000511 
## 4 2          2             0.650 0.0000149
myData_Pressure_on_head_noOutliers %>%
  group_by(Task_2DvAR, RvS) %>%
  summarise(`W Statistic` = shapiro.test(Pressure_on_head)$statistic,
            `p-value` = shapiro.test(Pressure_on_head)$p.value)
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 4
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS   `W Statistic` `p-value`
##   <fct>      <fct>         <dbl>     <dbl>
## 1 1          1             0.890   0.0390 
## 2 1          2             0.959   0.415  
## 3 2          1             0.891   0.0163 
## 4 2          2             0.818   0.00272
myData_Headache_noOutliers %>%
  group_by(Task_2DvAR, RvS) %>%
  summarise(`W Statistic` = shapiro.test(Headache)$statistic,
            `p-value` = shapiro.test(Headache)$p.value)
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 4
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS   `W Statistic`  `p-value`
##   <fct>      <fct>         <dbl>      <dbl>
## 1 1          1             0.849 0.00653   
## 2 1          2             0.755 0.000108  
## 3 2          1             0.533 0.00000156
## 4 2          2             0.591 0.00000362
myData_Eye_burning_noOutliers %>%
  group_by(Task_2DvAR, RvS) %>%
  summarise(`W Statistic` = shapiro.test(Eye_burning)$statistic,
            `p-value` = shapiro.test(Eye_burning)$p.value)
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 4
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS   `W Statistic`  `p-value`
##   <fct>      <fct>         <dbl>      <dbl>
## 1 1          1             0.746 0.000400  
## 2 1          2             0.742 0.0000524 
## 3 2          1             0.677 0.00000707
## 4 2          2             0.625 0.0000283
#Perform QQ plots by group
ggplot(data = myData_Pain_noOutliers, mapping = aes(sample = Pain, color = Task_2DvAR, fill = Task_2DvAR)) +
  #stat_qq_band(alpha=0.5, conf=0.95, qtype=1, bandType = "ts") +
  stat_qq_line(identity=TRUE) +
  stat_qq_point(col="black") +
  facet_wrap(~ Task_2DvAR, scales = "free") +
  labs(x = "Theoretical Quantiles", y = "Sample Quantiles") + theme_bw() 

ggplot(data = myData_Pressure_on_head_noOutliers, mapping = aes(sample = Pressure_on_head, color = Task_2DvAR, fill = Task_2DvAR)) +
  #stat_qq_band(alpha=0.5, conf=0.95, qtype=1, bandType = "ts") +
  stat_qq_line(identity=TRUE) +
  stat_qq_point(col="black") +
  facet_wrap(~ Task_2DvAR, scales = "free") +
  labs(x = "Theoretical Quantiles", y = "Sample Quantiles") + theme_bw() 

ggplot(data = myData_Headache_noOutliers, mapping = aes(sample = Headache, color = Task_2DvAR, fill = Task_2DvAR)) +
  #stat_qq_band(alpha=0.5, conf=0.95, qtype=1, bandType = "ts") +
  stat_qq_line(identity=TRUE) +
  stat_qq_point(col="black") +
  facet_wrap(~ Task_2DvAR, scales = "free") +
  labs(x = "Theoretical Quantiles", y = "Sample Quantiles") + theme_bw() 

ggplot(data = myData_Eye_burning_noOutliers, mapping = aes(sample = Eye_burning, color = Task_2DvAR, fill = Task_2DvAR)) +
  #stat_qq_band(alpha=0.5, conf=0.95, qtype=1, bandType = "ts") +
  stat_qq_line(identity=TRUE) +
  stat_qq_point(col="black") +
  facet_wrap(~ Task_2DvAR, scales = "free") +
  labs(x = "Theoretical Quantiles", y = "Sample Quantiles") + theme_bw() 

To compare groups (2D vs AR) and conditions (real vs sham) we are calculating 2x2 ANOVAs

ANOVA_Pain <- aov(Pain ~ Task_2DvAR *RvS, data = myData_Pain_noOutliers)
summary(ANOVA_Pain)
##                Df Sum Sq Mean Sq F value Pr(>F)
## Task_2DvAR      1   18.0  18.050   2.153  0.146
## RvS             1    0.1   0.141   0.017  0.897
## Task_2DvAR:RvS  1   19.7  19.663   2.345  0.130
## Residuals      76  637.1   8.383               
## 9 Beobachtungen als fehlend gelöscht
leveneTest(ANOVA_Pain)
## Levene's Test for Homogeneity of Variance (center = median)
##       Df F value Pr(>F)
## group  3  1.9452 0.1294
##       76
ANOVA_Pressure_on_head <- aov(Pressure_on_head ~ Task_2DvAR *RvS, data = myData_Pressure_on_head_noOutliers)
summary(ANOVA_Pressure_on_head)
##                Df Sum Sq Mean Sq F value Pr(>F)
## Task_2DvAR      1    530   530.3   2.274  0.136
## RvS             1     11    11.0   0.047  0.828
## Task_2DvAR:RvS  1     26    25.6   0.110  0.741
## Residuals      79  18425   233.2               
## 6 Beobachtungen als fehlend gelöscht
leveneTest(ANOVA_Pressure_on_head)
## Levene's Test for Homogeneity of Variance (center = median)
##       Df F value Pr(>F)
## group  3  0.6285 0.5988
##       79
ANOVA_Headache <- aov(Headache ~ Task_2DvAR *RvS, data = myData_Headache_noOutliers)
summary(ANOVA_Headache)
##                Df Sum Sq Mean Sq F value Pr(>F)  
## Task_2DvAR      1   74.8   74.80   4.827 0.0312 *
## RvS             1    5.4    5.42   0.350 0.5562  
## Task_2DvAR:RvS  1   16.0   15.96   1.030 0.3135  
## Residuals      74 1146.8   15.50                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 11 Beobachtungen als fehlend gelöscht
leveneTest(ANOVA_Headache)
## Levene's Test for Homogeneity of Variance (center = median)
##       Df F value Pr(>F)
## group  3  1.7318 0.1678
##       74
effectsize::eta_squared(ANOVA_Headache, partial = TRUE)
## # Effect Size for ANOVA (Type I)
## 
## Parameter      | Eta2 (partial) |       95% CI
## ----------------------------------------------
## Task_2DvAR     |           0.06 | [0.00, 1.00]
## RvS            |       4.70e-03 | [0.00, 1.00]
## Task_2DvAR:RvS |           0.01 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
ANOVA_Eye_burning <- aov(Eye_burning ~ Task_2DvAR *RvS, data = myData_Eye_burning_noOutliers)
summary(ANOVA_Eye_burning)
##                Df Sum Sq Mean Sq F value Pr(>F)
## Task_2DvAR      1    205  204.65   2.683  0.106
## RvS             1     17   16.79   0.220  0.640
## Task_2DvAR:RvS  1     64   63.88   0.838  0.363
## Residuals      75   5720   76.27               
## 10 Beobachtungen als fehlend gelöscht
leveneTest(ANOVA_Eye_burning)
## Levene's Test for Homogeneity of Variance (center = median)
##       Df F value Pr(>F)
## group  3    1.48 0.2268
##       75

Descriptive statistic per group

# Pain

myData_Pain_noOutliers %>% select(Pain, Task_2DvAR, RvS) %>% group_by(Task_2DvAR, RvS) %>% 
  summarise(n = n(), 
            mean = mean(Pain, na.rm = TRUE), 
            sd = sd(Pain, na.rm = TRUE),
            stderr = sd/sqrt(n), 
            LCL = mean - qt(1 - (0.05 / 2), n - 1) * stderr,
            UCL = mean + qt(1 - (0.05 / 2), n - 1) * stderr,
            median=median(Pain, na.rm = TRUE),
            min=min(Pain, na.rm = TRUE), 
            max=max(Pain, na.rm = TRUE),
            IQR=IQR(Pain, na.rm = TRUE))
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 12
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS       n  mean    sd stderr   LCL   UCL median   min   max   IQR
##   <fct>      <fct> <int> <dbl> <dbl>  <dbl> <dbl> <dbl>  <dbl> <int> <int> <dbl>
## 1 1          1        20  2.22  3.00  0.671 0.818  3.63      1     0    10   3.5
## 2 1          2        24  3.14  3.40  0.694 1.70   4.57      2     0    10   5  
## 3 2          1        25  2.29  2.94  0.587 1.07   3.50      1     0    10   5  
## 4 2          2        20  1.21  1.96  0.438 0.293  2.13      1     0     8   1.5
# Pressure on Head

myData_Pressure_on_head_noOutliers %>% select(Pressure_on_head, Task_2DvAR, RvS) %>% group_by(Task_2DvAR, RvS) %>% 
  summarise(n = n(), 
            mean = mean(Pressure_on_head, na.rm = TRUE), 
            sd = sd(Pressure_on_head, na.rm = TRUE),
            stderr = sd/sqrt(n), 
            LCL = mean - qt(1 - (0.05 / 2), n - 1) * stderr,
            UCL = mean + qt(1 - (0.05 / 2), n - 1) * stderr,
            median=median(Pressure_on_head, na.rm = TRUE),
            min=min(Pressure_on_head, na.rm = TRUE), 
            max=max(Pressure_on_head, na.rm = TRUE),
            IQR=IQR(Pressure_on_head, na.rm = TRUE))
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 12
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS       n  mean    sd stderr   LCL   UCL median   min   max   IQR
##   <fct>      <fct> <int> <dbl> <dbl>  <dbl> <dbl> <dbl>  <dbl> <int> <int> <dbl>
## 1 1          1        20  20.5  17.5   3.92 12.3   28.7   19.5     0    50  25.5
## 2 1          2        24  20.9  13.2   2.69 15.3   26.4   18       0    55  19.2
## 3 2          1        25  16.5  15.4   3.08 10.1   22.8   13       0    57  15.5
## 4 2          2        20  14.6  15.3   3.42  7.45  21.8   10       0    50  16.5
# Headache

myData_Headache_noOutliers %>% select(Headache, Task_2DvAR, RvS) %>% group_by(Task_2DvAR, RvS) %>% 
  summarise(n = n(), 
            mean = mean(Headache, na.rm = TRUE), 
            sd = sd(Headache, na.rm = TRUE),
            stderr = sd/sqrt(n), 
            LCL = mean - qt(1 - (0.05 / 2), n - 1) * stderr,
            UCL = mean + qt(1 - (0.05 / 2), n - 1) * stderr,
            median=median(Headache, na.rm = TRUE),
            min=min(Headache, na.rm = TRUE), 
            max=max(Headache, na.rm = TRUE),
            IQR=IQR(Headache, na.rm = TRUE))
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 12
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS       n  mean    sd stderr    LCL   UCL median   min   max
##   <fct>      <fct> <int> <dbl> <dbl>  <dbl>  <dbl> <dbl>  <dbl> <int> <int>
## 1 1          1        20 3.79   3.72  0.832 2.05    5.53    2       0    10
## 2 1          2        24 3.45   4.65  0.949 1.49    5.42    1.5     0    15
## 3 2          1        25 0.889  1.97  0.393 0.0769  1.70    0       0     7
## 4 2          2        20 2.37   4.59  1.03  0.223   4.51    0       0    16
## # ℹ 1 more variable: IQR <dbl>
# Eye Burning

myData_Eye_burning_noOutliers %>% select(Eye_burning, Task_2DvAR, RvS) %>% group_by(Task_2DvAR, RvS) %>% 
  summarise(n = n(), 
            mean = mean(Eye_burning, na.rm = TRUE), 
            sd = sd(Eye_burning, na.rm = TRUE),
            stderr = sd/sqrt(n), 
            LCL = mean - qt(1 - (0.05 / 2), n - 1) * stderr,
            UCL = mean + qt(1 - (0.05 / 2), n - 1) * stderr,
            median=median(Eye_burning, na.rm = TRUE),
            min=min(Eye_burning, na.rm = TRUE), 
            max=max(Eye_burning, na.rm = TRUE),
            IQR=IQR(Eye_burning, na.rm = TRUE))
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 12
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS       n  mean    sd stderr   LCL   UCL median   min   max   IQR
##   <fct>      <fct> <int> <dbl> <dbl>  <dbl> <dbl> <dbl>  <dbl> <int> <int> <dbl>
## 1 1          1        20  5.88  8.20   1.83 2.04   9.72      2     0    30  10  
## 2 1          2        24  8.61 11.3    2.31 3.82  13.4       3     0    30  14  
## 3 2          1        25  4.61  7.37   1.47 1.57   7.65      1     0    25   5  
## 4 2          2        20  3.69  6.44   1.44 0.675  6.70      1     0    25   3.5

Correlations between questionnaires and NF performance (individual regression slopes)

#SSQ - Nausea

myData_SSQ_diff_N_noOutliers %>%
  group_by(Task_2DvAR, RvS) %>%
  summarize(test=cor.test(SSQ_diff_N,slope, use = "complete.obs")$p.value)
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 3
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS     test
##   <fct>      <fct>  <dbl>
## 1 1          1     0.0711
## 2 1          2     0.346 
## 3 2          1     0.134 
## 4 2          2     0.645
myData_SSQ_diff_N_noOutliers %>%
  group_by(Task_2DvAR, RvS) %>%
  summarize(test=cor(SSQ_diff_N,slope, use = "complete.obs"))
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 3
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS     test
##   <fct>      <fct>  <dbl>
## 1 1          1     -0.423
## 2 1          2     -0.206
## 3 2          1     -0.308
## 4 2          2     -0.113
#Flow - Fluency and concern

myData_Flow_Glatter_Verlauf_noOutliers %>%
  group_by(Task_2DvAR, RvS) %>%
  summarize(test=cor.test(Flow_Glatter_Verlauf,slope, use = "complete.obs")$p.value)
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 3
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS    test
##   <fct>      <fct> <dbl>
## 1 1          1     0.208
## 2 1          2     0.652
## 3 2          1     0.894
## 4 2          2     0.364
myData_Flow_Glatter_Verlauf_noOutliers %>%
  group_by(Task_2DvAR, RvS) %>%
  summarize(test=cor(Flow_Glatter_Verlauf,slope, use = "complete.obs"))
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 3
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS      test
##   <fct>      <fct>   <dbl>
## 1 1          1     -0.294 
## 2 1          2     -0.0972
## 3 2          1      0.0280
## 4 2          2      0.214
myData_Flow_Besorgnis_noOutliers %>%
  group_by(Task_2DvAR) %>%
  summarize(test=cor.test(Flow_Besorgnis,slope, use = "complete.obs")$p.value)
## # A tibble: 2 × 2
##   Task_2DvAR  test
##   <fct>      <dbl>
## 1 1          0.901
## 2 2          0.771
myData_Flow_Besorgnis_noOutliers %>%
  group_by(Task_2DvAR) %>%
  summarize(test=cor(Flow_Besorgnis,slope, use = "complete.obs"))
## # A tibble: 2 × 2
##   Task_2DvAR    test
##   <fct>        <dbl>
## 1 1           0.0193
## 2 2          -0.0463
myData_Flow_Total_noOutliers %>%
  group_by(Task_2DvAR) %>%
  summarize(test=cor.test(Flow_Besorgnis,slope, use = "complete.obs")$p.value)
## # A tibble: 2 × 2
##   Task_2DvAR  test
##   <fct>      <dbl>
## 1 1          0.901
## 2 2          0.966
myData_Flow_Total_noOutliers %>%
  group_by(Task_2DvAR) %>%
  summarize(test=cor(Flow_Besorgnis,slope, use = "complete.obs"))
## # A tibble: 2 × 2
##   Task_2DvAR    test
##   <fct>        <dbl>
## 1 1          0.0193 
## 2 2          0.00654
#TUI - Technology anxiety, usability and accessibility

myData_TUI_Technologieaengstlichkeit_noOutliers %>%
  group_by(Task_2DvAR) %>%
  summarize(test=cor.test(TUI_Technologieaengstlichkeit,slope, use = "complete.obs")$p.value)
## # A tibble: 2 × 2
##   Task_2DvAR  test
##   <fct>      <dbl>
## 1 1          0.245
## 2 2          0.825
myData_TUI_Technologieaengstlichkeit_noOutliers %>%
  group_by(Task_2DvAR) %>%
  summarize(test=cor(TUI_Technologieaengstlichkeit,slope, use = "complete.obs"))
## # A tibble: 2 × 2
##   Task_2DvAR    test
##   <fct>        <dbl>
## 1 1          -0.179 
## 2 2           0.0344
myData_TUI_Benutzerfreundlichkeit_noOutliers %>%
  group_by(Task_2DvAR) %>%
  summarize(test=cor.test(TUI_Benutzerfreundlichkeit,slope, use = "complete.obs")$p.value)
## # A tibble: 2 × 2
##   Task_2DvAR  test
##   <fct>      <dbl>
## 1 1          0.398
## 2 2          0.616
myData_TUI_Benutzerfreundlichkeit_noOutliers %>%
  group_by(Task_2DvAR) %>%
  summarize(test=cor(TUI_Benutzerfreundlichkeit,slope, use = "complete.obs"))
## # A tibble: 2 × 2
##   Task_2DvAR    test
##   <fct>        <dbl>
## 1 1          -0.131 
## 2 2          -0.0786
myData_TUI_Zugaenglichkeit_noOutliers %>%
  group_by(Task_2DvAR, RvS) %>%
  summarize(test=cor.test(TUI_Zugaenglichkeit,slope, use = "complete.obs")$p.value)
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 3
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS      test
##   <fct>      <fct>   <dbl>
## 1 1          1     0.469  
## 2 1          2     0.512  
## 3 2          1     0.00318
## 4 2          2     0.237
myData_TUI_Zugaenglichkeit_noOutliers %>%
  group_by(Task_2DvAR, RvS) %>%
  summarize(test=cor(TUI_Zugaenglichkeit,slope, use = "complete.obs"))
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 3
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS     test
##   <fct>      <fct>  <dbl>
## 1 1          1      0.172
## 2 1          2      0.141
## 3 2          1      0.577
## 4 2          2     -0.285
#Other questionnaires - Control

myData_Kontrolle_noOutliers %>%
  group_by(Task_2DvAR) %>%
  summarize(test=cor.test(Kontrolle,slope, use = "complete.obs")$p.value)
## # A tibble: 2 × 2
##   Task_2DvAR  test
##   <fct>      <dbl>
## 1 1          0.765
## 2 2          0.243
myData_Kontrolle_noOutliers %>%
  group_by(Task_2DvAR) %>%
  summarize(test=cor(Kontrolle,slope, use = "complete.obs"))
## # A tibble: 2 × 2
##   Task_2DvAR    test
##   <fct>        <dbl>
## 1 1          -0.0464
## 2 2           0.178
myData_Erfolg_Strategie_noOutliers %>%
  group_by(Task_2DvAR) %>%
  summarize(test=cor.test(Erfolg_Strategie,slope, use = "complete.obs")$p.value)
## # A tibble: 2 × 2
##   Task_2DvAR  test
##   <fct>      <dbl>
## 1 1          0.173
## 2 2          0.556
myData_Erfolg_Strategie_noOutliers %>%
  group_by(Task_2DvAR, RvS) %>%
  summarize(test=cor(Erfolg_Strategie,slope, use = "complete.obs"))
## `summarise()` has grouped output by 'Task_2DvAR'. You can override using the
## `.groups` argument.
## # A tibble: 4 × 3
## # Groups:   Task_2DvAR [2]
##   Task_2DvAR RvS      test
##   <fct>      <fct>   <dbl>
## 1 1          1     -0.303 
## 2 1          2     -0.133 
## 3 2          1     -0.0888
## 4 2          2      0.383
#Physical condition

myData_Headache_noOutliers %>%
  group_by(Task_2DvAR) %>%
  summarize(test=cor.test(Headache,slope, use = "complete.obs")$p.value)
## # A tibble: 2 × 2
##   Task_2DvAR  test
##   <fct>      <dbl>
## 1 1          0.563
## 2 2          0.627
myData_Headache_noOutliers %>%
  group_by(Task_2DvAR) %>%
  summarize(test=cor(Headache,slope, use = "complete.obs"))
## # A tibble: 2 × 2
##   Task_2DvAR    test
##   <fct>        <dbl>
## 1 1          -0.0931
## 2 2           0.0826