Main tests
H1: Manipulating a perception of Hamas as highly competent will increase support for action against Hamas [Welch t-test after deletion of outliers]
SampleAction <- Participants_Attentive[-Remove_Outliers_support, ]
t_test_action<-t.test(SampleAction$SupportActionMean ~ SampleAction$Condition)
cohen_d_action<-effectsize::cohens_d(SampleAction$SupportActionMean ~ SampleAction$Condition)
Participants in the High Competence condition displayed significantly more support for violent and nonviolent actions against Hamas (M = 2.735, SD = 0.669) than participants in the Low Competence condition (M = 2.448; SD = 0.653), t(581.441) = 5.247, p = 0, d = , 95%CI[ 0.27; 0.598].
# Load necessary libraries
library(ggplot2)
library(dplyr)
# Prepare the data
SampleAction <- Participants_Attentive[-Remove_Outliers_support, ]
# Create a density plot
ggplot(SampleAction, aes(x = SupportActionMean, fill = Condition)) +
geom_density(alpha = 0.7) +
labs(title = "Density Plot of Support for Action Against Hamas",
x = "Support For Action Against Hamas",
y = "Density",
fill = "Condition") +
scale_fill_discrete(labels = c("High Condition", "Low Condition")) +
theme_minimal()
H2: Participants in the High Competence condition should be more likely to label Hamas soldiers as terrorists [Huber Weighted regressions because outliers > 10%]
SampleLabel <- Participants_Attentive
# Dummy code COndition:
SampleLabel$Condition_dummy <- ifelse(SampleLabel$Condition == "LC", -0.5, 0.5)
mod2<-rlm(SampleLabel$Label~SampleLabel$Condition_dummy)
mod2_p<-f.robftest(mod2, var = "SampleLabel$Condition_dummy")
mod2_CI<-confint.default(object = mod2, parm = "SampleLabel$Condition_dummy", level = 0.95)
Participants in the High Competence condition significantly agreed more with labelling Hamas as terrorists (M = 4.72, SD = 0.514) than participants in the Low Competence condition (M = 4.507; SD = 0.714), B = 0.149, t(585) = 12.68, p = 0, 95%CI[ 0.067; 0.23].
Participants_Attentive$
Participants_Attentive$Label <- factor(Participants_Attentive$Label, levels = 1:5, ordered = TRUE)
summary_data <- Participants_Attentive %>%
group_by(Condition, Label) %>%
summarise(
count = n()
) %>%
ungroup() %>%
# Calculate total counts per condition
group_by(Condition) %>%
mutate(
total = sum(count),
proportion = count / total
) %>%
# Calculate standard error of the proportion
mutate(
se = sqrt((proportion * (1 - proportion)) / total)
)
ggplot(summary_data, aes(x = as.factor(Label), y = proportion, fill = Condition)) +
geom_bar(stat = "identity", position = "dodge") +
geom_errorbar(aes(ymin = proportion - se, ymax = proportion + se),
width = 0.2, position = position_dodge(0.9)) +
scale_y_continuous(labels = scales::percent_format(accuracy = 1)) +
labs(title = "Proportion of Each Label level by Condition",
x = "Label levels",
y = "Proportion of Participants (%)",
fill = "Condition") +
theme_minimal()
Note: As shown in descriptive plot above, there is a ceiling effect - Suggested deviation from registration: recode variable as 1 (Full agreement with the label of “terrorists”) and 0 (all other possible answers) and compute a robust logistic regression to predict “Full agreement with the label of”Terrorists”. This is a somewhat less interesting question.
Show/Hide Robust Binomial Regression
***ROBUST BINOMIAL REGRESSION***:
```r
SampleLabel$FullAgree <- ifelse(SampleLabel$Label == 5, 1, 0)
summary(robustbase::glmrob(SampleLabel$FullAgree ~ SampleLabel$Condition, family = "binomial" ))
```
```
##
## Call: robustbase::glmrob(formula = SampleLabel$FullAgree ~ SampleLabel$Condition, family = "binomial")
##
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 1.085 0.135 8.04 0.00000000000000087 ***
## SampleLabel$ConditionLC -0.614 0.180 -3.40 0.00067 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Robustness weights w.r * w.x:
## 513 weights are ~= 1. The remaining 74 ones are summarized as
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 0.782 0.782 0.782 0.782 0.782 0.782
##
## Number of observations: 587
## Fitted by method 'Mqle' (in 1 iterations)
##
## (Dispersion parameter for binomial family taken to be 1)
##
## No deviance values available
## Algorithmic parameters:
## acc tcc
## 0.0001 1.3450
## maxit
## 50
## test.acc
## "coef"
```
H3: Manipulating a perception of Hamas as not competent will increase the use of controversial humor to legitimize ingroup superiority
SampleJoke <- Participants_Attentive[-Remove_Outliers_Joke, ]
t_test_Joke<-t.test(SampleJoke$JokeMean ~ SampleJoke$Condition)
cohen_d_Joke<-effectsize::cohens_d(SampleJoke$JokeMean ~ SampleJoke$Condition)
Participants in the High Competence condition did not displayed significantly less endorsement of controversial jokes, (M = 3, SD = 0.706) than participants in the Low Competence condition (M = 2.986; SD = 0.705), t(579.955) = 0.234, p = 0.815, d = , 95%CI[ -0.143; 0.182].
ggplot(SampleJoke, aes(x = Condition, y = JokeMean, fill = Condition)) +
geom_boxplot(alpha = 0.6, outlier.shape = NA, width = 0.5) +
geom_jitter(position = position_jitter(width = 0.15), size = 2, alpha = 0.1, color = "black") +
labs(
title = "endorsement of Controversial Jokes by Condition",
x = "Condition",
y = "Mean endorsement Rating for Jokes"
) +
theme_minimal() +
theme(
legend.position = "none",
plot.title = element_text(size = 14, face = "bold")
)
As registered, because the effect is not significant at the alpha level of .0125, we compute an equivalence test using a small effect size by social psychology standards (d = 0.16, Lovakov & Agadullina, 2021)
res<-TOSTER::t_TOST(x = subset(SampleJoke,Condition== "HC")$JokeMean,
y = subset(SampleJoke,Condition=="LC")$JokeMean,
eqb = .16)
describe(res)
## [1] "Using the Welch Two Sample t-test, a null hypothesis significance test (NHST), and a equivalence test, via two one-sided tests (TOST), were performed with an alpha-level of 0.05. These tested the null hypotheses that true mean difference is equal to 0 (NHST), and true mean difference is more extreme than -0.16 and 0.16 (TOST). The equivalence test was significant, t(579.955) = -2.5, p = 0.006 (mean difference = 0.014 90% C.I.[-0.0826, 0.11]; Hedges's g(av) = 0.019 90% C.I.[-0.117, 0.156]). At the desired error rate, it can be stated that the true mean difference is between -0.16 and 0.16."
The two means are equivalent. We can conclude that the effect size might be too small to be interesting, considering that it is significantly smaller than a small effect size (d = 0.16).
(Note: these are simulated data, so we actually know that the true difference between the groups is = 0).
H4: Manipulating a perception of Hamas as competent will increase the expectations of future successes by Hamas
SampleSuccess <- Participants_Attentive
t_test_Success<- t.test(SampleSuccess$ProbaSucces ~ SampleSuccess$Condition)
cohen_d_Success<- effectsize::cohens_d(SampleSuccess$ProbaSucces ~ SampleSuccess$Condition)
Participants in the High Competence condition displayed significantly more future Hamas success (M = 0.662, SD = 0.237) than participants in the Low Competence condition (M = 0.523; SD = 0.232), t(584.617) = 7.138, p = 0, d = , 95%CI[ 0.424; 0.754].
# Create a density plot
ggplot(SampleSuccess, aes(x = ProbaSucces, fill = Condition)) +
geom_density(alpha = 0.7) +
labs(title = "Density Plot of Expected future Successes of Hamas (probability)",
x = "Expectation of future success by Hamas",
y = "Density",
fill = "Condition") +
scale_fill_discrete(labels = c("High Condition", "Low Condition")) +
theme_minimal()
Alternative Approach: Initial attitudes toward Hamas are not equivalent
NOTE: In case Attitudes toward Hamas were not equivalent between the two groups from the start (see control), we should use Initial attitudes toward Hamas as a covariate. This would be done in robust regressions (see registration).
Show/Hide Alternative analyses if initial attitudes toward Hamas differ between the two groups
# Dummy code COndition:
Participants_Attentive$Condition_dummy <- ifelse(Participants_Attentive$Condition == "LC", -0.5, 0.5)
summary(mod1<-rlm(Participants_Attentive$SupportActionMean ~Participants_Attentive$Condition_dummy + scale(Participants_Attentive$AttitudeHamas)))
##
## Call: rlm(formula = Participants_Attentive$SupportActionMean ~ Participants_Attentive$Condition_dummy +
## scale(Participants_Attentive$AttitudeHamas))
## Residuals:
## Min 1Q Median 3Q Max
## -1.7667 -0.4231 -0.0699 0.4301 2.0769
##
## Coefficients:
## Value Std. Error t value
## (Intercept) 2.590 0.030 86.141
## Participants_Attentive$Condition_dummy 0.313 0.060 5.204
## scale(Participants_Attentive$AttitudeHamas) 0.017 0.030 0.578
##
## Residual standard error: 0.638 on 584 degrees of freedom
mod1_p<-f.robftest(mod1, var = "Participants_Attentive$Condition_dummy")
mod1_CI<-confint.default(object = mod1, parm = "Participants_Attentive$Condition_dummy", level = 0.95)
summary(mod2<-rlm(Participants_Attentive$Label ~Participants_Attentive$Condition_dummy+ scale(Participants_Attentive$AttitudeHamas)))
##
## Call: rlm(formula = Participants_Attentive$Label ~ Participants_Attentive$Condition_dummy +
## scale(Participants_Attentive$AttitudeHamas))
## Residuals:
## Min 1Q Median 3Q Max
## -2.657 -0.617 0.232 0.383 0.494
##
## Coefficients:
## Value Std. Error t value
## (Intercept) 4.673 0.022 207.971
## Participants_Attentive$Condition_dummy 0.151 0.045 3.348
## scale(Participants_Attentive$AttitudeHamas) -0.032 0.023 -1.433
##
## Residual standard error: 0.567 on 584 degrees of freedom
mod2_p<-f.robftest(mod2, var = "Participants_Attentive$Condition_dummy")
mod2_CI<-confint.default(object = mod2, parm = "Participants_Attentive$Condition_dummy", level = 0.95)
summary(mod3<-rlm(Participants_Attentive$ProbaSucces ~Participants_Attentive$Condition_dummy+ scale(Participants_Attentive$AttitudeHamas)))
##
## Call: rlm(formula = Participants_Attentive$ProbaSucces ~ Participants_Attentive$Condition_dummy +
## scale(Participants_Attentive$AttitudeHamas))
## Residuals:
## Min 1Q Median 3Q Max
## -0.67714 -0.16329 0.00472 0.16134 0.47783
##
## Coefficients:
## Value Std. Error t value
## (Intercept) 0.600 0.010 59.352
## Participants_Attentive$Condition_dummy 0.154 0.020 7.620
## scale(Participants_Attentive$AttitudeHamas) 0.000 0.010 -0.041
##
## Residual standard error: 0.24 on 584 degrees of freedom
mod3_p<-f.robftest(mod3, var = "Participants_Attentive$Condition_dummy")
mod3_CI<-confint.default(object = mod3, parm = "Participants_Attentive$Condition_dummy", level = 0.95)
summary(mod4<-rlm(Participants_Attentive$JokeMean ~Participants_Attentive$Condition_dummy+ scale(Participants_Attentive$AttitudeHamas)))
##
## Call: rlm(formula = Participants_Attentive$JokeMean ~ Participants_Attentive$Condition_dummy +
## scale(Participants_Attentive$AttitudeHamas))
## Residuals:
## Min 1Q Median 3Q Max
## -2.00194 -0.49076 0.00924 0.50924 2.02563
##
## Coefficients:
## Value Std. Error t value
## (Intercept) 2.991 0.033 91.506
## Participants_Attentive$Condition_dummy 0.011 0.065 0.171
## scale(Participants_Attentive$AttitudeHamas) -0.009 0.033 -0.290
##
## Residual standard error: 0.744 on 584 degrees of freedom
mod4_p<-f.robftest(mod4, var = "Participants_Attentive$Condition_dummy")
mod4_CI<-confint.default(object = mod4, parm = "Participants_Attentive$Condition_dummy", level = 0.95)
results_df <- data.frame(
Predictor = c("SupportActionMean", "Label", "ProbaSucces", "JokeMean"),
Coefficient = c(coef(mod1)["Participants_Attentive$Condition_dummy"],
coef(mod2)["Participants_Attentive$Condition_dummy"],
coef(mod3)["Participants_Attentive$Condition_dummy"],
coef(mod4)["Participants_Attentive$Condition_dummy"]),
t_value = c(mod1_p$statistic, mod2_p$statistic, mod3_p$statistic, mod4_p$statistic),
p_value = c(mod1_p$p.value, mod2_p$p.value, mod3_p$p.value, mod4_p$p.value),
CI_95 = c(paste0("[", round(mod1_CI[1], 3), ", ", round(mod1_CI[2], 3), "]"),
paste0("[", round(mod2_CI[1], 3), ", ", round(mod2_CI[2], 3), "]"),
paste0("[", round(mod3_CI[1], 3), ", ", round(mod3_CI[2], 3), "]"),
paste0("[", round(mod4_CI[1], 3), ", ", round(mod4_CI[2], 3), "]"))
)
knitr::kable(results_df, caption = "Results from this alternative approach", format = "markdown")
| Predictor | Coefficient | t_value | p_value | CI_95 |
|---|---|---|---|---|
| SupportActionMean | 0.313 | 27.101 | 0.000 | [0.195, 0.432] |
| Label | 0.151 | 11.199 | 0.001 | [0.062, 0.239] |
| ProbaSucces | 0.154 | 58.076 | 0.000 | [0.115, 0.194] |
| JokeMean | 0.011 | 0.029 | 0.864 | [-0.117, 0.14] |
We also registered some additional exploratory analyses.
Exploratory analyses:
Anger Level should positively moderate the effect of condition on Support for actions:
Participants_Attentive$EmoAnger<- scale(Participants_Attentive$EmoAnger)
Participants_Attentive$EmoCont<- scale(Participants_Attentive$EmoCont)
summary(mod1<-rlm(Participants_Attentive$SupportActionMean ~Participants_Attentive$Condition_dummy*Participants_Attentive$EmoAnger))
##
## Call: rlm(formula = Participants_Attentive$SupportActionMean ~ Participants_Attentive$Condition_dummy *
## Participants_Attentive$EmoAnger)
## Residuals:
## Min 1Q Median 3Q Max
## -1.673 -0.437 -0.030 0.450 2.070
##
## Coefficients:
## Value
## (Intercept) 2.588
## Participants_Attentive$Condition_dummy 0.310
## Participants_Attentive$EmoAnger 0.028
## Participants_Attentive$Condition_dummy:Participants_Attentive$EmoAnger 0.063
## Std. Error
## (Intercept) 0.030
## Participants_Attentive$Condition_dummy 0.060
## Participants_Attentive$EmoAnger 0.030
## Participants_Attentive$Condition_dummy:Participants_Attentive$EmoAnger 0.060
## t value
## (Intercept) 86.122
## Participants_Attentive$Condition_dummy 5.161
## Participants_Attentive$EmoAnger 0.940
## Participants_Attentive$Condition_dummy:Participants_Attentive$EmoAnger 1.046
##
## Residual standard error: 0.648 on 583 degrees of freedom
mod1_p<-f.robftest(mod1, var = "Participants_Attentive$Condition_dummy:Participants_Attentive$EmoAnger")
mod1_CI<-confint.default(object = mod1, parm = "Participants_Attentive$Condition_dummy:Participants_Attentive$EmoAnger", level = 0.95)
# Create the interaction plot
ggplot(Participants_Attentive, aes(x = EmoAnger, y = SupportActionMean, color = Condition)) +
geom_point(alpha = 0.6) +
geom_smooth(method = "lm", se = TRUE, fullrange = TRUE, aes(fill = Condition)) +
labs(
title = "Interaction between Anger and Condition on Support for action against Hamas",
x = "Anger (scaled)",
y = "Supporting Action against Hamas",
color = "Condition",
fill = "Condition"
) +
theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'
Interaction effect: B = NA, t(584) = 11.199, p = 0.001, 95%CI[ 0.062; 0.239]. ==> N.S.
Anger Level should positively moderate the effect of condition on Characterisation of Hamas as terrorists:
summary(mod1<-rlm(Participants_Attentive$Label ~Participants_Attentive$Condition_dummy*Participants_Attentive$EmoAnger))
##
## Call: rlm(formula = Participants_Attentive$Label ~ Participants_Attentive$Condition_dummy *
## Participants_Attentive$EmoAnger)
## Residuals:
## Min 1Q Median 3Q Max
## -2.730 -0.598 0.256 0.400 0.408
##
## Coefficients:
## Value
## (Intercept) 4.671
## Participants_Attentive$Condition_dummy 0.148
## Participants_Attentive$EmoAnger 0.005
## Participants_Attentive$Condition_dummy:Participants_Attentive$EmoAnger 0.015
## Std. Error
## (Intercept) 0.021
## Participants_Attentive$Condition_dummy 0.042
## Participants_Attentive$EmoAnger 0.021
## Participants_Attentive$Condition_dummy:Participants_Attentive$EmoAnger 0.042
## t value
## (Intercept) 222.734
## Participants_Attentive$Condition_dummy 3.524
## Participants_Attentive$EmoAnger 0.230
## Participants_Attentive$Condition_dummy:Participants_Attentive$EmoAnger 0.362
##
## Residual standard error: 0.597 on 583 degrees of freedom
mod1_p<-f.robftest(mod1, var = "Participants_Attentive$Condition_dummy:Participants_Attentive$EmoAnger")
mod1_CI<-confint.default(object = mod1, parm = "Participants_Attentive$Condition_dummy:Participants_Attentive$EmoAnger", level = 0.95)
# Create the interaction plot
ggplot(Participants_Attentive, aes(x = EmoAnger, y = Label, color = Condition)) +
geom_point(alpha = 0.6) +
geom_smooth(method = "lm", se = TRUE, fullrange = TRUE, aes(fill = Condition)) +
labs(
title = "Interaction between Anger and Condition on Label of Hamas as Terrorists",
x = "Anger (scaled)",
y = "Label",
color = "Condition",
fill = "Condition"
) +
theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'
Interaction effect: B = NA, t(584) = 11.199, p = 0.001, 95%CI[ 0.062; 0.239]. ==> N.S.
Contempt Level should positively moderate the effect of low competence on Dark Humor Appreciation:
summary(mod1<-rlm(Participants_Attentive$JokeMean ~Participants_Attentive$Condition_dummy*Participants_Attentive$EmoCont))
##
## Call: rlm(formula = Participants_Attentive$JokeMean ~ Participants_Attentive$Condition_dummy *
## Participants_Attentive$EmoCont)
## Residuals:
## Min 1Q Median 3Q Max
## -2.12544 -0.49746 0.00254 0.50254 2.02945
##
## Coefficients:
## Value
## (Intercept) 3.009
## Participants_Attentive$Condition_dummy 0.035
## Participants_Attentive$EmoCont 0.052
## Participants_Attentive$Condition_dummy:Participants_Attentive$EmoCont 0.162
## Std. Error
## (Intercept) 0.035
## Participants_Attentive$Condition_dummy 0.071
## Participants_Attentive$EmoCont 0.035
## Participants_Attentive$Condition_dummy:Participants_Attentive$EmoCont 0.071
## t value
## (Intercept) 84.967
## Participants_Attentive$Condition_dummy 0.491
## Participants_Attentive$EmoCont 1.472
## Participants_Attentive$Condition_dummy:Participants_Attentive$EmoCont 2.282
##
## Residual standard error: 0.74 on 583 degrees of freedom
mod1_p<-f.robftest(mod1, var = "Participants_Attentive$Condition_dummy:Participants_Attentive$EmoCont")
mod1_CI<-confint.default(object = mod1, parm = "Participants_Attentive$Condition_dummy:Participants_Attentive$EmoCont", level = 0.95)
# Create the interaction plot
ggplot(Participants_Attentive, aes(x = EmoCont, y = JokeMean, color = Condition)) +
geom_point(alpha = 0.6) +
geom_smooth(method = "lm", se = TRUE, fullrange = TRUE, aes(fill = Condition)) +
labs(
title = "Interaction between Contempt and Condition on Endorsement of controversial jokes",
x = "Contempt (scaled)",
y = "Controversial joke endorsement",
color = "Condition",
fill = "Condition"
) +
theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'
Interaction effect: B = NA, t(584) = 11.199, p = 0.001, 95%CI[ 0.062; 0.239]. ==> N.S.
Contempt Level should positively moderate the effect of low competence on Expectations of future failures:
summary(mod1<-rlm(Participants_Attentive$ProbaSucces ~Participants_Attentive$Condition_dummy*Participants_Attentive$EmoCont))
##
## Call: rlm(formula = Participants_Attentive$ProbaSucces ~ Participants_Attentive$Condition_dummy *
## Participants_Attentive$EmoCont)
## Residuals:
## Min 1Q Median 3Q Max
## -0.70233 -0.16787 0.00849 0.15869 0.51832
##
## Coefficients:
## Value
## (Intercept) 0.592
## Participants_Attentive$Condition_dummy 0.152
## Participants_Attentive$EmoCont 0.000
## Participants_Attentive$Condition_dummy:Participants_Attentive$EmoCont -0.061
## Std. Error
## (Intercept) 0.010
## Participants_Attentive$Condition_dummy 0.020
## Participants_Attentive$EmoCont 0.010
## Participants_Attentive$Condition_dummy:Participants_Attentive$EmoCont 0.021
## t value
## (Intercept) 57.801
## Participants_Attentive$Condition_dummy 7.415
## Participants_Attentive$EmoCont 0.005
## Participants_Attentive$Condition_dummy:Participants_Attentive$EmoCont -2.960
##
## Residual standard error: 0.243 on 583 degrees of freedom
mod1_p<-f.robftest(mod1, var = "Participants_Attentive$Condition_dummy:Participants_Attentive$EmoCont")
mod1_CI<-confint.default(object = mod1, parm = "Participants_Attentive$Condition_dummy:Participants_Attentive$EmoCont", level = 0.95)
# Create the interaction plot
ggplot(Participants_Attentive, aes(x = EmoCont, y = ProbaSucces, color = Condition)) +
geom_point(alpha = 0.6) +
geom_smooth(method = "lm", se = TRUE, fullrange = TRUE, aes(fill = Condition)) +
labs(
title = "Interaction between Contempt and Condition on Probability of Success",
x = "Contempt (scaled)",
y = "Probability of Success",
color = "Condition",
fill = "Condition"
) +
theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'
Interaction effect: B = NA, t(584) = 11.199, p = 0.001, 95%CI[ 0.062; 0.239]. ==> N.S.
Analysing separately violent vs non violent actions:
Participants_Attentive$Violent <-rowMeans(cbind(Participants_Attentive$Q1supv,
Participants_Attentive$Q2supv,
Participants_Attentive$Q3supv))
outliers_SupportAgainstV <- abs(Participants_Attentive$Violent - median(Participants_Attentive$Violent)) > 2.5 * mad(Participants_Attentive$Violent)
Remove_Outliers_support<-which(outliers_SupportAgainstV == T)
sum(Remove_Outliers_support) # No outliers
## [1] 0
t_test_action<-t.test(SampleAction$SupportActionMean ~ SampleAction$Condition)
cohen_d_action<-effectsize::cohens_d(SampleAction$SupportActionMean ~ SampleAction$Condition)
t_test_action<-t.test(Participants_Attentive$Violent ~ Participants_Attentive$Condition)
cohen_d_action<- effectsize::cohens_d(Participants_Attentive$Violent ~ Participants_Attentive$Condition)
Participants_Attentive$NonViolent <-rowMeans(cbind(Participants_Attentive$Q4supnv,
Participants_Attentive$Q5supnv,
Participants_Attentive$Q6supnv))
outliers_SupportAgainstNV <- abs(Participants_Attentive$NonViolent - median(Participants_Attentive$NonViolent)) > 2.5 * mad(Participants_Attentive$NonViolent)
Remove_Outliers_support<-which(outliers_SupportAgainstNV == T)
sum(Remove_Outliers_support) # No outliers
## [1] 0
t_test_actionNV<- t.test(Participants_Attentive$NonViolent ~ Participants_Attentive$Condition)
cohen_d_actionNV<- effectsize::cohens_d(Participants_Attentive$NonViolent ~ Participants_Attentive$Condition)
# Violent actions
t_value_violent <- t_test_action$statistic
df_violent <- t_test_action$parameter
p_value_violent <- t_test_action$p.value
cohen_d_violent <- cohen_d_action$Cohens_d
ci_low_violent <- cohen_d_action$CI_low
ci_high_violent <- cohen_d_action$CI_high
# NonViolent actions
t_value_nonviolent <- t_test_actionNV$statistic
df_nonviolent <- t_test_actionNV$parameter
p_value_nonviolent <- t_test_actionNV$p.value
cohen_d_nonviolent <- cohen_d_actionNV$Cohens_d
ci_low_nonviolent <- cohen_d_actionNV$CI_low
ci_high_nonviolent <- cohen_d_actionNV$CI_high
# Create a data frame with the results
results_table <- data.frame(
Action = c("Violent", "NonViolent"),
t_value = c(round(t_value_violent, 2), round(t_value_nonviolent, 2)),
df = c(round(df_violent, 2), round(df_nonviolent, 2)),
p_value = c(signif(p_value_violent, 3), signif(p_value_nonviolent, 3)),
Cohen_d = c(round(cohen_d_violent, 2), round(cohen_d_nonviolent, 2)),
`95% CI Lower` = c(round(ci_low_violent, 2), round(ci_low_nonviolent, 2)),
`95% CI Upper` = c(round(ci_high_violent, 2), round(ci_high_nonviolent, 2))
)
kable(
results_table,
caption = "Results of t-tests and Cohen's d for Violent and NonViolent Actions separately",
col.names = c("Action", "t-value", "df", "p-value", "Cohen's d", "95% CI Lower", "95% CI Upper"),
align = c('l', 'c', 'c', 'c', 'c', 'c', 'c')
)
| Action | t-value | df | p-value | Cohen’s d | 95% CI Lower | 95% CI Upper |
|---|---|---|---|---|---|---|
| Violent | 4.87 | 580 | 0 | 0.40 | 0.24 | 0.56 |
| NonViolent | 3.85 | 584 | 0 | 0.32 | 0.15 | 0.48 |
Analysing separately appreciating the joke and sharing it (in case of low consistency)
outliers_JokeAppreciation <- abs(Participants_Attentive$Joke_appreciation - median(Participants_Attentive$Joke_appreciation)) > 2.5 * mad(Participants_Attentive$Joke_appreciation)
Remove_Outliers_J1<-which(outliers_JokeAppreciation == T)
sum(Remove_Outliers_J1) # No outliers
## [1] 0
t_test_action<-t.test(SampleAction$Joke_appreciation ~ SampleAction$Condition)
cohen_d_action<-effectsize::cohens_d(SampleAction$SupportActionMean ~ SampleAction$Condition)
outliers_JokeSharing <- abs(Participants_Attentive$Joke_sharing - median(Participants_Attentive$Joke_sharing)) > 2.5 * mad(Participants_Attentive$Joke_sharing)
Remove_Outliers_J2<-which(outliers_JokeSharing == T)
sum(Remove_Outliers_J2) # No outliers
## [1] 0
t_test_action2<- t.test(Participants_Attentive$Joke_sharing ~ Participants_Attentive$Condition)
cohen_d_action2<- effectsize::cohens_d(Participants_Attentive$Joke_sharing ~ Participants_Attentive$Condition)
# Violent actions
t_value_violent <- t_test_action$statistic
df_violent <- t_test_action$parameter
p_value_violent <- t_test_action$p.value
cohen_d_violent <- cohen_d_action$Cohens_d
ci_low_violent <- cohen_d_action$CI_low
ci_high_violent <- cohen_d_action$CI_high
# NonViolent actions
t_value_nonviolent <- t_test_action2$statistic
df_nonviolent <- t_test_action2$parameter
p_value_nonviolent <- t_test_action2$p.value
cohen_d_nonviolent <- cohen_d_action2$Cohens_d
ci_low_nonviolent <- cohen_d_action2$CI_low
ci_high_nonviolent <- cohen_d_action2$CI_high
# Create a data frame with the results
results_table <- data.frame(
Action = c("Joke Appreciation", "Joke Sharing"),
t_value = c(round(t_value_violent, 2), round(t_value_nonviolent, 2)),
df = c(round(df_violent, 2), round(df_nonviolent, 2)),
p_value = c(signif(p_value_violent, 3), signif(p_value_nonviolent, 3)),
Cohen_d = c(round(cohen_d_violent, 2), round(cohen_d_nonviolent, 2)),
`95% CI Lower` = c(round(ci_low_violent, 2), round(ci_low_nonviolent, 2)),
`95% CI Upper` = c(round(ci_high_violent, 2), round(ci_high_nonviolent, 2))
)
results_table
## Action t_value df p_value Cohen_d X95..CI.Lower X95..CI.Upper
## 1 Joke Appreciation -1.19 582 0.236 0.43 0.27 0.60
## 2 Joke Sharing 0.92 584 0.358 0.08 -0.09 0.24
kable(
results_table,
caption = "Results of t-tests and Cohen's d for Joke appreciation and Joke sharing separately",
col.names = c("Action", "t-value", "df", "p-value", "Cohen's d", "95% CI Lower", "95% CI Upper"),
align = c('l', 'c', 'c', 'c', 'c', 'c', 'c')
)
| Action | t-value | df | p-value | Cohen’s d | 95% CI Lower | 95% CI Upper |
|---|---|---|---|---|---|---|
| Joke Appreciation | -1.19 | 582 | 0.236 | 0.43 | 0.27 | 0.60 |
| Joke Sharing | 0.92 | 584 | 0.358 | 0.08 | -0.09 | 0.24 |
NOTE: Further exploratory analyses are available using the following Shiny app: