This file documents the statistical analysis of Test 2’s data.

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

Reading data

data <- read_csv(file="test2_form_responses.csv")
## Parsed with column specification:
## cols(
##   DispositivoPreferido = col_character(),
##   FaixaEtária = col_character(),
##   GêneroJogo = col_character(),
##   Item = col_character(),
##   Escore = col_double(),
##   Versão = col_character(),
##   Sexo = col_character(),
##   TempoJogosSemana = col_character(),
##   Timestamp = col_character(),
##   JaConhecia = col_character(),
##   Questionário = col_character(),
##   TipoVariavel = col_character()
## )

Separating data into groups

v2 <- filter(data, Versão =="v2")
v2GEQ <- filter(v2, Questionário =="GEQ")
v2PANAS <- filter(v2, Questionário =="PANAS")

v3 <- filter(data, Versão =="v3")
v3GEQ <- filter(v3, Questionário =="GEQ")
v3PANAS <- filter(v3, Questionário =="PANAS")

Descriptive Statistics

Running descriptive statistics to see if our variables are normally distributed. GEQ responses for v2:

by(data = v2GEQ$Escore, v2GEQ$TipoVariavel, stat.desc, basic=FALSE, norm=TRUE)
## v2GEQ$TipoVariavel: Negative Affect
##       median         mean      SE.mean CI.mean.0.95          var 
## 1.000000e+00 8.750000e-01 1.140731e-01 2.267326e-01 1.145115e+00 
##      std.dev     coef.var     skewness     skew.2SE     kurtosis 
## 1.070100e+00 1.222972e+00 1.191935e+00 2.320656e+00 7.428868e-01 
##     kurt.2SE   normtest.W   normtest.p 
## 7.307137e-01 7.798780e-01 3.773710e-10 
## -------------------------------------------------------- 
## v2GEQ$TipoVariavel: Negative Experience
##       median         mean      SE.mean CI.mean.0.95          var 
## 0.000000e+00 3.560606e-01 6.464603e-02 1.278853e-01 5.516424e-01 
##      std.dev     coef.var     skewness     skew.2SE     kurtosis 
## 7.427263e-01 2.085955e+00 1.994142e+00 4.729249e+00 2.932582e+00 
##     kurt.2SE   normtest.W   normtest.p 
## 3.502273e+00 5.376336e-01 1.291763e-18 
## -------------------------------------------------------- 
## v2GEQ$TipoVariavel: Positive Affect
##        median          mean       SE.mean  CI.mean.0.95           var 
##  3.000000e+00  2.972727e+00  8.316016e-02  1.648207e-01  7.607173e-01 
##       std.dev      coef.var      skewness      skew.2SE      kurtosis 
##  8.721911e-01  2.933976e-01 -6.880078e-01 -1.492763e+00  2.856621e-01 
##      kurt.2SE    normtest.W    normtest.p 
##  3.125259e-01  8.474605e-01  2.823092e-09 
## -------------------------------------------------------- 
## v2GEQ$TipoVariavel: Positive Experience
##        median          mean       SE.mean  CI.mean.0.95           var 
##  2.000000e+00  2.325758e+00  1.115036e-01  2.205808e-01  1.641164e+00 
##       std.dev      coef.var      skewness      skew.2SE      kurtosis 
##  1.281079e+00  5.508223e-01 -3.591366e-01 -8.517181e-01 -8.947041e-01 
##      kurt.2SE    normtest.W    normtest.p 
## -1.068512e+00  8.952641e-01  3.630455e-08

PANAS responses for v2:

by(data = v2PANAS$Escore, v2PANAS$TipoVariavel, stat.desc, basic=FALSE, norm=TRUE)
## v2PANAS$TipoVariavel: Negative Affect
##        median          mean       SE.mean  CI.mean.0.95           var 
##  1.500000e+00  2.109091e+00  9.285180e-02  1.829975e-01  1.896721e+00 
##       std.dev      coef.var      skewness      skew.2SE      kurtosis 
##  1.377215e+00  6.529898e-01  9.531725e-01  2.905422e+00 -4.461388e-01 
##      kurt.2SE    normtest.W    normtest.p 
## -6.829371e-01  7.688785e-01  2.707804e-17 
## -------------------------------------------------------- 
## v2PANAS$TipoVariavel: Positive Affect
##        median          mean       SE.mean  CI.mean.0.95           var 
##  4.000000e+00  3.518182e+00  8.750583e-02  1.724613e-01  1.684599e+00 
##       std.dev      coef.var      skewness      skew.2SE      kurtosis 
##  1.297921e+00  3.689182e-01 -5.449293e-01 -1.661032e+00 -7.686862e-01 
##      kurt.2SE    normtest.W    normtest.p 
## -1.176684e+00  8.731031e-01  1.363180e-12

GEQ responses for v3:

by(data = v3GEQ$Escore, v3GEQ$TipoVariavel, stat.desc, basic=FALSE, norm=TRUE)
## v3GEQ$TipoVariavel: Negative Affect
##        median          mean       SE.mean  CI.mean.0.95           var 
##  1.000000e+00  1.260870e+00  1.301159e-01  2.584592e-01  1.557573e+00 
##       std.dev      coef.var      skewness      skew.2SE      kurtosis 
##  1.248028e+00  9.898150e-01  7.126018e-01  1.417592e+00 -5.056884e-01 
##      kurt.2SE    normtest.W    normtest.p 
## -5.080144e-01  8.494196e-01  3.112699e-08 
## -------------------------------------------------------- 
## v3GEQ$TipoVariavel: Negative Experience
##       median         mean      SE.mean CI.mean.0.95          var 
## 0.000000e+00 7.681159e-01 9.216065e-02 1.822413e-01 1.172115e+00 
##      std.dev     coef.var     skewness     skew.2SE     kurtosis 
## 1.082642e+00 1.409478e+00 1.424333e+00 3.452172e+00 1.236200e+00 
##     kurt.2SE   normtest.W   normtest.p 
## 1.508367e+00 7.250400e-01 9.204785e-15 
## -------------------------------------------------------- 
## v3GEQ$TipoVariavel: Positive Affect
##        median          mean       SE.mean  CI.mean.0.95           var 
##  2.000000e+00  2.478261e+00  1.035950e-01  2.052210e-01  1.234172e+00 
##       std.dev      coef.var      skewness      skew.2SE      kurtosis 
##  1.110933e+00  4.482713e-01 -3.262925e-01 -7.234513e-01 -5.662223e-01 
##      kurt.2SE    normtest.W    normtest.p 
## -6.328160e-01  9.002671e-01  3.267285e-07 
## -------------------------------------------------------- 
## v3GEQ$TipoVariavel: Positive Experience
##        median          mean       SE.mean  CI.mean.0.95           var 
##  2.000000e+00  1.768116e+00  1.040235e-01  2.056993e-01  1.493283e+00 
##       std.dev      coef.var      skewness      skew.2SE      kurtosis 
##  1.221999e+00  6.911308e-01  1.351633e-01  3.275969e-01 -9.034224e-01 
##      kurt.2SE    normtest.W    normtest.p 
## -1.102323e+00  9.092794e-01  1.244909e-07

PANAS responses for v3:

by(data = v3PANAS$Escore, v3PANAS$TipoVariavel, stat.desc, basic=FALSE, norm=TRUE)
## v3PANAS$TipoVariavel: Negative Affect
##        median          mean       SE.mean  CI.mean.0.95           var 
##  2.000000e+00  2.191304e+00  8.556124e-02  1.685879e-01  1.683767e+00 
##       std.dev      coef.var      skewness      skew.2SE      kurtosis 
##  1.297600e+00  5.921589e-01  7.663399e-01  2.387732e+00 -5.488078e-01 
##      kurt.2SE    normtest.W    normtest.p 
## -8.585735e-01  8.185273e-01  1.134185e-15 
## -------------------------------------------------------- 
## v3PANAS$TipoVariavel: Positive Affect
##        median          mean       SE.mean  CI.mean.0.95           var 
##  3.000000e+00  3.043478e+00  8.533711e-02  1.681463e-01  1.674957e+00 
##       std.dev      coef.var      skewness      skew.2SE      kurtosis 
##  1.294201e+00  4.252376e-01 -8.032669e-02 -2.502787e-01 -1.061848e+00 
##      kurt.2SE    normtest.W    normtest.p 
## -1.661191e+00  9.072609e-01  9.435681e-11

We can see that the distributions are not normal, but we will perform Shapiro-Wilk separately.

Normality tests

GEQ responses for v2:

by(data = v2GEQ$Escore, v2GEQ$TipoVariavel, shapiro.test)
## v2GEQ$TipoVariavel: Negative Affect
## 
##  Shapiro-Wilk normality test
## 
## data:  dd[x, ]
## W = 0.77988, p-value = 3.774e-10
## 
## -------------------------------------------------------- 
## v2GEQ$TipoVariavel: Negative Experience
## 
##  Shapiro-Wilk normality test
## 
## data:  dd[x, ]
## W = 0.53763, p-value < 2.2e-16
## 
## -------------------------------------------------------- 
## v2GEQ$TipoVariavel: Positive Affect
## 
##  Shapiro-Wilk normality test
## 
## data:  dd[x, ]
## W = 0.84746, p-value = 2.823e-09
## 
## -------------------------------------------------------- 
## v2GEQ$TipoVariavel: Positive Experience
## 
##  Shapiro-Wilk normality test
## 
## data:  dd[x, ]
## W = 0.89526, p-value = 3.63e-08

PANAS responses for v2:

by(data = v2PANAS$Escore, v2PANAS$TipoVariavel, shapiro.test)
## v2PANAS$TipoVariavel: Negative Affect
## 
##  Shapiro-Wilk normality test
## 
## data:  dd[x, ]
## W = 0.76888, p-value < 2.2e-16
## 
## -------------------------------------------------------- 
## v2PANAS$TipoVariavel: Positive Affect
## 
##  Shapiro-Wilk normality test
## 
## data:  dd[x, ]
## W = 0.8731, p-value = 1.363e-12

GEQ responses for v3:

by(data = v3GEQ$Escore, v3GEQ$TipoVariavel, shapiro.test)
## v3GEQ$TipoVariavel: Negative Affect
## 
##  Shapiro-Wilk normality test
## 
## data:  dd[x, ]
## W = 0.84942, p-value = 3.113e-08
## 
## -------------------------------------------------------- 
## v3GEQ$TipoVariavel: Negative Experience
## 
##  Shapiro-Wilk normality test
## 
## data:  dd[x, ]
## W = 0.72504, p-value = 9.205e-15
## 
## -------------------------------------------------------- 
## v3GEQ$TipoVariavel: Positive Affect
## 
##  Shapiro-Wilk normality test
## 
## data:  dd[x, ]
## W = 0.90027, p-value = 3.267e-07
## 
## -------------------------------------------------------- 
## v3GEQ$TipoVariavel: Positive Experience
## 
##  Shapiro-Wilk normality test
## 
## data:  dd[x, ]
## W = 0.90928, p-value = 1.245e-07

PANAS responses for v3:

by(data = v3PANAS$Escore, v3PANAS$TipoVariavel, shapiro.test)
## v3PANAS$TipoVariavel: Negative Affect
## 
##  Shapiro-Wilk normality test
## 
## data:  dd[x, ]
## W = 0.81853, p-value = 1.134e-15
## 
## -------------------------------------------------------- 
## v3PANAS$TipoVariavel: Positive Affect
## 
##  Shapiro-Wilk normality test
## 
## data:  dd[x, ]
## W = 0.90726, p-value = 9.436e-11

Non-parametric test: Wilcoxon rank-sum test

We now know that we need to perform a non-parametric test. As we are comparing two independent conditions (the game versions were evaluated by different participants), we will perform the Wilcoxon rank-sum test.

First we separate each version into the specific scores we want to compare for each questionnaire type:

# v2 subgroups
v2GEQPA <- filter(v2GEQ, TipoVariavel == "Positive Affect")
v2GEQNA <- filter(v2GEQ, TipoVariavel == "Negative Affect")
v2GEQPE <- filter(v2GEQ, TipoVariavel == "Positive Experience")
v2GEQNE <- filter(v2GEQ, TipoVariavel == "Negative Experience")
v2PANASPA <- filter(v2PANAS, TipoVariavel == "Positive Affect")
v2PANASNA <- filter(v2PANAS, TipoVariavel == "Negative Affect")

# v3 subgroups
v3GEQPA <- filter(v3GEQ, TipoVariavel == "Positive Affect")
v3GEQNA <- filter(v3GEQ, TipoVariavel == "Negative Affect")
v3GEQPE <- filter(v3GEQ, TipoVariavel == "Positive Experience")
v3GEQNE <- filter(v3GEQ, TipoVariavel == "Negative Experience")
v3PANASPA <- filter(v3PANAS, TipoVariavel == "Positive Affect")
v3PANASNA <- filter(v3PANAS, TipoVariavel == "Negative Affect")

To calculate the effect size of our test statistic

rFromWilcox<-function(wilcoxModel, N){
 z <- qnorm(wilcoxModel$p.value/2)
 r <- z/ sqrt(N)
 cat(wilcoxModel$data.name, "Effect Size, r = ", r)
}

We will perform 6 tests.

GEQ

Positive Aspect

geqpaModel <- wilcox.test(v2GEQPA$Escore, v3GEQPA$Escore, paired = FALSE)
geqpaModel
## 
##  Wilcoxon rank sum test with continuity correction
## 
## data:  v2GEQPA$Escore and v3GEQPA$Escore
## W = 7947, p-value = 0.0005141
## alternative hypothesis: true location shift is not equal to 0
rFromWilcox(geqpaModel, 225)
## v2GEQPA$Escore and v3GEQPA$Escore Effect Size, r =  -0.2315539

Negative Aspect

geqnaModel <- wilcox.test(v2GEQNA$Escore, v3GEQNA$Escore, paired = FALSE)
geqnaModel
## 
##  Wilcoxon rank sum test with continuity correction
## 
## data:  v2GEQNA$Escore and v3GEQNA$Escore
## W = 3337.5, p-value = 0.03223
## alternative hypothesis: true location shift is not equal to 0
rFromWilcox(geqnaModel, 180)
## v2GEQNA$Escore and v3GEQNA$Escore Effect Size, r =  -0.1596229

Positive Experience

geqpeModel <- wilcox.test(v2GEQPE$Escore, v3GEQPE$Escore, paired = FALSE)
geqpeModel
## 
##  Wilcoxon rank sum test with continuity correction
## 
## data:  v2GEQPE$Escore and v3GEQPE$Escore
## W = 11393, p-value = 0.0002607
## alternative hypothesis: true location shift is not equal to 0
rFromWilcox(geqpeModel, 270)
## v2GEQPE$Escore and v3GEQPE$Escore Effect Size, r =  -0.2222221

Negative Experience

geqneModel <- wilcox.test(v2GEQNE$Escore, v3GEQNE$Escore, paired = FALSE)
geqneModel
## 
##  Wilcoxon rank sum test with continuity correction
## 
## data:  v2GEQNE$Escore and v3GEQNE$Escore
## W = 7084.5, p-value = 0.0001583
## alternative hypothesis: true location shift is not equal to 0
rFromWilcox(geqnaModel, 270)
## v2GEQNA$Escore and v3GEQNA$Escore Effect Size, r =  -0.1303316

PANAS

Positive Aspect

panaspaModel <- wilcox.test(v2PANASPA$Escore, v3PANASPA$Escore, paired = FALSE)
panaspaModel
## 
##  Wilcoxon rank sum test with continuity correction
## 
## data:  v2PANASPA$Escore and v3PANASPA$Escore
## W = 30616, p-value = 7.831e-05
## alternative hypothesis: true location shift is not equal to 0
rFromWilcox(panaspaModel, 450)
## v2PANASPA$Escore and v3PANASPA$Escore Effect Size, r =  -0.1861822

Negative Aspect

panasnaModel <- wilcox.test(v2PANASNA$Escore, v3PANASNA$Escore, paired = FALSE)
panasnaModel
## 
##  Wilcoxon rank sum test with continuity correction
## 
## data:  v2PANASNA$Escore and v3PANASNA$Escore
## W = 23905, p-value = 0.2825
## alternative hypothesis: true location shift is not equal to 0
rFromWilcox(panasnaModel, 450)
## v2PANASNA$Escore and v3PANASNA$Escore Effect Size, r =  -0.05066108

Plots

GEQ <- filter(data, Questionário =="GEQ")
PANAS <- filter(data, Questionário =="PANAS")
barg <- ggplot(GEQ, aes(TipoVariavel, Escore, fill = Versão))
barg + stat_summary(fun.y = mean, geom = "bar", position="dodge") + stat_summary(fun.data = mean_cl_normal, geom = "errorbar", position= position_dodge(width = 0.90), width = 0.2)+labs( x = "Responses' Aspects", y = "Mean Score", fill = "Version", title = "Responses for the GEQ Core and Post-Game modules (Test 2)")

barp <- ggplot(PANAS, aes(TipoVariavel, Escore, fill = Versão))
barp + stat_summary(fun.y = mean, geom = "bar", position="dodge", aes(width=0.5)) + stat_summary(fun.data = mean_cl_normal, geom = "errorbar", position= position_dodge(width = 0.5), width = 0.1)+labs( x = "Responses' Aspects", y = "Mean Score", fill = "Version", title = "Responses for the PANAS questionnaire (Test 2)")
## Warning: Ignoring unknown aesthetics: width