1 Outline

2 Central Results

2.1 Descriptive

  • removed 15 participants, because no data at t1 (= time point 2), which is a dropout of about 14%
  • the study design is a mixed design with 2 (within) x 3 (between) levels
## matching conditions (time X treatment)
table(dat_long$idcodegroup, dat_long$timepoint) / nrow(dat_long)
##           
##                    0         1
##   control  0.2666667 0.2666667
##   negative 0.1133333 0.1133333
##   positive 0.1200000 0.1200000
sum(dat_long$mean_valence_macro[dat_long$timepoint == 0] > 0) / sum(dat_long$timepoint == 0)
## [1] 0.4133333
sum(dat_long$mean_valence_macro[dat_long$timepoint == 0] < 0) / sum(dat_long$timepoint == 0)
## [1] 0.4933333
sum(dat_long$mean_valence_macro[dat_long$timepoint == 0] == 0) / sum(dat_long$timepoint == 0)
## [1] 0.09333333
  • just for illustration I include only 2 variables in the following analyses:

mean_valence

g <- dat_long$mean_valence_macro
h <- hist(g, breaks = 10, density = 10,
          col = "gray", xlab = "mean_valence_macro", main = "overlay normal curve") 
xfit <- seq(min(g), max(g), length = 40) 
yfit <- dnorm(xfit, mean = mean(g), sd = sd(g)) 
yfit <- yfit * diff(h$mids[1:2]) * length(g) 

lines(xfit, yfit, col = "black", lwd = 2)

fc_panas_neg which are computed factor scores of the negative emotion items of PANAS (using polychoric correlations to account for the non-normality of items, factor score computed using method Bartlett)

g <- dat_long$fc_panas_neg
h <- hist(g, breaks = 10, density = 10,
          col = "gray", xlab = "fc_panas_neg", main = "overlay normal curve") 
xfit <- seq(min(g), max(g), length = 40) 
yfit <- dnorm(xfit, mean = mean(g), sd = sd(g)) 
yfit <- yfit * diff(h$mids[1:2]) * length(g) 

lines(xfit, yfit, col = "black", lwd = 2)

dat_long$idcodegroup <- factor(dat_long$idcodegroup)
dat_long %>% 
  group_by(timepoint, idcodegroup) %>%
  dplyr::summarise(mean = mean(mean_valence_macro))
## `summarise()` has grouped output by 'timepoint'. You can override using the
## `.groups` argument.
## # A tibble: 6 × 3
## # Groups:   timepoint [2]
##   timepoint idcodegroup      mean
##       <dbl> <fct>           <dbl>
## 1         0 control     -0.114   
## 2         0 negative    -0.587   
## 3         0 positive     0.384   
## 4         1 control      0.0765  
## 5         1 negative     0.000967
## 6         1 positive    -0.174

2.2 multivariate multilevel models

motivation using these kind of models: when computing ANOVAs in the context of regression models (= multivariate multilevel models) we do not need to run any post-hoc test anymore and in theory can compute more complex interactions of even latent regressions, for example, by applying so called latent change score models

# mean difference between fixed occasions model for 3 groups:
mmm1 <- lme(mean_valence_macro ~ 1 + post*idcodegroup_positive +
              post*idcodegroup_negative,
            random = ~ 1 + post | prolific_pid,
            data = dat_long,
            control=list(sigma=1e-10, opt="optim"))

summary(mmm1)
## Linear mixed-effects model fit by REML
##   Data: dat_long 
##        AIC      BIC    logLik
##   797.0358 823.7641 -389.5179
## 
## Random effects:
##  Formula: ~1 + post | prolific_pid
##  Structure: General positive-definite, Log-Cholesky parametrization
##             StdDev       Corr  
## (Intercept) 0.5084585570 (Intr)
## post        0.5833364367 -0.288
## Residual    0.0000000001       
## 
## Fixed effects:  mean_valence_macro ~ 1 + post * idcodegroup_positive + post *      idcodegroup_negative 
##                                Value  Std.Error DF   t-value p-value
## (Intercept)               -0.1143336 0.08039436 72 -1.422160  0.1593
## post                       0.1908583 0.09223359 72  2.069292  0.0421
## idcodegroup_positive       0.4986140 0.14431229 72  3.455104  0.0009
## idcodegroup_negative      -0.4731240 0.14721041 72 -3.213930  0.0020
## post:idcodegroup_positive -0.7487482 0.16556436 72 -4.522400  0.0000
## post:idcodegroup_negative  0.3975660 0.16888928 72  2.354004  0.0213
##  Correlation: 
##                           (Intr) post   idcdgrp_p idcdgrp_n pst:dcdgrp_p
## post                      -0.288                                        
## idcodegroup_positive      -0.557  0.160                                 
## idcodegroup_negative      -0.546  0.157  0.304                          
## post:idcodegroup_positive  0.160 -0.557 -0.288    -0.088                
## post:idcodegroup_negative  0.157 -0.546 -0.088    -0.288     0.304      
## 
## Standardized Within-Group Residuals:
##           Min            Q1           Med            Q3           Max 
## -2.220446e-06 -5.551115e-07  0.000000e+00  5.551115e-07  5.551115e-06 
## 
## Number of Observations: 150
## Number of Groups: 75
report::report(mmm1)
## We fitted a linear mixed model (estimated using REML and optim optimizer) to
## predict mean_valence_macro with post, idcodegroup_positive and
## idcodegroup_negative (formula: mean_valence_macro ~ 1 + post *
## idcodegroup_positive + post * idcodegroup_negative). The model included post as
## random effects (formula: ~1 + post | prolific_pid). The model's total
## explanatory power is substantial (conditional R2 = 1.00) and the part related
## to the fixed effects alone (marginal R2) is of 0.16. The model's intercept,
## corresponding to post = 0, idcodegroup_positive = 0 and idcodegroup_negative =
## 0, is at -0.11 (95% CI [-0.27, 0.05], t(72) = -1.42, p = 0.159). Within this
## model:
## 
##   - The effect of post is statistically significant and positive (beta = 0.19,
## 95% CI [6.99e-03, 0.37], t(72) = 2.07, p = 0.042; Std. beta = 0.08, 95% CI
## [-0.03, 0.19])
##   - The effect of idcodegroup positive is statistically significant and positive
## (beta = 0.50, 95% CI [0.21, 0.79], t(72) = 3.46, p < .001; Std. beta = 0.08,
## 95% CI [-0.11, 0.28])
##   - The effect of idcodegroup negative is statistically significant and negative
## (beta = -0.47, 95% CI [-0.77, -0.18], t(72) = -3.21, p = 0.002; Std. beta =
## -0.18, 95% CI [-0.38, 0.01])
##   - The effect of post × idcodegroup positive is statistically significant and
## negative (beta = -0.75, 95% CI [-1.08, -0.42], t(72) = -4.52, p < .001; Std.
## beta = -0.26, 95% CI [-0.37, -0.14])
##   - The effect of post × idcodegroup negative is statistically significant and
## positive (beta = 0.40, 95% CI [0.06, 0.73], t(72) = 2.35, p = 0.021; Std. beta
## = 0.13, 95% CI [0.02, 0.25])
## 
## Standardized parameters were obtained by fitting the model on a standardized
## version of the dataset. 95% Confidence Intervals (CIs) and p-values were
## computed using a Wald t-distribution approximation.
# add Level-2 predictor fc_panas_neg
mmm2 <- lme(mean_valence_macro ~ 1 + post*idcodegroup_positive +
              post*idcodegroup_negative + post*fc_panas_neg,
            random = ~ 1 + post | prolific_pid,
            data = dat_long,
            control=list(sigma=1e-10, opt="optim"))

summary(mmm2)
## Linear mixed-effects model fit by REML
##   Data: dat_long 
##        AIC      BIC    logLik
##   969.4774 1001.992 -473.7387
## 
## Random effects:
##  Formula: ~1 + post | prolific_pid
##  Structure: General positive-definite, Log-Cholesky parametrization
##             StdDev       Corr  
## (Intercept) 0.4900806581 (Intr)
## post        0.5803607832 -0.386
## Residual    0.0000000001       
## 
## Fixed effects:  mean_valence_macro ~ 1 + post * idcodegroup_positive + post *      idcodegroup_negative + post * fc_panas_neg 
##                                Value  Std.Error DF   t-value p-value
## (Intercept)               -0.1202575 0.07753866 72 -1.550936  0.1253
## post                       0.1508458 0.09251567 70  1.630489  0.1075
## idcodegroup_positive       0.5151158 0.13931273 72  3.697550  0.0004
## idcodegroup_negative      -0.4418965 0.14264824 72 -3.097806  0.0028
## fc_panas_neg              -0.1235793 0.05814346 70 -2.125420  0.0371
## post:idcodegroup_positive -0.7579656 0.16488576 70 -4.596914  0.0000
## post:idcodegroup_negative  0.5164264 0.17235806 70  2.996242  0.0038
## post:fc_panas_neg         -0.1220973 0.07320180 70 -1.667954  0.0998
##  Correlation: 
##                           (Intr) post   idcdgrp_p idcdgrp_n fc_pn_ pst:dcdgrp_p
## post                      -0.382                                               
## idcodegroup_positive      -0.558  0.212                                        
## idcodegroup_negative      -0.547  0.207  0.308                                 
## fc_panas_neg               0.036  0.011 -0.056    -0.103                       
## post:idcodegroup_positive  0.216 -0.553 -0.387    -0.121     0.043             
## post:idcodegroup_negative  0.206 -0.556 -0.115    -0.375     0.013  0.299      
## post:fc_panas_neg         -0.019  0.103  0.029     0.053    -0.515 -0.032      
##                           pst:dcdgrp_n
## post                                  
## idcodegroup_positive                  
## idcodegroup_negative                  
## fc_panas_neg                          
## post:idcodegroup_positive             
## post:idcodegroup_negative             
## post:fc_panas_neg         -0.197      
## 
## Standardized Within-Group Residuals:
##           Min            Q1           Med            Q3           Max 
## -3.885781e-06 -5.551115e-07  0.000000e+00  1.110223e-06  6.661338e-06 
## 
## Number of Observations: 150
## Number of Groups: 75
report::report(mmm2)
## We fitted a linear mixed model (estimated using REML and optim optimizer) to
## predict mean_valence_macro with post, idcodegroup_positive,
## idcodegroup_negative and fc_panas_neg (formula: mean_valence_macro ~ 1 + post *
## idcodegroup_positive + post * idcodegroup_negative + post * fc_panas_neg). The
## model included post as random effects (formula: ~1 + post | prolific_pid). The
## model's total explanatory power is substantial (conditional R2 = 1.00) and the
## part related to the fixed effects alone (marginal R2) is of 0.25. The model's
## intercept, corresponding to post = 0, idcodegroup_positive = 0,
## idcodegroup_negative = 0 and fc_panas_neg = 0, is at -0.12 (95% CI [-0.27,
## 0.03], t(72) = -1.55, p = 0.125). Within this model:
## 
##   - The effect of post is statistically non-significant and positive (beta =
## 0.15, 95% CI [-0.03, 0.34], t(70) = 1.63, p = 0.107; Std. beta = 0.07, 95% CI
## [-0.04, 0.18])
##   - The effect of idcodegroup positive is statistically significant and positive
## (beta = 0.52, 95% CI [0.24, 0.79], t(72) = 3.70, p < .001; Std. beta = 0.09,
## 95% CI [-0.09, 0.27])
##   - The effect of idcodegroup negative is statistically significant and negative
## (beta = -0.44, 95% CI [-0.73, -0.16], t(72) = -3.10, p = 0.003; Std. beta =
## -0.12, 95% CI [-0.30, 0.06])
##   - The effect of fc panas neg is statistically significant and negative (beta =
## -0.12, 95% CI [-0.24, -7.62e-03], t(70) = -2.13, p = 0.037; Std. beta = -0.29,
## 95% CI [-0.44, -0.13])
##   - The effect of post × idcodegroup positive is statistically significant and
## negative (beta = -0.76, 95% CI [-1.09, -0.43], t(70) = -4.60, p < .001; Std.
## beta = -0.26, 95% CI [-0.37, -0.15])
##   - The effect of post × idcodegroup negative is statistically significant and
## positive (beta = 0.52, 95% CI [0.17, 0.86], t(70) = 3.00, p = 0.004; Std. beta
## = 0.17, 95% CI [0.06, 0.29])
##   - The effect of post × fc panas neg is statistically non-significant and
## negative (beta = -0.12, 95% CI [-0.27, 0.02], t(70) = -1.67, p = 0.100; Std.
## beta = -0.10, 95% CI [-0.21, 0.02])
## 
## Standardized parameters were obtained by fitting the model on a standardized
## version of the dataset. 95% Confidence Intervals (CIs) and p-values were
## computed using a Wald t-distribution approximation.

visualize results for participants who had drawn a negative CAM and a positive prototype was presented

# create a plot
p <- ggwithinstats(
  data = filter(dat_long, idcodegroup == "negative"),
  x    = timepoint,
  y    = mean_valence_macro,
  type = "p"
)
# looking at the plot
p

for participants who had drawn a positive CAM and a negative prototype was presented

# create a plot
p <- ggwithinstats(
  data = filter(dat_long, idcodegroup == "positive"),
  x    = timepoint,
  y    = mean_valence_macro,
  type = "p"
)
# looking at the plot
p

for participants where no prototype was presented

# create a plot
p <- ggwithinstats(
  data = filter(dat_long, idcodegroup == "control"),
  x    = timepoint,
  y    = mean_valence_macro,
  type = "p"
)
# looking at the plot
p

2.2.1 for different dependend variables

cor.plot(r = cor(dat_long[, str_subset(string = colnames(dat_long), pattern = "tam_bi")]))

dat_long$mean_tam_bi <- rowMeans(x = dat_long[, str_subset(string = colnames(dat_long), pattern = "tam_bi")])

# mean difference between fixed occasions model for 3 groups:
mmm1_ddv <- lme(mean_tam_bi ~ 1 + post*idcodegroup_positive +
              post*idcodegroup_negative,
            random = ~ 1 + post | prolific_pid,
            data = dat_long,
            control=list(sigma=1e-10, opt="optim"))

summary(mmm1_ddv)
## Linear mixed-effects model fit by REML
##   Data: dat_long 
##        AIC      BIC    logLik
##   1063.606 1090.335 -522.8032
## 
## Random effects:
##  Formula: ~1 + post | prolific_pid
##  Structure: General positive-definite, Log-Cholesky parametrization
##             StdDev       Corr  
## (Intercept) 1.6583539355 (Intr)
## post        1.1787732798 -0.38 
## Residual    0.0000000001       
## 
## Fixed effects:  mean_tam_bi ~ 1 + post * idcodegroup_positive + post * idcodegroup_negative 
##                               Value Std.Error DF   t-value p-value
## (Intercept)                3.925000 0.2622088 72 14.968988  0.0000
## post                       0.035000 0.1863804 72  0.187788  0.8516
## idcodegroup_positive       0.463889 0.4706792 72  0.985573  0.3276
## idcodegroup_negative      -0.795588 0.4801315 72 -1.657022  0.1019
## post:idcodegroup_positive -0.112778 0.3345631 72 -0.337090  0.7370
## post:idcodegroup_negative  0.412059 0.3412819 72  1.207386  0.2312
##  Correlation: 
##                           (Intr) post   idcdgrp_p idcdgrp_n pst:dcdgrp_p
## post                      -0.380                                        
## idcodegroup_positive      -0.557  0.211                                 
## idcodegroup_negative      -0.546  0.207  0.304                          
## post:idcodegroup_positive  0.211 -0.557 -0.380    -0.115                
## post:idcodegroup_negative  0.207 -0.546 -0.115    -0.380     0.304      
## 
## Standardized Within-Group Residuals:
##           Min            Q1           Med            Q3           Max 
## -1.776357e-05 -8.881784e-06  0.000000e+00  1.665335e-06  1.776357e-05 
## 
## Number of Observations: 150
## Number of Groups: 75
report::report(mmm1_ddv)
## We fitted a linear mixed model (estimated using REML and optim optimizer) to
## predict mean_tam_bi with post, idcodegroup_positive and idcodegroup_negative
## (formula: mean_tam_bi ~ 1 + post * idcodegroup_positive + post *
## idcodegroup_negative). The model included post as random effects (formula: ~1 +
## post | prolific_pid). The model's total explanatory power is substantial
## (conditional R2 = 1.00) and the part related to the fixed effects alone
## (marginal R2) is of 0.05. The model's intercept, corresponding to post = 0,
## idcodegroup_positive = 0 and idcodegroup_negative = 0, is at 3.93 (95% CI
## [3.40, 4.45], t(72) = 14.97, p < .001). Within this model:
## 
##   - The effect of post is statistically non-significant and positive (beta =
## 0.03, 95% CI [-0.34, 0.41], t(72) = 0.19, p = 0.852; Std. beta = 0.03, 95% CI
## [-0.05, 0.11])
##   - The effect of idcodegroup positive is statistically non-significant and
## positive (beta = 0.46, 95% CI [-0.47, 1.40], t(72) = 0.99, p = 0.328; Std. beta
## = 0.11, 95% CI [-0.12, 0.33])
##   - The effect of idcodegroup negative is statistically non-significant and
## negative (beta = -0.80, 95% CI [-1.75, 0.16], t(72) = -1.66, p = 0.102; Std.
## beta = -0.15, 95% CI [-0.37, 0.08])
##   - The effect of post × idcodegroup positive is statistically non-significant
## and negative (beta = -0.11, 95% CI [-0.78, 0.55], t(72) = -0.34, p = 0.737;
## Std. beta = -0.01, 95% CI [-0.10, 0.07])
##   - The effect of post × idcodegroup negative is statistically non-significant
## and positive (beta = 0.41, 95% CI [-0.27, 1.09], t(72) = 1.21, p = 0.231; Std.
## beta = 0.05, 95% CI [-0.03, 0.14])
## 
## Standardized parameters were obtained by fitting the model on a standardized
## version of the dataset. 95% Confidence Intervals (CIs) and p-values were
## computed using a Wald t-distribution approximation.

2.3 mixed ANOVA

we get identical results to multivariate multilevel models, but also estimates for generalized and partial eta squared (effect sizes), which are nice to report if anyone in the future wants to do a meta-analysis on our results (recommendation of Daniel Lakens)

mixed ANOVA

fit1 <- afex::aov_car(mean_valence_macro ~ timepoint*idcodegroup + Error(prolific_pid / timepoint),
                      data = dat_long)
## Contrasts set to contr.sum for the following variables: idcodegroup
fit1a <- afex::aov_ez(id = "prolific_pid", dv = "mean_valence_macro",
                      data = dat_long, between=c("idcodegroup"), within=c("timepoint"))
## Contrasts set to contr.sum for the following variables: idcodegroup
# partical eta squared
anova(fit1, es = "pes")
## Anova Table (Type 3 tests)
## 
## Response: mean_valence_macro
##                       num Df den Df     MSE       F     pes    Pr(>F)    
## idcodegroup                2     72 0.51638  2.8637 0.07369   0.06358 .  
## timepoint                  1     72 0.17014  1.0335 0.01415   0.31275    
## idcodegroup:timepoint      2     72 0.17014 17.8915 0.33199 4.922e-07 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# generalized eta squared
fit1a # > identical results
## Anova Table (Type 3 tests)
## 
## Response: mean_valence_macro
##                  Effect    df  MSE         F  ges p.value
## 1           idcodegroup 2, 72 0.52    2.86 + .056    .064
## 2             timepoint 1, 72 0.17      1.03 .004    .313
## 3 idcodegroup:timepoint 2, 72 0.17 17.89 *** .110   <.001
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1

visualize results

dfvalcor <- data_summary(dat_long, varname="mean_valence_macro",
                         groupnames=c("timepoint","idcodegroup"))
## Lade nötiges Paket: plyr
## Warning: Paket 'plyr' wurde unter R Version 4.3.2 erstellt
## ------------------------------------------------------------------------------
## You have loaded plyr after dplyr - this is likely to cause problems.
## If you need functions from both plyr and dplyr, please load plyr first, then dplyr:
## library(plyr); library(dplyr)
## ------------------------------------------------------------------------------
## 
## Attache Paket: 'plyr'
## Die folgenden Objekte sind maskiert von 'package:rstatix':
## 
##     desc, mutate
## Die folgenden Objekte sind maskiert von 'package:dplyr':
## 
##     arrange, count, desc, failwith, id, mutate, rename, summarise,
##     summarize
## Das folgende Objekt ist maskiert 'package:purrr':
## 
##     compact
dfvalcor$idcodegroup <- ifelse(test = dfvalcor$idcodegroup == "control", yes = "reflect on own CAM", 
                               no = ifelse(test = dfvalcor$idcodegroup == "negative", yes = "reflect on positive CAM", no = "reflect on negative CAM"))
dfvalcor$timepoint <- ifelse(test = dfvalcor$timepoint == 0, yes = "t1", no = "t2")

p <- ggplot(dfvalcor, aes(x=timepoint, y=mean_valence_macro, fill=idcodegroup)) +
  geom_bar(stat="identity", color="black",
           position=position_dodge()) +
  geom_errorbar(aes(ymin=mean_valence_macro-se, ymax=mean_valence_macro+se), width=.2,
                position=position_dodge(.9)) + ggplot_theme + ylab(label = "mean valence CAMs") + scale_fill_manual(values=c("red", "blue", "green")) +  theme(legend.title=element_blank(), legend.text=element_text(size=rel(1.0)), legend.position="top") + ylim(c(-.75,.75))
print(p)

run post hoc tests

# Effect of group at each time point
one.way <- dat_long %>%
  group_by(timepoint) %>%
  anova_test(dv = mean_valence_macro, wid = prolific_pid, between = idcodegroup) %>%
  get_anova_table() %>%
  adjust_pvalue(method = "bonferroni")
one.way
## # A tibble: 2 × 9
##   timepoint Effect        DFn   DFd      F          p `p<.05`   ges      p.adj
##       <dbl> <chr>       <dbl> <dbl>  <dbl>      <dbl> <chr>   <dbl>      <dbl>
## 1         0 idcodegroup     2    72 16.0   0.00000179 "*"     0.308 0.00000358
## 2         1 idcodegroup     2    72  0.907 0.408      ""      0.025 0.816
# Pairwise comparisons between group levels
pwc <- dat_long %>%
  group_by(timepoint) %>%
  pairwise_t_test(mean_valence_macro ~ idcodegroup, p.adjust.method = "bonferroni")
pwc
## # A tibble: 6 × 10
##   timepoint .y.               group1 group2    n1    n2       p p.signif   p.adj
## *     <dbl> <chr>             <chr>  <chr>  <int> <int>   <dbl> <chr>      <dbl>
## 1         0 mean_valence_mac… contr… negat…    40    17 1.96e-3 **       5.88e-3
## 2         0 mean_valence_mac… contr… posit…    40    18 9.26e-4 ***      2.78e-3
## 3         0 mean_valence_mac… negat… posit…    17    18 3   e-7 ****     8.99e-7
## 4         1 mean_valence_mac… contr… negat…    40    17 6.91e-1 ns       1   e+0
## 5         1 mean_valence_mac… contr… posit…    40    18 1.82e-1 ns       5.46e-1
## 6         1 mean_valence_mac… negat… posit…    17    18 4.33e-1 ns       1   e+0
## # ℹ 1 more variable: p.adj.signif <chr>

2.4 mixed ANOVA - tam_bi

mixed ANOVA

fit1 <- afex::aov_car(mean_tam_bi ~ timepoint*idcodegroup + Error(prolific_pid / timepoint),
                      data = dat_long)
## Contrasts set to contr.sum for the following variables: idcodegroup
fit1a <- afex::aov_ez(id = "prolific_pid", dv = "mean_tam_bi",
                      data = dat_long, between=c("idcodegroup"), within=c("timepoint"))
## Contrasts set to contr.sum for the following variables: idcodegroup
# partical eta squared
anova(fit1, es = "pes")
## Anova Table (Type 3 tests)
## 
## Response: mean_tam_bi
##                       num Df den Df    MSE      F      pes Pr(>F)
## idcodegroup                2     72 4.7113 1.8682 0.049334 0.1618
## timepoint                  1     72 0.6948 0.8439 0.011586 0.3613
## idcodegroup:timepoint      2     72 0.6948 1.0023 0.027087 0.3721
# generalized eta squared
fit1a # > identical results
## Anova Table (Type 3 tests)
## 
## Response: mean_tam_bi
##                  Effect    df  MSE    F  ges p.value
## 1           idcodegroup 2, 72 4.71 1.87 .043    .162
## 2             timepoint 1, 72 0.69 0.84 .002    .361
## 3 idcodegroup:timepoint 2, 72 0.69 1.00 .004    .372
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1

visualize results

dfvalcor <- data_summary(dat_long, varname="mean_tam_bi",
                         groupnames=c("timepoint","idcodegroup"))
p <- ggplot(dfvalcor, aes(x=timepoint, y=mean_tam_bi, fill=idcodegroup)) +
  geom_bar(stat="identity", color="black",
           position=position_dodge()) +
  geom_errorbar(aes(ymin=mean_tam_bi-se, ymax=mean_tam_bi+se), width=.2,
                position=position_dodge(.9)) + ggplot_theme + ylab(label = "average bi TAM")
print(p)

run post hoc tests

# Effect of group at each time point
one.way <- dat_long %>%
  group_by(timepoint) %>%
  anova_test(dv = mean_tam_bi, wid = prolific_pid, between = idcodegroup) %>%
  get_anova_table() %>%
  adjust_pvalue(method = "bonferroni")
one.way
## # A tibble: 2 × 9
##   timepoint Effect        DFn   DFd     F     p `p<.05`   ges p.adj
##       <dbl> <chr>       <dbl> <dbl> <dbl> <dbl> <chr>   <dbl> <dbl>
## 1         0 idcodegroup     2    72 2.60  0.082 ""      0.067 0.164
## 2         1 idcodegroup     2    72 0.888 0.416 ""      0.024 0.832
# Pairwise comparisons between group levels
pwc <- dat_long %>%
  group_by(timepoint) %>%
  pairwise_t_test(mean_tam_bi ~ idcodegroup, p.adjust.method = "bonferroni")
pwc
## # A tibble: 6 × 10
##   timepoint .y.    group1 group2    n1    n2      p p.signif  p.adj p.adj.signif
## *     <dbl> <chr>  <chr>  <chr>  <int> <int>  <dbl> <chr>     <dbl> <chr>       
## 1         0 mean_… contr… negat…    40    17 0.102  ns       0.306  ns          
## 2         0 mean_… contr… posit…    40    18 0.328  ns       0.983  ns          
## 3         0 mean_… negat… posit…    17    18 0.0278 *        0.0834 ns          
## 4         1 mean_… contr… negat…    40    17 0.419  ns       1      ns          
## 5         1 mean_… contr… posit…    40    18 0.45   ns       1      ns          
## 6         1 mean_… negat… posit…    17    18 0.187  ns       0.56   ns

2.4.1 mixed

tmp <- dat_long[dat_long$timepoint == 0,]
cor(tmp$mean_tam_bi, tmp$mean_valence_macro)
## [1] 0.4685966
tmp <- dat_long[dat_long$timepoint == 1,]
cor(tmp$mean_tam_bi, tmp$mean_valence_macro)
## [1] 0.3662753
dat_long %>% 
  group_by(timepoint, idcodegroup) %>%
  dplyr::summarise(mean = mean(mean_tam_bi))
## `summarise()` has grouped output by 'timepoint'. You can override using the
## `.groups` argument.
## # A tibble: 6 × 3
## # Groups:   timepoint [2]
##   timepoint idcodegroup  mean
##       <dbl> <fct>       <dbl>
## 1         0 control      3.92
## 2         0 negative     3.13
## 3         0 positive     4.39
## 4         1 control      3.96
## 5         1 negative     3.58
## 6         1 positive     4.31

2.5 mixed ANOVA - number of concepts

mixed ANOVA

fit1 <- afex::aov_car(num_nodes_macro ~ timepoint*idcodegroup + Error(prolific_pid / timepoint),
                      data = dat_long)
## Contrasts set to contr.sum for the following variables: idcodegroup
fit1a <- afex::aov_ez(id = "prolific_pid", dv = "num_nodes_macro",
                      data = dat_long, between=c("idcodegroup"), within=c("timepoint"))
## Contrasts set to contr.sum for the following variables: idcodegroup
# partical eta squared
anova(fit1, es = "pes")
## Anova Table (Type 3 tests)
## 
## Response: num_nodes_macro
##                       num Df den Df    MSE       F     pes    Pr(>F)    
## idcodegroup                2     72 40.611  2.8118 0.07245   0.06671 .  
## timepoint                  1     72  6.822 49.5444 0.40762 9.375e-10 ***
## idcodegroup:timepoint      2     72  6.822 15.0817 0.29525 3.383e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# generalized eta squared
fit1a # > identical results
## Anova Table (Type 3 tests)
## 
## Response: num_nodes_macro
##                  Effect    df   MSE         F  ges p.value
## 1           idcodegroup 2, 72 40.61    2.81 + .063    .067
## 2             timepoint 1, 72  6.82 49.54 *** .090   <.001
## 3 idcodegroup:timepoint 2, 72  6.82 15.08 *** .057   <.001
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1

visualize results

dfvalcor <- data_summary(dat_long, varname="num_nodes_macro",
                         groupnames=c("timepoint","idcodegroup"))
p <- ggplot(dfvalcor, aes(x=timepoint, y=num_nodes_macro, fill=idcodegroup)) +
  geom_bar(stat="identity", color="black",
           position=position_dodge()) +
  geom_errorbar(aes(ymin=num_nodes_macro-se, ymax=num_nodes_macro+se), width=.2,
                position=position_dodge(.9)) + ggplot_theme + ylab(label = "number of concepts drawn")
print(p)

dfvalcor <- data_summary(dat_long, varname="num_nodes_macro",
                         groupnames=c("timepoint","idcodegroup"))
dfvalcor$idcodegroup <- ifelse(test = dfvalcor$idcodegroup == "control", yes = "reflect on own CAM", 
                               no = ifelse(test = dfvalcor$idcodegroup == "negative", yes = "reflect on positive CAM", no = "reflect on negative CAM"))
dfvalcor$timepoint <- ifelse(test = dfvalcor$timepoint == 0, yes = "t1", no = "t2")


p <- ggplot(dfvalcor, aes(x=timepoint, y=num_nodes_macro, fill=idcodegroup)) +
  geom_bar(stat="identity", color="black",
           position=position_dodge()) + 
  geom_errorbar(aes(ymin=num_nodes_macro-se, ymax=num_nodes_macro+se), width=.2,
                position=position_dodge(.9)) + ggplot_theme + ylab(label = "number of drawn concepts") + scale_fill_manual(values=c("red", "blue", "green")) +  theme(legend.title=element_blank(), legend.text=element_text(size=rel(1.0)), legend.position="top") 



print(p)

tmp_negative <- data_summary(dat_long, varname="num_nodes_neg_macro",
                         groupnames=c("timepoint","idcodegroup"))
for(g in unique(tmp_negative$idcodegroup)){
  tmp_dat <- tmp_negative[tmp_negative$idcodegroup == g, ]
  
  tmp_percentage <- (tmp_dat$num_nodes_neg_macro[2] - tmp_dat$num_nodes_neg_macro[1]) / tmp_dat$num_nodes_neg_macro[2]
  print(g)
  print(round(x = tmp_percentage * 100, digits = 0))
}
## [1] "control"
## [1] -7
## [1] "negative"
## [1] 10
## [1] "positive"
## [1] 46
tmp_positive <- data_summary(dat_long, varname="num_nodes_pos_macro",
                         groupnames=c("timepoint","idcodegroup"))
for(g in unique(tmp_positive$idcodegroup)){
  tmp_dat <- tmp_positive[tmp_positive$idcodegroup == g, ]
  
  tmp_percentage <- (tmp_dat$num_nodes_pos_macro[2] - tmp_dat$num_nodes_pos_macro[1]) / tmp_dat$num_nodes_pos_macro[2]
  print(g)
  print(round(x = tmp_percentage * 100, digits = 0))
}
## [1] "control"
## [1] 10
## [1] "negative"
## [1] 49
## [1] "positive"
## [1] 8

run post hoc tests

# Effect of group at each time point
one.way <- dat_long %>%
  group_by(timepoint) %>%
  anova_test(dv = num_nodes_macro, wid = prolific_pid, between = idcodegroup) %>%
  get_anova_table() %>%
  adjust_pvalue(method = "bonferroni")
one.way
## # A tibble: 2 × 9
##   timepoint Effect        DFn   DFd     F        p `p<.05`   ges   p.adj
##       <dbl> <chr>       <dbl> <dbl> <dbl>    <dbl> <chr>   <dbl>   <dbl>
## 1         0 idcodegroup     2    72 0.068 0.934    ""      0.002 1      
## 2         1 idcodegroup     2    72 7.71  0.000925 "*"     0.176 0.00185
# Pairwise comparisons between group levels
pwc <- dat_long %>%
  group_by(timepoint) %>%
  pairwise_t_test(num_nodes_macro ~ idcodegroup, p.adjust.method = "bonferroni")
pwc
## # A tibble: 6 × 10
##   timepoint .y.             group1   group2    n1    n2       p p.signif   p.adj
## *     <dbl> <chr>           <chr>    <chr>  <int> <int>   <dbl> <chr>      <dbl>
## 1         0 num_nodes_macro control  negat…    40    17 8.67e-1 ns       1      
## 2         0 num_nodes_macro control  posit…    40    18 7.94e-1 ns       1      
## 3         0 num_nodes_macro negative posit…    17    18 7.17e-1 ns       1      
## 4         1 num_nodes_macro control  negat…    40    17 8.71e-3 **       0.0261 
## 5         1 num_nodes_macro control  posit…    40    18 7.08e-4 ***      0.00212
## 6         1 num_nodes_macro negative posit…    17    18 5.11e-1 ns       1      
## # ℹ 1 more variable: p.adj.signif <chr>

visualize results - negative concepts

dfvalcor <- data_summary(dat_long, varname="num_nodes_neg_macro",
                         groupnames=c("timepoint","idcodegroup"))
p <- ggplot(dfvalcor, aes(x=timepoint, y=num_nodes_neg_macro, fill=idcodegroup)) +
  geom_bar(stat="identity", color="black",
           position=position_dodge()) +
  geom_errorbar(aes(ymin=num_nodes_neg_macro-se, ymax=num_nodes_neg_macro+se), width=.2,
                position=position_dodge(.9)) + ggplot_theme + ylab(label = "number of concepts drawn")
print(p)

visualize results - positive concepts

dfvalcor <- data_summary(dat_long, varname="num_nodes_pos_macro",
                         groupnames=c("timepoint","idcodegroup"))
p <- ggplot(dfvalcor, aes(x=timepoint, y=num_nodes_pos_macro, fill=idcodegroup)) +
  geom_bar(stat="identity", color="black",
           position=position_dodge()) +
  geom_errorbar(aes(ymin=num_nodes_pos_macro-se, ymax=num_nodes_pos_macro+se), width=.2,
                position=position_dodge(.9)) + ggplot_theme + ylab(label = "number of concepts drawn")
print(p)

dat_long %>% 
  group_by(timepoint, idcodegroup) %>%
  dplyr::summarise(mean_numTotal = mean(num_nodes_macro), 
                   mean_numNeg = mean(num_nodes_neg_macro), 
                   mean_numPos = mean(num_nodes_pos_macro))
## `summarise()` has grouped output by 'timepoint'. You can override using the
## `.groups` argument.
## # A tibble: 6 × 5
## # Groups:   timepoint [2]
##   timepoint idcodegroup mean_numTotal mean_numNeg mean_numPos
##       <dbl> <fct>               <dbl>       <dbl>       <dbl>
## 1         0 control              13.4        5.22        4.78
## 2         0 negative             13.2        6.24        3.94
## 3         0 positive             13.8        4.39        6.72
## 4         1 control              13.6        4.9         5.32
## 5         1 negative             17.7        6.94        7.76
## 6         1 positive             18.9        8.06        7.28

2.6 re-test reliability

dat_control <- dat_long[dat_long$idcodegroup == "control",]




dat_control_wide <- dat_wide[dat_wide$idcodegroup_t0 == "control" & !is.na(dat_wide$idcodegroup_t0),]


cor.test(dat_control_wide$mean_valence_macro_t0, dat_control_wide$mean_valence_macro_t1) %>%
  report()
## Effect sizes were labelled following Funder's (2019) recommendations.
## 
## The Pearson's product-moment correlation between
## dat_control_wide$mean_valence_macro_t0 and
## dat_control_wide$mean_valence_macro_t1 is positive, statistically significant,
## and very large (r = 0.63, 95% CI [0.40, 0.79], t(38) = 5.03, p < .001)
cor.test(dat_control_wide$num_nodes_macro_t0, dat_control_wide$num_nodes_macro_t1) %>%
  report()
## Effect sizes were labelled following Funder's (2019) recommendations.
## 
## The Pearson's product-moment correlation between
## dat_control_wide$num_nodes_macro_t0 and dat_control_wide$num_nodes_macro_t1 is
## positive, statistically significant, and very large (r = 0.68, 95% CI [0.47,
## 0.82], t(38) = 5.75, p < .001)
plot(dat_control_wide$mean_valence_macro_t0, dat_control_wide$mean_valence_macro_t1)

cor(dat_control_wide$mean_valence_macro_t0, dat_control_wide$mean_valence_macro_t1)
## [1] 0.6325073
plot(dat_control_wide$num_nodes_macro_t0, dat_control_wide$num_nodes_macro_t1)

cor(dat_control_wide$num_nodes_macro_t0, dat_control_wide$num_nodes_macro_t1)
## [1] 0.6820048
plot(dat_control_wide$num_nodes_pos_macro_t0, dat_control_wide$num_nodes_pos_macro_t1)

cor(dat_control_wide$num_nodes_pos_macro_t0, dat_control_wide$num_nodes_pos_macro_t1)
## [1] 0.6736945
plot(dat_control_wide$num_nodes_neg_macro_t0, dat_control_wide$num_nodes_neg_macro_t1)

cor(dat_control_wide$num_nodes_neg_macro_t0, dat_control_wide$num_nodes_neg_macro_t1)
## [1] 0.5196905