## Prospective memory model: identifiability
qr(mptspec("prospec",
.restr = list(M1=M, M2=M))$par2deriv(runif(6))$deriv)$rank
qr(mptspec("prospec",
.restr = list(M1=M, M2=M, g=.1, c=.5))$par2deriv(runif(4))$deriv)$rank
## Prospective memory model: goodness of fit
data(prospecMemory)
cmi <- PMSmithBayen[PMSmithBayen$instruction == "cmi", ]
m2 <- mpt(mptspec("prospec", .restr = list(M1=M, M2=M, g=.1, c=.5)), cmi)
m1 <- mpt(update(m2$spec, .restr = list(C2=C1)), cmi)
anova(m1, m2)
pmi <- PMSmithBayen[PMSmithBayen$instruction == "pmi", ]
anova(mpt(m1$spec, pmi), mpt(m2$spec, pmi))
## Testing P_cmi = P_pmi and M_cmi = M_pmi
## Smith and Bayen
m2 <- mpt(mptspec("prospec", .replicates = 2,
.restr = list(M11=M1, M21=M1, g1=.1, c1=.5,
M12=M2, M22=M2, g2=.1, c2=.5)),
data = PMSmithBayen)
m1 <- mpt(update(m2$spec, .restr = list(P2=P1)), PMSmithBayen)
m0 <- mpt(update(m2$spec, .restr = list(M2=M1)), PMSmithBayen)
anova(m1, m2)
anova(m0, m2)
## Replication
pm.agg <- aggregate(y ~ instr, PMreplication, sum)
y <- as.vector(t(pm.agg[2:1, -1]))
m3 <- mpt(m2$spec, y)
m1 <- mpt(update(m3$spec, .restr = list(P2=P1)), y)
m0 <- mpt(update(m3$spec, .restr = list(M2=M1)), y)
anova(m1, m3)
anova(m0, m3)
par(mfrow = 1:2)
dotchart(coef(m2)[c("C12", "C22", "P2", "M2")], xlim=0:1, xlab="",
labels=c("C1", "C2", "P", "M"), main="Smith and Bayen (2004, Exp. 1)")
points(coef(m2)[c("C11", "C21", "P1", "M1")], 1:4, pch=16)
legend("bottomleft", c("CMI", "PMI"), pch=c(1, 16), title="Instruction",
title.adj=1, bty="n")
dotchart(coef(m3)[c("C12", "C22", "P2", "M2")], xlim=0:1, xlab="",
labels=c("C1", "C2", "P", "M"), main="Replication study")
points(coef(m3)[c("C11", "C21", "P1", "M1")], 1:4, pch=16)
mtext("Parameter estimate (prospective memory model)", side=1,
line=-2, outer=TRUE)
Run the code above in your browser using DataLab