data(moraldilemma)
## Exp. 1: proCNI and process dissociation (PD) model
s <- mptspec("proCNI")
exp1 <- subset(MDHennig2020, selfrel == "absent")
mpt(update(s, .restr = list(J=I)), data = exp1, freqvar = "exp1")
mpt(update(s, .restr = list(I=0, J=1)), data = exp1, freqvar = "exp1")
## Exp. 2b: self-relevant consequences and norm endorsement
s <- mptspec("proCNI", .replicates = 2, .restr = list(J1=I1, J2=I2))
m1 <- mpt(s, data = MDHennig2020, freqvar = "exp2b")
m2 <- mpt(update(m1$spec, .restr = list(N1=N2)), data = m1$y)
anova(m2, m1)
## Replication of Exp. 2b
md.agg <- aggregate(y ~ selfrel, MDreplication, sum)
y <- as.vector(t(md.agg[, -1]))
m3 <- mpt(s, data = y)
m4 <- mpt(update(s, .restr = list(N1=N2)), data = y)
anova(m4, m3)
coefs <- c(diff(coef(m3)[c("N2", "N1")]),
diff(coef(m1)[c("N2", "N1")]))
names(coefs) <- c("Replication", "Hennig & Huetter\n(2020, Exp. 2b)")
ci <- coefs + rbind(
qnorm(c(.025, .975))*sqrt(sum(diag(vcov(m3))[c("N2", "N1")])),
qnorm(c(.025, .975))*sqrt(sum(diag(vcov(m1))[c("N2", "N1")]))
)
dotchart(coefs, pch = 16, xlim = c(-.2, 1),
xlab = expression(N[absent] - N[present]~"(proCNI model, 95% CI)"),
main = paste("Self-relevant consequences and norm endorsement",
"in moral dilemma judgment", sep = "\n"))
abline(v = 0, col = "gray")
arrows(ci[, 1], 1:2, ci[, 2], 1:2, .05, 90, 3)
Run the code above in your browser using DataLab