Gen_df <- subset(long_df, long_df$Measure == "Mean_Gen")
Gen_df$Mean_scaled <- scale(Gen_df$Mean)
Gen_df$Hero_s <- scale(Gen_df$Hero)
Gen_df$Villain_scaled <- scale(Gen_df$Vill)
Gen_df$Danger_scaled <- scale(Gen_df$Danger)
Gen_df$Helpf_scaled <- scale(Gen_df$Helpf)
Gen_df$Att_scaled <- scale(Gen_df$Att)
#summary(lmer(Gen_df$Mean ~ Gen_df$Context + (1 | Gen_df$Part)))
summary(m<-lmer(Mean ~ Hero_s + Context + Att_scaled + (1 | Part), data = Gen_df))
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: Mean ~ Hero_s + Context + Att_scaled + (1 | Part)
## Data: Gen_df
##
## REML criterion at convergence: 6201
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -2.7999 -0.6643 -0.0491 0.6305 4.1214
##
## Random effects:
## Groups Name Variance Std.Dev.
## Part (Intercept) 1.018 1.009
## Residual 1.367 1.169
## Number of obs: 1800, groups: Part, 300
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 3.83029 0.09800 1124.93797 39.083 < 2e-16 ***
## Hero_s 0.28557 0.05992 1791.87909 4.766 2.03e-06 ***
## ContextS -0.86771 0.10086 1515.92946 -8.603 < 2e-16 ***
## ContextP -0.35046 0.11397 1611.40045 -3.075 0.00214 **
## ContextJ 0.07404 0.12963 1629.64115 0.571 0.56795
## ContextW -0.33115 0.11214 1607.38134 -2.953 0.00319 **
## ContextN -0.64755 0.09656 1503.13723 -6.706 2.82e-11 ***
## Att_scaled 0.32049 0.05276 1738.36772 6.075 1.52e-09 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) Hero_s CntxtS CntxtP CntxtJ CntxtW CntxtN
## Hero_s -0.253
## ContextS -0.569 0.006
## ContextP -0.630 0.410 0.515
## ContextJ -0.636 0.325 0.542 0.656
## ContextW -0.625 0.418 0.508 0.642 0.638
## ContextN -0.539 0.129 0.493 0.494 0.451 0.499
## Att_scaled -0.090 -0.642 0.243 0.013 0.246 -0.025 -0.024
## We fitted a linear mixed model (estimated using REML and nloptwrap optimizer)
## to predict Mean with Hero_s, Context and Att_scaled (formula: Mean ~ Hero_s +
## Context + Att_scaled). The model included Part as random effect (formula: ~1 |
## Part). The model's total explanatory power is substantial (conditional R2 =
## 0.50) and the part related to the fixed effects alone (marginal R2) is of 0.13.
## The model's intercept, corresponding to Hero_s = 0, Context = F and Att_scaled
## = 0, is at 3.83 (95% CI [3.64, 4.02], t(1790) = 39.08, p < .001). Within this
## model:
##
## - The effect of Hero s is statistically significant and positive (beta = 0.29,
## 95% CI [0.17, 0.40], t(1790) = 4.77, p < .001; Std. beta = 0.17, 95% CI [0.10,
## 0.24])
## - The effect of Context [S] is statistically significant and negative (beta =
## -0.87, 95% CI [-1.07, -0.67], t(1790) = -8.60, p < .001; Std. beta = -0.53, 95%
## CI [-0.65, -0.41])
## - The effect of Context [P] is statistically significant and negative (beta =
## -0.35, 95% CI [-0.57, -0.13], t(1790) = -3.08, p = 0.002; Std. beta = -0.21,
## 95% CI [-0.35, -0.08])
## - The effect of Context [J] is statistically non-significant and positive (beta
## = 0.07, 95% CI [-0.18, 0.33], t(1790) = 0.57, p = 0.568; Std. beta = 0.04, 95%
## CI [-0.11, 0.20])
## - The effect of Context [W] is statistically significant and negative (beta =
## -0.33, 95% CI [-0.55, -0.11], t(1790) = -2.95, p = 0.003; Std. beta = -0.20,
## 95% CI [-0.33, -0.07])
## - The effect of Context [N] is statistically significant and negative (beta =
## -0.65, 95% CI [-0.84, -0.46], t(1790) = -6.71, p < .001; Std. beta = -0.39, 95%
## CI [-0.51, -0.28])
## - The effect of Att scaled is statistically significant and positive (beta =
## 0.32, 95% CI [0.22, 0.42], t(1790) = 6.08, p < .001; Std. beta = 0.19, 95% CI
## [0.13, 0.26])
##
## 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.
summary(m<-lmer(Mean ~ Villain_scaled + Context + Att_scaled + (1 | Part), data = Gen_df))
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: Mean ~ Villain_scaled + Context + Att_scaled + (1 | Part)
## Data: Gen_df
##
## REML criterion at convergence: 6212.8
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -2.8179 -0.6687 -0.0454 0.6066 4.0969
##
## Random effects:
## Groups Name Variance Std.Dev.
## Part (Intercept) 1.083 1.041
## Residual 1.364 1.168
## Number of obs: 1800, groups: Part, 300
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 3.94109 0.09593 1038.55744 41.084 < 2e-16 ***
## Villain_scaled -0.16254 0.04821 1766.32762 -3.372 0.000763 ***
## ContextS -0.83360 0.10134 1513.72382 -8.226 4.13e-16 ***
## ContextP -0.59771 0.10409 1527.92624 -5.742 1.12e-08 ***
## ContextJ -0.03171 0.12567 1573.71849 -0.252 0.800800
## ContextW -0.62064 0.10367 1534.46191 -5.987 2.66e-09 ***
## ContextN -0.70397 0.09564 1491.99933 -7.360 3.01e-13 ***
## Att_scaled 0.39104 0.04869 1737.11083 8.031 1.76e-15 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) Vlln_s CntxtS CntxtP CntxtJ CntxtW CntxtN
## Villan_scld 0.022
## ContextS -0.578 -0.108
## ContextP -0.586 0.071 0.550
## ContextJ -0.588 -0.223 0.577 0.573
## ContextW -0.568 0.190 0.522 0.570 0.516
## ContextN -0.522 -0.008 0.495 0.486 0.427 0.483
## Att_scaled -0.267 0.555 0.207 0.367 0.385 0.391 0.059
## We fitted a linear mixed model (estimated using REML and nloptwrap optimizer)
## to predict Mean with Villain_scaled, Context and Att_scaled (formula: Mean ~
## Villain_scaled + Context + Att_scaled). The model included Part as random
## effect (formula: ~1 | Part). The model's total explanatory power is substantial
## (conditional R2 = 0.51) and the part related to the fixed effects alone
## (marginal R2) is of 0.12. The model's intercept, corresponding to
## Villain_scaled = 0, Context = F and Att_scaled = 0, is at 3.94 (95% CI [3.75,
## 4.13], t(1790) = 41.08, p < .001). Within this model:
##
## - The effect of Villain scaled is statistically significant and negative (beta
## = -0.16, 95% CI [-0.26, -0.07], t(1790) = -3.37, p < .001; Std. beta = -0.10,
## 95% CI [-0.16, -0.04])
## - The effect of Context [S] is statistically significant and negative (beta =
## -0.83, 95% CI [-1.03, -0.63], t(1790) = -8.23, p < .001; Std. beta = -0.51, 95%
## CI [-0.63, -0.39])
## - The effect of Context [P] is statistically significant and negative (beta =
## -0.60, 95% CI [-0.80, -0.39], t(1790) = -5.74, p < .001; Std. beta = -0.36, 95%
## CI [-0.49, -0.24])
## - The effect of Context [J] is statistically non-significant and negative (beta
## = -0.03, 95% CI [-0.28, 0.21], t(1790) = -0.25, p = 0.801; Std. beta = -0.02,
## 95% CI [-0.17, 0.13])
## - The effect of Context [W] is statistically significant and negative (beta =
## -0.62, 95% CI [-0.82, -0.42], t(1790) = -5.99, p < .001; Std. beta = -0.38, 95%
## CI [-0.50, -0.25])
## - The effect of Context [N] is statistically significant and negative (beta =
## -0.70, 95% CI [-0.89, -0.52], t(1790) = -7.36, p < .001; Std. beta = -0.43, 95%
## CI [-0.54, -0.31])
## - The effect of Att scaled is statistically significant and positive (beta =
## 0.39, 95% CI [0.30, 0.49], t(1790) = 8.03, p < .001; Std. beta = 0.24, 95% CI
## [0.18, 0.30])
##
## 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.
Spec_df <- subset(long_df, long_df$Measure == "Mean_Spec")
Spec_df$Mean_scaled <- scale(Spec_df$Mean)
Spec_df$Hero_s <- scale(Spec_df$Hero)
Spec_df$Villain_scaled <- scale(Spec_df$Vill)
Spec_df$Danger_scaled <- scale(Spec_df$Danger)
Spec_df$Helpf_scaled <- scale(Spec_df$Helpf)
Spec_df$Att_scaled <- scale(Spec_df$Att)
#summary(lmer(Gen_df$Mean ~ Gen_df$Context + (1 | Gen_df$Part)))
summary(m<-lmer(Mean ~ Hero_s + Context + Att_scaled + (1 | Part), data = Spec_df))
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: Mean ~ Hero_s + Context + Att_scaled + (1 | Part)
## Data: Spec_df
##
## REML criterion at convergence: 6719.9
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.03336 -0.67289 0.03611 0.68797 2.80827
##
## Random effects:
## Groups Name Variance Std.Dev.
## Part (Intercept) 0.7536 0.8681
## Residual 1.9897 1.4106
## Number of obs: 1800, groups: Part, 300
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 3.66631 0.10663 1429.39720 34.383 < 2e-16 ***
## Hero_s 0.26128 0.06849 1698.01598 3.815 0.000141 ***
## ContextS 1.35216 0.12136 1528.31489 11.141 < 2e-16 ***
## ContextP 0.83654 0.13571 1654.47055 6.164 8.88e-10 ***
## ContextJ -0.75484 0.15397 1683.56535 -4.902 1.04e-06 ***
## ContextW 1.31597 0.13360 1648.51630 9.850 < 2e-16 ***
## ContextN 0.03789 0.11636 1507.44939 0.326 0.744726
## Att_scaled 0.25138 0.06160 1790.24019 4.081 4.69e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) Hero_s CntxtS CntxtP CntxtJ CntxtW CntxtN
## Hero_s -0.263
## ContextS -0.626 0.003
## ContextP -0.688 0.391 0.516
## ContextJ -0.694 0.308 0.541 0.647
## ContextW -0.682 0.398 0.509 0.633 0.629
## ContextN -0.593 0.121 0.494 0.494 0.451 0.498
## Att_scaled -0.108 -0.634 0.242 0.027 0.259 -0.010 -0.019
## We fitted a linear mixed model (estimated using REML and nloptwrap optimizer)
## to predict Mean with Hero_s, Context and Att_scaled (formula: Mean ~ Hero_s +
## Context + Att_scaled). The model included Part as random effect (formula: ~1 |
## Part). The model's total explanatory power is substantial (conditional R2 =
## 0.45) and the part related to the fixed effects alone (marginal R2) is of 0.24.
## The model's intercept, corresponding to Hero_s = 0, Context = F and Att_scaled
## = 0, is at 3.67 (95% CI [3.46, 3.88], t(1790) = 34.38, p < .001). Within this
## model:
##
## - The effect of Hero s is statistically significant and positive (beta = 0.26,
## 95% CI [0.13, 0.40], t(1790) = 3.81, p < .001; Std. beta = 0.14, 95% CI [0.07,
## 0.21])
## - The effect of Context [S] is statistically significant and positive (beta =
## 1.35, 95% CI [1.11, 1.59], t(1790) = 11.14, p < .001; Std. beta = 0.71, 95% CI
## [0.58, 0.83])
## - The effect of Context [P] is statistically significant and positive (beta =
## 0.84, 95% CI [0.57, 1.10], t(1790) = 6.16, p < .001; Std. beta = 0.44, 95% CI
## [0.30, 0.58])
## - The effect of Context [J] is statistically significant and negative (beta =
## -0.75, 95% CI [-1.06, -0.45], t(1790) = -4.90, p < .001; Std. beta = -0.40, 95%
## CI [-0.55, -0.24])
## - The effect of Context [W] is statistically significant and positive (beta =
## 1.32, 95% CI [1.05, 1.58], t(1790) = 9.85, p < .001; Std. beta = 0.69, 95% CI
## [0.55, 0.83])
## - The effect of Context [N] is statistically non-significant and positive (beta
## = 0.04, 95% CI [-0.19, 0.27], t(1790) = 0.33, p = 0.745; Std. beta = 0.02, 95%
## CI [-0.10, 0.14])
## - The effect of Att scaled is statistically significant and positive (beta =
## 0.25, 95% CI [0.13, 0.37], t(1790) = 4.08, p < .001; Std. beta = 0.13, 95% CI
## [0.07, 0.20])
##
## 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.
summary(m<-lmer(Mean ~ Villain_scaled + Context + Att_scaled + (1 | Part), data = Spec_df))
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: Mean ~ Villain_scaled + Context + Att_scaled + (1 | Part)
## Data: Spec_df
##
## REML criterion at convergence: 6734.3
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.05479 -0.67228 0.03718 0.67850 2.76245
##
## Random effects:
## Groups Name Variance Std.Dev.
## Part (Intercept) 0.7784 0.8823
## Residual 1.9989 1.4138
## Number of obs: 1800, groups: Part, 300
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 3.77160 0.10351 1407.30539 36.437 < 2e-16 ***
## Villain_scaled -0.03766 0.05593 1782.94506 -0.673 0.501
## ContextS 1.35918 0.12235 1528.60118 11.109 < 2e-16 ***
## ContextP 0.62844 0.12547 1549.45609 5.009 6.10e-07 ***
## ContextJ -0.91393 0.15062 1621.04335 -6.068 1.61e-09 ***
## ContextW 1.09762 0.12488 1557.63257 8.790 < 2e-16 ***
## ContextN -0.01536 0.11577 1494.63972 -0.133 0.894
## Att_scaled 0.37941 0.05690 1791.51302 6.668 3.45e-11 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) Vlln_s CntxtS CntxtP CntxtJ CntxtW CntxtN
## Villan_scld 0.027
## ContextS -0.644 -0.107
## ContextP -0.653 0.064 0.548
## ContextJ -0.655 -0.222 0.574 0.571
## ContextW -0.634 0.180 0.522 0.567 0.517
## ContextN -0.584 -0.009 0.495 0.487 0.429 0.485
## Att_scaled -0.294 0.543 0.206 0.359 0.386 0.380 0.058
## We fitted a linear mixed model (estimated using REML and nloptwrap optimizer)
## to predict Mean with Villain_scaled, Context and Att_scaled (formula: Mean ~
## Villain_scaled + Context + Att_scaled). The model included Part as random
## effect (formula: ~1 | Part). The model's total explanatory power is substantial
## (conditional R2 = 0.45) and the part related to the fixed effects alone
## (marginal R2) is of 0.24. The model's intercept, corresponding to
## Villain_scaled = 0, Context = F and Att_scaled = 0, is at 3.77 (95% CI [3.57,
## 3.97], t(1790) = 36.44, p < .001). Within this model:
##
## - The effect of Villain scaled is statistically non-significant and negative
## (beta = -0.04, 95% CI [-0.15, 0.07], t(1790) = -0.67, p = 0.501; Std. beta =
## -0.02, 95% CI [-0.08, 0.04])
## - The effect of Context [S] is statistically significant and positive (beta =
## 1.36, 95% CI [1.12, 1.60], t(1790) = 11.11, p < .001; Std. beta = 0.71, 95% CI
## [0.59, 0.84])
## - The effect of Context [P] is statistically significant and positive (beta =
## 0.63, 95% CI [0.38, 0.87], t(1790) = 5.01, p < .001; Std. beta = 0.33, 95% CI
## [0.20, 0.46])
## - The effect of Context [J] is statistically significant and negative (beta =
## -0.91, 95% CI [-1.21, -0.62], t(1790) = -6.07, p < .001; Std. beta = -0.48, 95%
## CI [-0.63, -0.32])
## - The effect of Context [W] is statistically significant and positive (beta =
## 1.10, 95% CI [0.85, 1.34], t(1790) = 8.79, p < .001; Std. beta = 0.58, 95% CI
## [0.45, 0.70])
## - The effect of Context [N] is statistically non-significant and negative (beta
## = -0.02, 95% CI [-0.24, 0.21], t(1790) = -0.13, p = 0.894; Std. beta =
## -8.06e-03, 95% CI [-0.13, 0.11])
## - The effect of Att scaled is statistically significant and positive (beta =
## 0.38, 95% CI [0.27, 0.49], t(1790) = 6.67, p < .001; Std. beta = 0.20, 95% CI
## [0.14, 0.26])
##
## 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.
Controlling for attitude reduced all main effects - but it only
nullified the correlation between villain perception and
context-dependent ARV.
Job decomposition with attitude as a covarite
paste0("CONTEXT INDEPENDENT analysis")
paste0("Hero analysis")
paste0("Firefighter analysis")
FireRole<- subset(Gen_df, Gen_df$Context == "F")
#mod <-lmer(Heroes ~ Risk_dummy * Motiv_dummy + (1|ResponseId), data = df_Roles)
FireRole$Hero_s <- scale(FireRole$Hero_s)
summary(FireMod<-lm(Mean ~ Hero_s + Att_scaled, data = FireRole))
FfMod_typeIII <- car::Anova(FireMod, type = "III")
eta_squared(FfMod_typeIII, partial = TRUE)
paste0("Nurses analysis")
HCrole<- subset(Gen_df, Gen_df$Context == "N")
HCrole$Hero_s <- scale(HCrole$Hero_s)
summary(HCMod<-lm(Mean ~ Hero_s + Att_scaled, data = HCrole))
HCMod_typeIII <- car::Anova(HCMod, type = "III")
eta_squared(HCMod_typeIII, partial = TRUE)
paste0("Soldier analysis")
MilitaryRole<- subset(Gen_df, Gen_df$Context == "S")
MilitaryRole$Hero_s <- scale(MilitaryRole$Hero_s)
summary(MilitaryMod<-lm(Mean ~ Hero_s + Att_scaled, data = MilitaryRole))
HCMil_typeIII <- car::Anova(MilitaryMod, type = "III")
eta_squared(HCMil_typeIII, partial = TRUE)
paste0("Journalists analysis")
JourRole<- subset(Gen_df, Gen_df$Context == "J")
summary(JourMod<-lm(Mean ~ Hero_s + Att_scaled, data = JourRole))
JourtypeIII <- car::Anova(JourMod, type = "III")
eta_squared(JourtypeIII, partial = TRUE)
paste0("Psy analysis")
PsyRole<- subset(Gen_df, Gen_df$Context == "P")
summary(PsyMod<-lm(Mean ~ Hero_s + Att_scaled, data = PsyRole))
PsyTypeIII <- car::Anova(PsyMod, type = "III")
eta_squared(PsyTypeIII, partial = TRUE)
paste0("Welders analysis")
WeldRole<- subset(Gen_df, Gen_df$Context == "W")
summary(WeldMod<-lm(Mean ~ Hero_s + Att_scaled, data = WeldRole))
WeldTypeIII <- car::Anova(WeldMod, type = "III")
eta_squared(WeldTypeIII, partial = TRUE)
paste0("CONTEXT INDEPENDENT analysis")
paste0("VILLAINS analysis")
paste0("Firefighter analysis")
FireRole<- subset(Gen_df, Gen_df$Context == "F")
#mod <-lmer(Heroes ~ Risk_dummy * Motiv_dummy + (1|ResponseId), data = df_Roles)
FireRole$Villain_scaled <- scale(FireRole$Villain_scaled)
summary(FireMod<-lm(Mean ~ Villain_scaled + Att_scaled, data = FireRole))
FfMod_typeIII <- car::Anova(FireMod, type = "III")
eta_squared(FfMod_typeIII, partial = TRUE)
paste0("Nurses analysis")
HCrole<- subset(Gen_df, Gen_df$Context == "N")
HCrole$Villain_scaled <- scale(HCrole$Villain_scaled)
summary(HCMod<-lm(Mean ~ Villain_scaled + Att_scaled, data = HCrole))
HCMod_typeIII <- car::Anova(HCMod, type = "III")
eta_squared(HCMod_typeIII, partial = TRUE)
paste0("Soldier analysis")
MilitaryRole<- subset(Gen_df, Gen_df$Context == "S")
MilitaryRole$Villain_scaled <- scale(MilitaryRole$Villain_scaled)
summary(MilitaryMod<-lm(Mean ~ Villain_scaled + Att_scaled, data = MilitaryRole))
HCMil_typeIII <- car::Anova(MilitaryMod, type = "III")
eta_squared(HCMil_typeIII, partial = TRUE)
paste0("Journalists analysis")
JourRole<- subset(Gen_df, Gen_df$Context == "J")
JourRole$Villain_scaled <- scale(JourRole$Villain_scaled)
summary(JourMod<-lm(Mean ~ Villain_scaled + Att_scaled, data = JourRole))
JourtypeIII <- car::Anova(JourMod, type = "III")
eta_squared(JourtypeIII, partial = TRUE)
paste0("Psy analysis")
PsyRole<- subset(Gen_df, Gen_df$Context == "P")
PsyRole$Villain_scaled <- scale(PsyRole$Villain_scaled)
summary(PsyMod<-lm(Mean ~ Villain_scaled + Att_scaled, data = PsyRole))
PsyTypeIII <- car::Anova(PsyMod, type = "III")
eta_squared(PsyTypeIII, partial = TRUE)
paste0("Welders analysis")
WeldRole<- subset(Gen_df, Gen_df$Context == "W")
WeldRole$Villain_scaled <- scale(WeldRole$Villain_scaled)
summary(WeldMod<-lm(Mean ~ Villain_scaled + Att_scaled, data = WeldRole))
WeldTypeIII <- car::Anova(WeldMod, type = "III")
eta_squared(WeldTypeIII, partial = TRUE)
paste0("DILEMMAS analysis")
paste0("Hero analysis")
Gen_df <- subset(long_df, long_df$Measure == "Mean_Gen")
paste0("Firefighter analysis")
FireRole<- subset(Gen_df, Gen_df$Context == "F")
#mod <-lmer(Heroes ~ Risk_dummy * Motiv_dummy + (1|ResponseId), data = df_Roles)
FireRole$Hero_s <- scale(FireRole$Hero)
FireRole$Att_scaled <- scale(FireRole$Att)
summary(FireMod<-lm(Mean ~ Hero_s + Att_scaled, data = FireRole))
FfMod_typeIII <- car::Anova(FireMod, type = "III")
eta_squared(FfMod_typeIII, partial = TRUE)
paste0("Nurses analysis")
HCrole<- subset(Gen_df, Gen_df$Context == "N")
HCrole$Hero_s <- scale(HCrole$Hero)
HCrole$Att_scaled <- scale(HCrole$Att)
summary(HCMod<-lm(Mean ~ Hero_s + Att_scaled, data = HCrole))
HCMod_typeIII <- car::Anova(HCMod, type = "III")
eta_squared(HCMod_typeIII, partial = TRUE)
paste0("Soldier analysis")
MilitaryRole<- subset(Gen_df, Gen_df$Context == "S")
MilitaryRole$Hero_s <- scale(MilitaryRole$Hero)
MilitaryRole$Att_scaled <- scale(MilitaryRole$Att)
summary(MilitaryMod<-lm(Mean ~ Hero_s + Att_scaled, data = MilitaryRole))
HCMil_typeIII <- car::Anova(MilitaryMod, type = "III")
eta_squared(HCMil_typeIII, partial = TRUE)
paste0("Journalists analysis")
JourRole<- subset(Gen_df, Gen_df$Context == "J")
JourRole$Hero_s <- scale(JourRole$Hero)
JourRole$Att_scaled <- scale(JourRole$Att)
summary(JourMod<-lm(Mean ~ Hero_s + Att_scaled, data = JourRole))
JourtypeIII <- car::Anova(JourMod, type = "III")
eta_squared(JourtypeIII, partial = TRUE)
paste0("Psy analysis")
PsyRole<- subset(Gen_df, Gen_df$Context == "P")
PsyRole$Hero_s <- scale(PsyRole$Hero)
PsyRole$Att_scaled <- scale(PsyRole$Att)
summary(PsyMod<-lm(Mean ~ Hero_s + Att_scaled, data = PsyRole))
PsyTypeIII <- car::Anova(PsyMod, type = "III")
eta_squared(PsyTypeIII, partial = TRUE)
paste0("Welders analysis")
WeldRole<- subset(Gen_df, Gen_df$Context == "W")
WeldRole$Hero_s <- scale(WeldRole$Hero)
WeldRole$Att_scaled <- scale(WeldRole$Att)
summary(WeldMod<-lm(Mean ~ Hero_s + Att_scaled, data = WeldRole))
WeldTypeIII <- car::Anova(WeldMod, type = "III")
eta_squared(WeldTypeIII, partial = TRUE)
paste0("DILEMMAS analysis")
paste0("Villain analysis")
paste0("Firefighter analysis")
FireRole<- subset(Gen_df, Gen_df$Context == "F")
#mod <-lmer(Heroes ~ Risk_dummy * Motiv_dummy + (1|ResponseId), data = df_Roles)
FireRole$Villain_scaled <- scale(FireRole$Vill)
FireRole$Att_scaled <- scale(FireRole$Att)
summary(FireMod<-lm(Mean ~ Villain_scaled + Att_scaled, data = FireRole))
FfMod_typeIII <- car::Anova(FireMod, type = "III")
eta_squared(FfMod_typeIII, partial = TRUE)
paste0("Nurses analysis")
HCrole<- subset(Gen_df, Gen_df$Context == "N")
HCrole$Villain_scaled <- scale(HCrole$Vill)
HCrole$Att_scaled <- scale(HCrole$Att)
summary(HCMod<-lm(Mean ~ Villain_scaled + Att_scaled, data = HCrole))
HCMod_typeIII <- car::Anova(HCMod, type = "III")
eta_squared(HCMod_typeIII, partial = TRUE)
paste0("Soldier analysis")
MilitaryRole<- subset(Gen_df, Gen_df$Context == "S")
MilitaryRole$Villain_scaled <- scale(MilitaryRole$Vill)
MilitaryRole$Att_scaled <- scale(MilitaryRole$Att)
summary(MilitaryMod<-lm(Mean ~ Villain_scaled + Att_scaled, data = MilitaryRole))
HCMil_typeIII <- car::Anova(MilitaryMod, type = "III")
eta_squared(HCMil_typeIII, partial = TRUE)
paste0("Journalists analysis")
JourRole<- subset(Gen_df, Gen_df$Context == "J")
JourRole$Villain_scaled <- scale(JourRole$Vill)
JourRole$Att_scaled <- scale(JourRole$Att)
summary(JourMod<-lm(Mean ~ Villain_scaled + Att_scaled, data = JourRole))
JourtypeIII <- car::Anova(JourMod, type = "III")
eta_squared(JourtypeIII, partial = TRUE)
paste0("Psy analysis")
PsyRole<- subset(Gen_df, Gen_df$Context == "P")
PsyRole$Villain_scaled <- scale(PsyRole$Vill)
PsyRole$Att_scaled <- scale(PsyRole$Att)
summary(PsyMod<-lm(Mean ~ Villain_scaled + Att_scaled, data = PsyRole))
PsyTypeIII <- car::Anova(PsyMod, type = "III")
eta_squared(PsyTypeIII, partial = TRUE)
paste0("Welders analysis")
WeldRole<- subset(Gen_df, Gen_df$Context == "W")
WeldRole$Villain_scaled <- scale(WeldRole$Vill)
WeldRole$Att_scaled <- scale(WeldRole$Att)
summary(WeldMod<-lm(Mean ~ Villain_scaled + Att_scaled, data = WeldRole))
WeldTypeIII <- car::Anova(WeldMod, type = "III")
eta_squared(WeldTypeIII, partial = TRUE)
results_tbl <- map_dfr(contexts, function(ctx) {
df_ctx <- Gen_df %>%
filter(Context == ctx) %>%
select(Mean, Hero) %>%
tidyr::drop_na(Mean, Hero) %>%
mutate(Hero_s = as.numeric(scale(Hero)))
# Linear model
mod <- lm(Mean ~ Hero_s, data = df_ctx)
# Coef table (grab the slope for Hero_s_z)
coef_row <- tidy(mod) %>%
filter(term == "Hero_s") %>%
transmute(
Context = ctx,
Beta = estimate,
t = statistic,
p = p.value
)
# Type III ANOVA + partial eta^2
a3 <- car::Anova(mod, type = "III")
et <- effectsize::eta_squared(a3, partial = TRUE) %>%
as.data.frame()
# Pull partial eta^2 for the Hero_s_z effect
pe2 <- et %>%
dplyr::filter(Parameter == "Hero_s") %>%
dplyr::pull(Eta2)
coef_row %>%
mutate(partial_eta2 = pe2)
})
# Present a clean HTML table
results_tbl %>%
mutate(
Beta = round(Beta, 3),
t = round(t, 3),
p = fmt_p(p),
partial_eta2 = round(partial_eta2, 3)
) %>%
gt() %>%
tab_header(
title = md("**Effect of Hero perception on Context independent ARV within each occupation**")
) %>%
cols_label(
Context = "Context",
Beta = "β (slope)",
t = "t",
p = "p",
partial_eta2 = "partial η² (Type III)"
) %>%
fmt_missing(everything(), missing_text = "—") %>%
tab_options(table.font.size = px(14))
| Effect of Hero perception on Context independent ARV within each occupation |
| Context |
β (slope) |
t |
p |
partial η² (Type III) |
| F |
0.315 |
3.460 |
< .001 |
0.039 |
| S |
0.673 |
7.552 |
< .001 |
0.161 |
| P |
0.268 |
3.072 |
0.002 |
0.031 |
| J |
0.710 |
8.015 |
< .001 |
0.177 |
| W |
0.240 |
2.831 |
0.005 |
0.026 |
| N |
0.185 |
1.995 |
0.047 |
0.013 |
results_tbl <- map_dfr(contexts, function(ctx) {
df_ctx <- Gen_df %>%
filter(Context == ctx) %>%
select(Mean, Villain_scaled) %>%
tidyr::drop_na(Mean, Villain_scaled) %>%
mutate(Villain_scaled = as.numeric(scale(Villain_scaled)))
# Linear model
mod <- lm(Mean ~ Villain_scaled, data = df_ctx)
# Coef table (grab the slope for Hero_s_z)
coef_row <- tidy(mod) %>%
filter(term == "Villain_scaled") %>%
transmute(
Context = ctx,
Beta = estimate,
t = statistic,
p = p.value
)
# Type III ANOVA + partial eta^2
a3 <- car::Anova(mod, type = "III")
et <- effectsize::eta_squared(a3, partial = TRUE) %>%
as.data.frame()
# Pull partial eta^2 for the Hero_s_z effect
pe2 <- et %>%
dplyr::filter(Parameter == "Villain_scaled") %>%
dplyr::pull(Eta2)
coef_row %>%
mutate(partial_eta2 = pe2)
})
# Present a clean HTML table
results_tbl %>%
mutate(
Beta = round(Beta, 3),
t = round(t, 3),
p = fmt_p(p),
partial_eta2 = round(partial_eta2, 3)
) %>%
gt() %>%
tab_header(
title = md("**Effect of Villain perception on Context independent ARV within each occupation**")
) %>%
cols_label(
Context = "Context",
Beta = "β (slope)",
t = "t",
p = "p",
partial_eta2 = "partial η² (Type III)"
) %>%
fmt_missing(everything(), missing_text = "—") %>%
tab_options(table.font.size = px(14))
| Effect of Villain perception on Context independent ARV within each occupation |
| Context |
β (slope) |
t |
p |
partial η² (Type III) |
| F |
0.019 |
0.206 |
0.837 |
0.000 |
| S |
-0.348 |
-3.663 |
< .001 |
0.043 |
| P |
-0.051 |
-0.570 |
0.569 |
0.001 |
| J |
-0.424 |
-4.481 |
< .001 |
0.063 |
| W |
0.071 |
0.830 |
0.407 |
0.002 |
| N |
0.126 |
1.357 |
0.176 |
0.006 |
results_tbl <- map_dfr(contexts, function(ctx) {
df_ctx <- Spec_df %>%
filter(Context == ctx) %>%
select(Mean, Hero) %>%
tidyr::drop_na(Mean, Hero) %>%
mutate(Hero_s = as.numeric(scale(Hero)))
# Linear model
mod <- lm(Mean ~ Hero_s, data = df_ctx)
# Coef table (grab the slope for Hero_s_z)
coef_row <- tidy(mod) %>%
filter(term == "Hero_s") %>%
transmute(
Context = ctx,
Beta = estimate,
t = statistic,
p = p.value
)
# Type III ANOVA + partial eta^2
a3 <- car::Anova(mod, type = "III")
et <- effectsize::eta_squared(a3, partial = TRUE) %>%
as.data.frame()
# Pull partial eta^2 for the Hero_s_z effect
pe2 <- et %>%
dplyr::filter(Parameter == "Hero_s") %>%
dplyr::pull(Eta2)
coef_row %>%
mutate(partial_eta2 = pe2)
})
# Present a clean HTML table
results_tbl %>%
mutate(
Beta = round(Beta, 3),
t = round(t, 3),
p = fmt_p(p),
partial_eta2 = round(partial_eta2, 3)
) %>%
gt() %>%
tab_header(
title = md("**Effect of Hero perception on Context dependent ARV (dilemmas) within each occupation**")
) %>%
cols_label(
Context = "Context",
Beta = "β (slope)",
t = "t",
p = "p",
partial_eta2 = "partial η² (Type III)"
) %>%
fmt_missing(everything(), missing_text = "—") %>%
tab_options(table.font.size = px(14))
| Effect of Hero perception on Context dependent ARV (dilemmas) within each occupation |
| Context |
β (slope) |
t |
p |
partial η² (Type III) |
| F |
0.209 |
2.116 |
0.035 |
0.015 |
| S |
0.540 |
6.042 |
< .001 |
0.109 |
| P |
0.288 |
2.840 |
0.005 |
0.026 |
| J |
0.473 |
5.792 |
< .001 |
0.101 |
| W |
0.350 |
3.793 |
< .001 |
0.046 |
| N |
0.185 |
1.678 |
0.094 |
0.009 |
results_tbl <- map_dfr(contexts, function(ctx) {
df_ctx <- Spec_df %>%
filter(Context == ctx) %>%
select(Mean, Villain_scaled) %>%
tidyr::drop_na(Mean, Villain_scaled) %>%
mutate(Villain_scaled = as.numeric(scale(Villain_scaled)))
# Linear model
mod <- lm(Mean ~ Villain_scaled, data = df_ctx)
# Coef table (grab the slope for Hero_s_z)
coef_row <- tidy(mod) %>%
filter(term == "Villain_scaled") %>%
transmute(
Context = ctx,
Beta = estimate,
t = statistic,
p = p.value
)
# Type III ANOVA + partial eta^2
a3 <- car::Anova(mod, type = "III")
et <- effectsize::eta_squared(a3, partial = TRUE) %>%
as.data.frame()
# Pull partial eta^2 for the Hero_s_z effect
pe2 <- et %>%
dplyr::filter(Parameter == "Villain_scaled") %>%
dplyr::pull(Eta2)
coef_row %>%
mutate(partial_eta2 = pe2)
})
# Present a clean HTML table
results_tbl %>%
mutate(
Beta = round(Beta, 3),
t = round(t, 3),
p = fmt_p(p),
partial_eta2 = round(partial_eta2, 3)
) %>%
gt() %>%
tab_header(
title = md("**Effect of Villain perception on Context dependent ARV (dilemmas) within each occupation**")
) %>%
cols_label(
Context = "Context",
Beta = "β (slope)",
t = "t",
p = "p",
partial_eta2 = "partial η² (Type III)"
) %>%
fmt_missing(everything(), missing_text = "—") %>%
tab_options(table.font.size = px(14))
| Effect of Villain perception on Context dependent ARV (dilemmas) within each occupation |
| Context |
β (slope) |
t |
p |
partial η² (Type III) |
| F |
-0.048 |
-0.487 |
0.627 |
0.001 |
| S |
-0.439 |
-4.818 |
< .001 |
0.072 |
| P |
-0.193 |
-1.883 |
0.061 |
0.012 |
| J |
-0.145 |
-1.690 |
0.092 |
0.009 |
| W |
-0.017 |
-0.179 |
0.858 |
0.000 |
| N |
0.108 |
0.979 |
0.328 |
0.003 |
Further not-registered analyses:
Any question can be addressed to Jean Monéger (My contact can be
easily found using Google).