# demographics
min(tdata$Age)
## [1] 18
max(tdata$Age)
## [1] 69
mean(tdata$Age)
## [1] 32.94167
sd(tdata$Age)
## [1] 12.80841
above we see: min age, max age, mean age, and sd of age.
# 1 = male, 2 = female, 3 = other
table(tdata$Sex)
##
## 1 2
## 46 74
1 = male, 2 = female.
# Data preparation
# reorder factor
tdata$type_effect <- factor(tdata$type_effect, levels = c("similar", "diverse"))
# reorder factor
tdata$target_cause <- factor(tdata$target_cause, levels = c("single", "multi"),
labels = c("single-effect cause", "multiple-effects cause"))
# reorder factor
tdata$target_effect <- factor(tdata$target_effect, levels = c("first", "second", "third"),
labels = c("first effect", "second effect", "third effect"))
# to create a chart, the data must be in long format and only contain the relevant dependent variables
# make a subset with only the relevant dvs
tdata_sub <- subset(tdata, select = 1:6)
# recode dependent variables (to have values between 0 and 1)
tdata_sub$Value <- (tdata_sub$Value) * 0.01
## Warning: `guides(<scale> = FALSE)` is deprecated. Please use `guides(<scale> =
## "none")` instead.
## Warning: `fun.y` is deprecated. Use `fun` instead.
## `fun.y` is deprecated. Use `fun` instead.
## `fun.y` is deprecated. Use `fun` instead.
A clear dilution effect. Effects seems to be robust against effect domains.
## Warning: `guides(<scale> = FALSE)` is deprecated. Please use `guides(<scale> =
## "none")` instead.
## Warning: `fun.y` is deprecated. Use `fun` instead.
## `fun.y` is deprecated. Use `fun` instead.
## `fun.y` is deprecated. Use `fun` instead.
Effect also occurs for all target effects.
## : single-effect cause
## : similar
## median mean SE.mean CI.mean.0.95 var std.dev
## 0.67500000 0.65933333 0.04692359 0.09596953 0.06605471 0.25701111
## coef.var
## 0.38980452
## ------------------------------------------------------------
## : multiple-effects cause
## : similar
## median mean SE.mean CI.mean.0.95 var std.dev
## 0.38500000 0.49100000 0.04366105 0.08929688 0.05718862 0.23914142
## coef.var
## 0.48704974
## ------------------------------------------------------------
## : single-effect cause
## : diverse
## median mean SE.mean CI.mean.0.95 var std.dev
## 0.78000000 0.78633333 0.03255935 0.06659134 0.03180333 0.17833489
## coef.var
## 0.22679299
## ------------------------------------------------------------
## : multiple-effects cause
## : diverse
## median mean SE.mean CI.mean.0.95 var std.dev
## 0.49000000 0.56500000 0.04552062 0.09310011 0.06216379 0.24932668
## coef.var
## 0.44128616
# ANOVA
library(afex)
## ************
## Welcome to afex. For support visit: http://afex.singmann.science/
## - Functions for ANOVAs: aov_car(), aov_ez(), and aov_4()
## - Methods for calculating p-values with mixed(): 'S', 'KR', 'LRT', and 'PB'
## - 'afex_aov' and 'mixed' objects can be passed to emmeans() for follow-up tests
## - NEWS: emmeans() for ANOVA models now uses model = 'multivariate' as default.
## - Get and set global package options with: afex_options()
## - Set orthogonal sum-to-zero contrasts globally: set_sum_contrasts()
## - For example analyses see: browseVignettes("afex")
## ************
##
## Attache Paket: 'afex'
## Das folgende Objekt ist maskiert 'package:lme4':
##
## lmer
library(emmeans)
a1 <- aov_car(Value ~ target_cause*target_cause_color*type_effect*target_effect + Error(sID), tdata_sub)
## Converting to factor: target_cause_color
## Contrasts set to contr.sum for the following variables: target_cause, target_cause_color, type_effect, target_effect
a1
## Anova Table (Type 3 tests)
##
## Response: Value
## Effect df MSE
## 1 target_cause 1, 96 0.05
## 2 target_cause_color 1, 96 0.05
## 3 type_effect 1, 96 0.05
## 4 target_effect 2, 96 0.05
## 5 target_cause:target_cause_color 1, 96 0.05
## 6 target_cause:type_effect 1, 96 0.05
## 7 target_cause_color:type_effect 1, 96 0.05
## 8 target_cause:target_effect 2, 96 0.05
## 9 target_cause_color:target_effect 2, 96 0.05
## 10 type_effect:target_effect 2, 96 0.05
## 11 target_cause:target_cause_color:type_effect 1, 96 0.05
## 12 target_cause:target_cause_color:target_effect 2, 96 0.05
## 13 target_cause:type_effect:target_effect 2, 96 0.05
## 14 target_cause_color:type_effect:target_effect 2, 96 0.05
## 15 target_cause:target_cause_color:type_effect:target_effect 2, 96 0.05
## F ges p.value
## 1 22.88 *** .192 <.001
## 2 14.89 *** .134 <.001
## 3 6.09 * .060 .015
## 4 0.71 .015 .494
## 5 2.33 .024 .130
## 6 0.42 .004 .517
## 7 0.26 .003 .610
## 8 0.08 .002 .924
## 9 0.66 .014 .519
## 10 0.21 .004 .815
## 11 2.30 .023 .132
## 12 0.59 .012 .556
## 13 1.03 .021 .361
## 14 1.77 .036 .176
## 15 0.34 .007 .709
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Main effect of target cause, as predicted by theory. Also a smaller main effect for type of effect (i.e., effect domains). Figures show that effect is a bit bitter for effects from the same domain. There also was a main effect target cause color, which was not predicted. However. The following graph checks this main effect:
g <- ggplot(tdata_sub, aes(x=target_cause, y=valueJitter, color = target_cause, fill = target_cause)) +
guides(fill=FALSE)+
facet_grid( ~ target_cause_color)+
#ggtitle("Subjects' causal srength ratings") +
scale_y_continuous(limits = c(-0.05, 1.05), breaks=seq(0, 1, 0.1), expand = c(0,0)) +
scale_x_discrete(labels=c("single-effect \n cause", "common \n case")) +
geom_violinhalf(position=position_dodge(1), alpha = 0.2, color = NA)+
geom_point(position=position_jitterdodge(dodge.width=0.5), alpha = 0.2) +
stat_summary(fun.y=mean, colour="black", geom="line", group = 1, size = 1.5, linetype = "solid", alpha = 1)+
stat_summary(fun.data = mean_cl_boot, geom = "errorbar", width = 0, size = 1, position = position_dodge(width = 0.5), color = "black") +
stat_summary(fun.y=mean, geom="point", color = "black", shape = 22, size = 4, group=1, alpha = 1, position = position_dodge(width = 0.5))+
stat_summary(fun.y=median, geom="point", color = "black", shape = 3, size = 4, group=1, alpha = 1, position = position_dodge(width = 0.5))+
labs(x = "Target Cause", y = "Causal Strength Rating") +
scale_color_manual(name = "Entity",values=c("#3182bd", "#fc9272"))+
scale_fill_manual(name = "Entity",values=c("#3182bd", "#fc9272"))+
theme(legend.position = "none")+
myTheme
## Warning: `guides(<scale> = FALSE)` is deprecated. Please use `guides(<scale> =
## "none")` instead.
## Warning: `fun.y` is deprecated. Use `fun` instead.
## `fun.y` is deprecated. Use `fun` instead.
## `fun.y` is deprecated. Use `fun` instead.
g