data(selectiontask)
## Inference-guessing model with relaxed assumptions
s <- mptspec("WST", .replicates = 2)
m1 <- mpt(s, data = WSTKlauer2007$exp1, method = "EM")
## Inference-guessing model
m2 <- mpt(update(s, .restr = list(sf1=s1, sb1=s1, sfb1=s1,
sf2=s2, sb2=s2, sfb2=s2)),
data = m1$y, method = "EM")
## Effect of hint on i parameter (Exp. 1)
m3 <- mpt(update(m2$spec, .restr = list(i2=i1)), data = m1$y,
method = "EM")
## Independence model
m4 <- mpt(update(m2$spec,
.restr = list(a1=0, c1=0, x1=0, d1=0, s1=0, i1=0,
a2=0, c2=0, x2=0, d2=0, s2=0, i2=0)),
data = m1$y, method = "EM")
anova(m4, m3, m2, m1)
plogis(confint(m2))
AIC(m2)
BIC(m2) # BIC w/number of non-redundant response categories
AIC(m2, k = log(sum(m2$y))) # BIC w/total number of data points
## Effect of hint on c parameter (Exp. 2)
m5 <- mpt(m2$spec, data = WSTKlauer2007$exp2, method = "EM")
m6 <- mpt(update(m5$spec, .restr = list(c2=c1)), data = m5$y,
method = "EM")
anova(m6, m5)
## Replication of Exp. 1
wst.agg <- aggregate(y ~ group, WSTreplication,
subset = status == "select", sum)
y <- as.vector(t(wst.agg[, -1]))
set.seed(1503)
m7 <- mpt(m2$spec, data = y, start = runif(20), method = "EM")
idx <- c("P", "p", "Q", "q", "a", "c", "x", "d", "s", "i")
par(mfrow = 1:2)
dotchart(coef(m2)[paste0(idx, 1)], xlim = 0:1, labels = idx,
main = "Klauer et al. (2007, Exp. 1)", xlab = "")
points(coef(m2)[paste0(idx, 2)], 1:10, pch = 16)
legend(0, 11, c("standard", "hints"), pch = c(1, 16),
title = "Instruction", bty = "n")
dotchart(coef(m7)[paste0(idx, 1)], xlim = 0:1, labels = idx,
main = "Replication study", xlab = "")
points(coef(m7)[paste0(idx, 2)], 1:10, pch = 16)
mtext("Parameter estimate (inference-guessing model)", side = 1,
outer = TRUE, line = -2)
Run the code above in your browser using DataLab