psychotools/0000755000176200001440000000000014124606443012644 5ustar liggesuserspsychotools/NAMESPACE0000644000176200001440000002050513726535503014072 0ustar liggesusers## imported packages (with generics etc.) import( "stats", "graphics" ) importFrom("grDevices", "extendrange", "gray.colors", "hcl", "col2rgb", "rgb" ) importFrom("utils", "getParseData", "head", "tail" ) ## C code useDynLib("psychotools", "esf") export( ## itemresp/paircomp classes and new generics "itemresp", "is.itemresp", "paircomp", "covariates", "covariates<-", "labels<-", "mscale", "mscale<-", "itempar", "threshpar", "discrpar", "personpar", "guesspar", "upperpar", ## psychometric model fitters "raschmodel", "rsmodel", "pcmodel", "gpcmodel", "plmodel", "btmodel", "mptmodel", ## wrapper to model fitters "RaschModel.fit", "RSModel.fit", "PCModel.fit", "btReg.fit", ## anchor methods "anchor", "anchortest", ## tools "elementary_symmetric_functions", "mptspec", ## estfun methods "estfun.btmodel", "estfun.raschmodel", "estfun.rsmodel", "estfun.pcmodel", "estfun.gpcmodel", "estfun.plmodel", "estfun.mptmodel", ## bread methods "bread.raschmodel", "bread.rsmodel", "bread.pcmodel", "bread.gpcmodel", "bread.plmodel", ## graphical functions "curveplot", "infoplot", "piplot", "profileplot", "regionplot", ## auxiliary generics "worth", ## simulate functions "rrm", "rrsm", "rpcm", "rpl", "rgpcm" ) ## methods for itemresp objects S3method("[", "itemresp") S3method("as.character", "itemresp") S3method("as.data.frame", "itemresp") S3method("as.double", "itemresp") S3method("as.integer", "itemresp") S3method("as.list", "itemresp") S3method("as.matrix", "itemresp") S3method("c", "itemresp") S3method("format", "itemresp") S3method("is.na", "itemresp") S3method("labels", "itemresp") S3method("labels<-", "itemresp") S3method("length", "itemresp") S3method("levels", "itemresp") S3method("merge", "itemresp") S3method("mscale", "itemresp") S3method("mscale<-", "itemresp") S3method("names", "itemresp") S3method("names<-", "itemresp") S3method("plot", "itemresp") S3method("print", "itemresp") S3method("rep", "itemresp") S3method("str", "itemresp") S3method("subset", "itemresp") S3method("summary", "itemresp") S3method("xtfrm", "itemresp") ## methods for paircomp objects S3method("[", "paircomp") S3method("as.character", "paircomp") S3method("as.data.frame", "paircomp") S3method("as.double", "paircomp") S3method("as.integer", "paircomp") S3method("as.matrix", "paircomp") S3method("c", "paircomp") S3method("covariates", "paircomp") S3method("covariates<-", "paircomp") S3method("format", "paircomp") S3method("is.na", "paircomp") S3method("labels", "paircomp") S3method("labels<-", "paircomp") S3method("length", "paircomp") S3method("mscale", "paircomp") S3method("mscale<-", "paircomp") S3method("names", "paircomp") S3method("names<-", "paircomp") S3method("plot", "paircomp") S3method("print", "paircomp") S3method("reorder", "paircomp") S3method("rep", "paircomp") S3method("str", "paircomp") S3method("subset", "paircomp") S3method("summary", "paircomp") S3method("xtfrm", "paircomp") ## methods for raschmodel objects S3method("coef", "raschmodel") S3method("discrpar", "raschmodel") S3method("guesspar", "raschmodel") S3method("itempar", "raschmodel") S3method("logLik", "raschmodel") S3method("nobs", "raschmodel") S3method("personpar", "raschmodel") S3method("plot", "raschmodel") S3method("predict", "raschmodel") S3method("print", "raschmodel") S3method("print", "summary.raschmodel") S3method("summary", "raschmodel") S3method("threshpar", "raschmodel") S3method("upperpar", "raschmodel") S3method("vcov", "raschmodel") S3method("weights", "raschmodel") S3method("worth", "raschmodel") ## methods for rsmodel objects S3method("coef", "rsmodel") S3method("discrpar", "rsmodel") S3method("guesspar", "rsmodel") S3method("itempar", "rsmodel") S3method("logLik", "rsmodel") S3method("nobs", "rsmodel") S3method("personpar", "rsmodel") S3method("plot", "rsmodel") S3method("predict", "rsmodel") S3method("print", "rsmodel") S3method("print", "summary.rsmodel") S3method("summary", "rsmodel") S3method("threshpar", "rsmodel") S3method("upperpar", "rsmodel") S3method("vcov", "rsmodel") S3method("weights", "rsmodel") ## methods for pcmodel objects S3method("coef", "pcmodel") S3method("discrpar", "pcmodel") S3method("guesspar", "pcmodel") S3method("itempar", "pcmodel") S3method("logLik", "pcmodel") S3method("nobs", "pcmodel") S3method("personpar", "pcmodel") S3method("plot", "pcmodel") S3method("predict", "pcmodel") S3method("print", "pcmodel") S3method("print", "summary.pcmodel") S3method("summary", "pcmodel") S3method("threshpar", "pcmodel") S3method("upperpar", "pcmodel") S3method("vcov", "pcmodel") S3method("weights", "pcmodel") ## methods for gpcmodel objects S3method("coef", "gpcmodel") S3method("discrpar", "gpcmodel") S3method("guesspar", "gpcmodel") S3method("itempar", "gpcmodel") S3method("logLik", "gpcmodel") S3method("nobs", "gpcmodel") S3method("personpar", "gpcmodel") S3method("plot", "gpcmodel") S3method("predict", "gpcmodel") S3method("print", "gpcmodel") S3method("print", "summary.gpcmodel") S3method("summary", "gpcmodel") S3method("threshpar", "gpcmodel") S3method("upperpar", "gpcmodel") S3method("vcov", "gpcmodel") S3method("weights", "gpcmodel") ## methods for plmodel objects S3method("coef", "plmodel") S3method("confint", "plmodel") S3method("discrpar", "plmodel") S3method("guesspar", "plmodel") S3method("itempar", "plmodel") S3method("logLik", "plmodel") S3method("nobs", "plmodel") S3method("personpar", "plmodel") S3method("plot", "plmodel") S3method("predict", "plmodel") S3method("print", "plmodel") S3method("print", "summary.plmodel") S3method("summary", "plmodel") S3method("threshpar", "plmodel") S3method("upperpar", "plmodel") S3method("vcov", "plmodel") S3method("weights", "plmodel") ## methods for btmodel objects S3method("coef", "btmodel") S3method("deviance", "btmodel") S3method("itempar", "btmodel") S3method("logLik", "btmodel") S3method("nobs", "btmodel") S3method("plot", "btmodel") S3method("print", "btmodel") S3method("print", "summary.btmodel") S3method("summary", "btmodel") S3method("vcov", "btmodel") ## methods for mptmodel objects S3method("coef", "mptmodel") S3method("confint", "mptmodel") S3method("deviance", "mptmodel") S3method("logLik", "mptmodel") S3method("nobs", "mptmodel") S3method("plot", "mptmodel") S3method("predict", "mptmodel") S3method("print", "mptmodel") S3method("print", "summary.mptmodel") S3method("summary", "mptmodel") S3method("vcov", "mptmodel") ## methods for mptspec objects S3method("print", "mptspec") S3method("update", "mptspec") ## methods for discrpar objects S3method("coef", "discrpar") S3method("print", "discrpar") S3method("vcov", "discrpar") ## methods for itempar objects S3method("coef", "itempar") S3method("print", "itempar") #S3method("print", "summary.itempar") #S3method("summary", "itempar") S3method("vcov", "itempar") ## methods for personpar objects S3method("coef", "personpar") S3method("print", "personpar") #S3method("print", "summary.personpar") #S3method("summary", "personpar") S3method("vcov", "personpar") ## methods for threshpar objects S3method("coef", "threshpar") S3method("print", "threshpar") S3method("vcov", "threshpar") ## methods for guesspar objects S3method("coef", "guesspar") S3method("print", "guesspar") S3method("vcov", "guesspar") ## methods for upperpar objects S3method("coef", "upperpar") S3method("print", "upperpar") S3method("vcov", "upperpar") ## methods for anchor objects S3method("anchor", "default") S3method("anchor", "formula") S3method("print", "anchor") S3method("summary", "anchor") S3method("print", "summary.anchor") ## methods for anchortest objects S3method("anchortest", "default") S3method("anchortest", "formula") S3method("print", "anchortest") S3method("summary", "anchortest") S3method("print", "summary.anchortest") S3method("plot", "anchortest") ## conditional registration of strucchange methods if(getRversion() >= "3.6.0") { S3method(sandwich::estfun, "btmodel") S3method(sandwich::estfun, "raschmodel") S3method(sandwich::estfun, "rsmodel") S3method(sandwich::estfun, "pcmodel") S3method(sandwich::estfun, "gpcmodel") S3method(sandwich::estfun, "plmodel") S3method(sandwich::estfun, "mptmodel") S3method(sandwich::bread, "raschmodel") S3method(sandwich::bread, "rsmodel") S3method(sandwich::bread, "pcmodel") S3method(sandwich::bread, "gpcmodel") S3method(sandwich::bread, "plmodel") } psychotools/demo/0000755000176200001440000000000013740351163013567 5ustar liggesuserspsychotools/demo/toolbox2.R0000644000176200001440000000410213740351163015457 0ustar liggesuserslibrary(strucchange) set.seed(2906) data("VerbalAggression", package = "psychotools") refmodel <- plmodel(VerbalAggression$resp2[, 1:6]) dgp <- function(model, N = 1000, G = 1, impact = FALSE, cotype = "random") { mu <- if(impact) rep_len(c(-0.5, 0.5), N) else rep_len(0, N) theta <- rnorm(N, mu, 1) covariate <- switch(as.character(cotype), "random" = rnorm(N, 0, 1), "linear" = theta + rnorm(N, 0, 1), "quadratic" = theta ^ 2 + rnorm(N, 0, 1) ) d <- data.frame(theta = theta, covariate = covariate) if(G > 1) { d$impact <- cut(covariate, labels = 1:G, include.lowest = TRUE, breaks = quantile(covariate, probs = 0:G / G)) } itempar_dif <- itempar(model) itempar_dif[1] <- itempar_dif[1] + sd(itempar_dif) dif_id <- covariate > median(covariate) d$resp <- matrix(NA, N, length(model$items)) d$resp[!dif_id, ] <- rpl(theta[!dif_id], a = discrpar(model), b = itempar(model), g = guesspar(model), u = upperpar(model), return_setting = FALSE) d$resp[dif_id, ] <- rpl(theta[dif_id], a = discrpar(model), b = itempar_dif, g = guesspar(model), u = upperpar(model), return_setting = FALSE) return(d) } hitrate <- function(model, M = 1000, alpha = 0.05, parm = NULL, N = 1000, G = 1, impact = FALSE, cotype = "random") { pval <- replicate(M, { d <- dgp(model, N = N, G = G, impact = impact, cotype = cotype) m <- plmodel(d$resp, type = "2PL", impact = d$impact, maxit = 5000, reltol = 1e-4, vcov = FALSE) sctest(m, order.by = d$covariate, functional = "DM", parm = parm)$p.value }) mean(pval < alpha) } sim <- function(model, M = 1000, alpha = 0.05, parm = NULL, N = 1000, G = c(1, 2, 5, 25), impact = c(FALSE, TRUE), cotype = c("random", "linear", "quadratic")) { d <- expand.grid(G = G, impact = impact, cotype = cotype) d$hitrate <- NA for(i in seq_len(NROW(d))) { d$hitrate[i] <- hitrate(model, M = M, alpha = alpha, parm = parm, N = N, G = d$G[i], impact = d$impact[i], cotype = d$cotype[i]) } return(d) } simulation2 <- sim(refmodel) psychotools/demo/VerbalAggression.R0000644000176200001440000001512613031460133017143 0ustar liggesusers## package library("psychotools") ## data ------------------------------------------------------------------------ ## load data data("VerbalAggression", package = "psychotools") ## new data set with covariates d <- VerbalAggression[, c("gender", "anger")] ## and polytomous item responses d$poly <- itemresp(VerbalAggression$resp[, 13:18], mscale = 0:2, labels = c("Want-Curse", "Do-Curse", "Want-Scold", "Do-Scold", "Want-Shout", "Do-Shout")) ## printing head(d$poly) ## summarizing summary(d$poly) prop.table(summary(d$poly), 1) ## visualization plot(d$poly) ## connection to likert package library("likert") lik <- likert(as.data.frame(as.list(d$poly))) lik plot(lik) ## dichotomized version of item responses d$dich <- d$poly mscale(d$dich) <- c(0, 1, 1) ## compare par(mfrow = c(1, 2)) plot(d$poly) plot(d$dich) par(mfrow = c(1, 1)) ## mention is.na() ## Rasch model ----------------------------------------------------------------- ## model ram <- raschmodel(d$dich) ram summary(ram) ## visualization plot(ram, type = "curves") par(mfrow = c(1, 2)) plot(ram, type = "profile") plot(ram, type = "regions") par(mfrow = c(1, 1)) plot(ram, type = "piplot") plot(ram, type = "information") ## item parameters raip <- itempar(ram) raip confint(raip) ## inference confint(itempar(ram, ref = 1, alias = FALSE)) library("lmtest") coeftest(itempar(ram, ref = 1, alias = FALSE)) ## person parameters rapp <- personpar(ram) rapp confint(rapp) ## Polytomous Rasch models ----------------------------------------------------- ## rating scale and partial credit model rsm <- rsmodel(d$poly) pcm <- pcmodel(d$poly) ## person parameters pp <- personpar(pcm) vcpp <- vcov(pp) ## comparison of (mean) item parameters iprm <- itempar(ram, alias = FALSE, ref = 1) iprsm <- itempar(rsm, alias = FALSE, ref = 1) ippcm <- itempar(pcm, alias = FALSE, ref = 1) print(cbind(RM = iprm, RSM = iprsm, PCM = ippcm), digits = 5) ## comparison of absolute threshold parameters atprsm <- threshpar(rsm, relative = FALSE, ref = 1) atppcm <- threshpar(pcm, relative = FALSE, ref = 1) print(cbind(coef(atprsm, type = "matrix"), coef(atppcm, type = "matrix")), digits = 5) ## comparison of relative threshold parameters rtprsm <- threshpar(rsm, ref = 1, relative = TRUE) rtppcm <- threshpar(pcm, ref = 1, relative = TRUE) print(cbind(coef(rtprsm, type = "matrix"), coef(rtppcm, type = "matrix")), digits = 5) ## PCM visualizations lbs <- labels(d$poly) tlm <- c(-2, 6) cols <- colorspace::rainbow_hcl(4, c = 60, l = 75) cols2 <- colorspace::heat_hcl(6, h = c(0, -100), c = 60, l = 75) cols3 <- colorspace::rainbow_hcl(3, c = 60, l = 60) plot(pcm, type = "curves", ref = 1, items = 1:6, layout = matrix(1:6, ncol = 3, nrow = 2, byrow = FALSE), names = lbs, ylim = c(0, 1), xlim = tlm, col = cols[1:3], lwd = 1.5, xlab = expression(paste("Latent trait ", theta)), ylab = "Probability") plot(pcm, type = "regions", names = lbs, parg = list(ref = 1), ylab = expression(paste("Latent trait ", theta)), ylim = tlm, col = cols[1:3]) plot(pcm, type = "profile", what = "items", names = lbs, ylab = expression(paste("Latent trait ", theta)), parg = list(ref = 1), ylim = tlm) ## PCM vs. RSM (vs. RAM) visualizations ## characteristic curves plot(rsm, type = "curves", items = 1, ref = 1, xlim = tlm, col = c("#E495A5", "#ABB065", "#39BEB1"), lwd = 2, main = "", xlab = expression(paste("Latent trait ", theta))) plot(pcm, type = "curves", items = 1, ref = 1, lty = 2, xlim = tlm, col = c("#E495A5", "#ABB065", "#39BEB1"), lwd = 2, add = TRUE) legend(x = 0.85, y = 6.5, legend = c("RSM", "PCM"), bty = "n", lty = 1:2, lwd = 2) ## profile (items) plot(ram, type = "profile", what = "items", parg = list(ref = 1), col = cbind(cols3[1], "lightgray"), ref = FALSE, names = lbs, ylim = tlm, ylab = "Item location parameters") plot(rsm, type = "profile", what = "items", parg = list(ref = 1), col = cbind(cols3[2], "lightgray"), ylim = tlm, add = TRUE) plot(pcm, type = "profile", what = "items", parg = list(ref = 1), col = cbind(cols3[3], "lightgray"), ylim = tlm, add = TRUE) legend(x = 0.85, y = 6.5, legend = c("RM", "RSM", "PCM"), bty = "n", col = cols3, pch = 16) ## profile (thresholds) plot(rsm, type = "profile", what = "threshold", parg = list(ref = 1), col = cbind(cols3[2], cols3[2]), names = lbs, ylim = tlm) plot(pcm, type = "profile", what = "threshold", parg = list(ref = 1), col = cbind(cols3[3], cols3[3]), add = TRUE) legend(x = 0.85, y = 6.5, legend = c("RSM", "PCM"), bty = "n", col = cols3[2:3], pch = 16) ## information curves plot(ram, type = "information", what = "items", ref = 1, xlab = expression(paste("Latent trait ", theta)), names = lbs, lty = 1, xlim = c(-4, 8), ylim = c(0, 0.6), main = "", lwd = 2, col = cols2, ylab = "Item information") plot(pcm, type = "information", what = "items", ref = 1, lty = 2, xlim = c(-4, 8), lwd = 2, col = cols2, add = TRUE) legend(x = 6, y = 0.74, legend = c("RM", "PCM"), bty = "n", lwd = 2, lty = 1:2) ## category information plot(pcm, type = "information", what = "categories", ref = 1, items = 1:6, xlab = expression(paste("Latent trait ", theta)), ylab = "Category information", lwd = 2, names = lbs, col = cols, xlim = c(-4, 8), ylim = c(0, 0.3), layout = matrix(1:6, ncol = 3, nrow = 2, byrow = FALSE)) ## model comparisons ## information criteria AIC(rsm, pcm) BIC(rsm, pcm) ## likelihood ratio test library("lmtest") lrtest(rsm, pcm) ## Wald test tp <- threshpar(pcm, type = "mode", relative = TRUE, ref = 1, alias = FALSE) C <- cbind(1, diag(-1, nrow = 5, ncol = 5)) library("car") linearHypothesis(tp, hypothesis.matrix = C, rhs = rep.int(0, 5)) ## DIF detection by gender ----------------------------------------------------- ## models rmall <- raschmodel(d$dich) rmmale <- raschmodel(subset(d, gender == "male")$dich) rmfemale <- raschmodel(subset(d, gender == "female")$dich) ## likelihood ratio test (global) (LRT <- as.vector(- 2 * (logLik(rmall) - (logLik(rmmale) + logLik(rmfemale))))) pchisq(LRT, df = 5, lower.tail = FALSE) ## Wald test (itemwise with given anchoring) ipmale <- itempar(rmmale, ref = c(2, 3)) ipfemale <- itempar(rmfemale, ref = c(2, 3)) waldtests <- (coef(ipmale) - coef(ipfemale)) / sqrt(diag(vcov(ipmale)) + diag(vcov(ipfemale))) pvalues <- 2*pnorm(abs(waldtests), lower.tail = FALSE) cbind("Test Statistic" = waldtests, "P-Value" = pvalues) ## Wald test (automatic anchor selection set.seed(1) anchortest(rmfemale, rmmale, class = "forward", method = "MPT", adjust = "holm") ## tree library("psychotree") rt <- raschtree(dich ~ gender + anger, data = d) plot(rt, tp_args = list(names = lbs, abbreviate = FALSE)) psychotools/demo/MathExam14W.R0000644000176200001440000001172313031460367015716 0ustar liggesusers## data ------------------------------------------------------------------------ library("psychotools") data("MathExam14W", package = "psychotools") ## exclude extreme scorers mex <- subset(MathExam14W, nsolved > 0 & nsolved < 13) ## two subgroups (first and second batch) with slightly different exercise templates mex1 <- subset(mex, group == 1) mex2 <- subset(mex, group == 2) ## solved: dichotomous incorrect (0) vs. correct (1) ## credits: polytomous not attempted (0) vs. attempted but not solved (1) vs. solved (2) par(mfrow = c(2, 2)) plot(mex1$solved) plot(mex1$credits) plot(mex2$solved) plot(mex2$credits) par(mfrow = c(1, 1)) ## dichotomous vs. polytomous -------------------------------------------------- ## Rasch models ram <- raschmodel(mex1$solved) rsm <- rsmodel(mex1$credits) pcm <- pcmodel(mex1$credits) ## person item maps plot(ram, type = "piplot") plot(rsm, type = "piplot") plot(pcm, type = "piplot") ## (mean) item profiles similar cols3 <- colorspace::rainbow_hcl(3, c = 60, l = 60) plot(ram, type = "profile", what = "items", parg = list(ref = 8), col = cols3[1]) plot(rsm, type = "profile", what = "items", parg = list(ref = 8), col = cols3[2], add = TRUE) plot(pcm, type = "profile", what = "items", parg = list(ref = 8), col = cols3[3], add = TRUE) legend("topleft", legend = c("RM", "RSM", "PCM"), bty = "n", col = cols3, pch = 16) ## but handling of thresholds for attempting and solving different plot(rsm, type = "profile", what = "threshold", parg = list(ref = 1), col = cols3[2], ylim = c(-1.5, 2.5)) plot(pcm, type = "profile", what = "threshold", parg = list(ref = 1), col = cols3[3], add = TRUE) legend("topleft", legend = c("RSM", "PCM"), bty = "n", col = cols3[2:3], pch = 16) rtprsm <- threshpar(rsm, ref = 1, relative = TRUE) rtppcm <- threshpar(pcm, ref = 1, relative = TRUE) print(cbind(coef(rtprsm, type = "matrix"), coef(rtppcm, type = "matrix")), digits = 5) ## -> do not attempt to model distinction between "not attempting" and "attempting but not solving" ## -> focus on "solving" vs. "not solving" only ## DIF: group 1 vs. 2 ---------------------------------------------------------- ## Rasch models mr <- raschmodel(mex $solved) mr1 <- raschmodel(mex1$solved) mr2 <- raschmodel(mex2$solved) ## global test statistics library("multcomp") library("strucchange") c( "LR" = -2 * as.numeric(logLik(mr) - (logLik(mr1) + logLik(mr2))), "Wald" = summary(anchortest(solved ~ group, data = mex)$final_tests, test = Chisqtest())$test$SSH, "Score/LM" = unname(sctest(mr, order.by = mex$group, vcov = "info", functional = "LMuo")$statistic) ) ## itemwise visualization with different fixed anchorings ## anchor: item 1 rb <- psychomix:::qualitative_hcl(2) plot(mr1, parg = list(ref = 1), ref = FALSE, ylim = c(-2.6, 2.6), col = rb[1]) plot(mr2, parg = list(ref = 1), ref = FALSE, add = TRUE, col = rb[2]) legend("topleft", paste("Group", 1:2), pch = 19, col = rb, bty = "n") ## anchor: item 8 plot(mr1, parg = list(ref = 8), ref = FALSE, ylim = c(-1.6, 3.6), col = rb[1]) plot(mr2, parg = list(ref = 8), ref = FALSE, add = TRUE, col = rb[2]) legend("topleft", paste("Group", 1:2), pch = 19, col = rb, bty = "n") ## automatic anchor selection set.seed(1) mra <- anchortest(solved ~ group, data = mex, adjust = "single-step", class = "forward") par(mar = c(5, 8, 4, 1)) plot(mra$final_tests, main = paste("Anchor items:", paste(mra$anchor_items, collapse = ", "))) par(mar = c(5, 4, 4, 2)) ## DIF: Ability (tests or nsolved) with group 1 only --------------------------- ## maxLM test (jittered) set.seed(0) sctest(mr1, order.by = mex1$tests + runif(nrow(mex1), -0.15, 0), vcov = "info", functional = "maxLM", plot = TRUE, xlab = "tests (jittered)", ylim = c(0, 40)) ## maxLM test (ordinal) set.seed(1) mex1$otests <- cut(mex1$tests, breaks = c(0, 14:24, 26), ordered = TRUE, labels = c("<= 14", 15:24, ">= 25")) sctest(mr1, order.by = mex1$otests, vcov = "info", functional = "maxLMo", plot = TRUE, xlab = "tests (ordinal)", ylim = c(0, 40)) ## maxLM vs. maxLR test set.seed(1) sctest(mr1, order.by = mex1$otests, vcov = "info", functional = "maxLMo", plot = TRUE, xlab = "tests (ordinal)", ylim = c(0, 40)) lines(sapply(1:(nlevels(mex1$otests) - 1), function(i) 2 * (logLik(raschmodel(subset(mex1, as.numeric(otests) <= i)$solved)) + logLik(raschmodel(subset(mex1, as.numeric(otests) > i)$solved)) - logLik(mr1))), type = "b", lty = 2) legend("topleft", c("LR", "LM"), lty = 2:1, bty = "n") ## DIF: tree-based detection --------------------------------------------------- mex$tests <- ordered(mex$tests) mex$nsolved <- ordered(mex$nsolved) mex$attempt <- ordered(mex$attempt) library("psychotree") set.seed(1) mrt <- raschtree(solved ~ group + tests + nsolved + gender + attempt + study + semester, data = mex, vcov = "info", minsize = 50, ordinal = "l2", nrep = 1e5) plot(mrt) ## DIF: finite mixture model with group 1 only --------------------------------- library("psychomix") set.seed(1) mrm <- raschmix(mex1$solved, k = 2, scores = "meanvar") mrm plot(mrm) psychotools/demo/00Index0000644000176200001440000000032413644140612014716 0ustar liggesusersMathExam14W Rasch Models and Math Test Data toolbox1 Simulate DIF Test of 2PL Type I Error toolbox2 Simulate DIF Test of 2PL Power VerbalAggression Rasch Models and VerbalAggression Data psychotools/demo/toolbox1.R0000644000176200001440000000327513740351163015470 0ustar liggesuserslibrary(strucchange) set.seed(2409) data("VerbalAggression", package = "psychotools") refmodel <- plmodel(VerbalAggression$resp2[, 1:6]) dgp <- function(model, N = 1000, G = 1, impact = FALSE, cotype = "random") { mu <- if(impact) rep_len(c(-0.5, 0.5), N) else rep_len(0, N) theta <- rnorm(N, mu, 1) covariate <- switch(as.character(cotype), "random" = rnorm(N, 0, 1), "linear" = theta + rnorm(N, 0, 1), "quadratic" = theta ^ 2 + rnorm(N, 0, 1) ) d <- data.frame(theta = theta, covariate = covariate) if(G > 1) { d$impact <- cut(covariate, labels = 1:G, include.lowest = TRUE, breaks = quantile(covariate, probs = 0:G / G)) } d$resp <- rpl(theta, a = discrpar(model), b = itempar(model), g = guesspar(model), u = upperpar(model), return_setting = FALSE) return(d) } hitrate <- function(model, M = 1000, alpha = 0.05, parm = NULL, N = 1000, G = 1, impact = FALSE, cotype = "random") { pval <- replicate(M, { d <- dgp(model, N = N, G = G, impact = impact, cotype = cotype) m <- plmodel(d$resp, type = "2PL", impact = d$impact, maxit = 5000, reltol = 1e-4, vcov = FALSE) sctest(m, order.by = d$covariate, functional = "DM", parm = parm)$p.value }) mean(pval < alpha) } sim <- function(model, M = 1000, alpha = 0.05, parm = NULL, N = 1000, G = c(1, 2, 5, 25), impact = c(FALSE, TRUE), cotype = c("random", "linear", "quadratic")) { d <- expand.grid(G = G, impact = impact, cotype = cotype) d$hitrate <- NA for(i in seq_len(NROW(d))) { d$hitrate[i] <- hitrate(model, M = M, alpha = alpha, parm = parm, N = N, G = d$G[i], impact = d$impact[i], cotype = d$cotype[i]) } return(d) } simulation1 <- sim(refmodel) psychotools/data/0000755000176200001440000000000013405673352013561 5ustar liggesuserspsychotools/data/SoundQuality.rda0000644000176200001440000001327213165661061016714 0ustar liggesusers[ےq &-M.%=).bC b(0 7b/Ŋ1@]Ax y.YU3 uE/Y'O^?՝l7ۿloqxcof7f7gO7G'Ǘ?]\h1?~m{ɹ7伙$伝wFr~''49*9:9^I&/ar(9[ga볮Yj}>kZ%ϊgA^ߺu?no[u?lθy2j~bF?уpt<:pt0Vv-vwww{{{ս``{0\{8 x8 x:<<^WC!!gjŲXC =Uo/*[$7fo2n|~W ɗGgg_-m>O~ӣ_}1-{d:x:~;Nޫu(}~oO?O']k?_?ߴ~Z?Oi~gߋ_ژwˊ.)LODFEܰoy=+lMiJqgF?NLdSW (~k` llos=[.՛%Z{}9{=uc|D &pF-\{gCa :ޏⶎmsL=0:AA]F絃uy1g̦,o6>;;[Z?k7^σX:}o!)35s񻩱ImmѻJFכ~r3~2X3WqƭzWc~_ƣOCqiĉuTp9:(6\]0 Ql'sU C@vLK,Km Y){'/G֔PN^ɬq|dBD:`+>[01.#^PNwĿGiAA(^Qѹq=֡8ȷwug?GY3k[bmϦ6lc6J@gv |jؖW75یNﱭ0v-k?ώ瓺7Vcks}{.9I7Qk umkWq"n79yX.wg-uۊT7v~θ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,^2DJl2|t)mn3-f Q g8y)_Cٔ#,n]#ϙVYO!;ƍ988b5tPq8q$C01?FrL)͢8qd4@.S^xVUP#NNNFN_̞fuCd#('GN5<0[ܸ1Y<b5†p5p{%2G?(n!=֜8f9eSLx,GnQ<:9+Ž0d]C?|:w3y{M%crŷwx2ux.}fw?Q|8V9Og6'GdB1Y^P(FkX7/4O6rCXJYL3J?(f7\3{}~cv{tb..varkarvt:8핛wWwWﯮV  ÃWWWGeV=Z-<<<<< y' oz~?;?;:<:;:)axrt2_g>8x+-{ͫ{O^Η_qzt\y1>_|b2ggOE2k˗_P;O.~bJ_OjŨGpsychotools/data/SourceMonitoring.rda0000644000176200001440000000326212411045170017545 0ustar liggesusersNW8%{b-B ·67'lD$Vvhyߙ- UU}.M̓73!016'X ,~?⠳w=:80qT*~޿˝ߝd=uꏓ^Ug@H88m_JVz>{W~ٍ~p#{2?D|7µH uHMؑ>=?V+h=o^@|C򤸟/WC~r^q?`\>ϠOKzS_zi>-~U}^>Pܪy9vA^zw|)NirʗT\ Cg/c,?ܔLڧ4Hm>֦o&{MM?'/!]puڧMWkdo^\;ega+ȕSpgKƎ?\ ȷ@<"슾37@}-H{sc>Ƿ3z]>k5/>'|H>qߌ‾P]2n֗՝ Ϡƣ|?[7]v'+}]. Y!\6".>"VoHa ;%ϳ%-\ ȧdWN8>֑W,h@>=ձ?7Ocnstss~My`>Ի8?u !:݆;:yryHk:=]Y6=Ef~HYO!o3/n^ fGz%n_KsHg 7)[ipwNq^s?%@7oS`0>[>;G|ec|^;ٸ>|n} |coo@{O5}~}uk?-29\̬9i=[5¥o1@_#6A ӮM'?DX_)c\JN\Y~ES>:2K=KwW?1/K?~i㌓ud]#NUYܫ~`XNջj1j!a2t ݊a`.V}//_s_ƏԝNs1~;}qvYg>9l_.*w]gwm.psychotools/data/MemoryDeficits.rda0000644000176200001440000000520312762564313017175 0ustar liggesusersisISsh$dsmskwYX`Y0*8»&di1dd1'WS]]oYYխ7nܚn̬eڞώul~?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Za'|َA9_˖u{9igac%dW߯Zg3v~;g{pjmf}/gXo8_kE]{;g8o^z޴ Z/[n _6^'1nN[TGmXҷ20#\3D :Dvk`m~_ƻأ\8K(tvq!Gb1u0OF\ `}PR0.c\1:n;fn;!n;o]$_Hmwc\ʺO 78-N P, clNC8ʵX>1{d%YG+z:\>t/mῤv?bsݏKy6B|"%2\~XOY.NniZ!q\oR}̓8p]Zȷ[|kݩ[w|,kzZd)ZI[:X+Q7ϕxvq`]f>KP8ЕBv3%ͅS0tR^WlT;kY҆m3ٝnxRN.z>ٳ?̷?(to纳;y;Yu_OfZ׶*\&\nOK7dٻ>shHvtowuxw ֻ;ރK1Fu6|w^V.4|ԽlE7beEuLq˝:ǽ{zxw4nwtqwXxnl#Ls/>F&I[z|Udzuu ?_g>2ګO-Uσ}/F9ev>9%_6dlTZ)={ݕb].x+n[|+v{?ժ;;b6%_ lOWMi5_χCުȟWqObꁮN^ַlpfN^h-t랾ʑZ"럑ԬK9VwߩWMPj0zWd嵻,W>ϧ|>ue3pv{uB&^skkPC3jg?k_>9L/W=}j 1} where \code{"MPT"} is used or \code{class = "forward"} where \code{"MTT"} is used. For more details see below.} \item{length}{integer. It pre-defines a maximum anchor length. Per default, the \code{forward} anchor grows up to the proportion of currently presumed DIF-free items specified in \code{range} and the \code{constant} anchor class selects one anchor item, unless an explicit limiting number is defined in \code{length} by the user.} \item{range}{numeric vector of length 2. The first element is the percentage of first anchor candidates to be excluded for consideration when the \code{forward} anchor class is used and the second element determines a percentage of currently presumed DIF-free items up to which the anchor from the \code{forward} anchor class is allowed to grow.} \item{formula}{formula of type \code{y ~ x} where \code{y} specifies a matrix of dichotomous item responses and \code{x} the grouping variable, e.g., gender, for which DIF should be tested for.} \item{data}{a data frame containing the variables of the specified \code{formula}.} \item{subset}{logical expression indicating elements or rows to keep: missing values are taken as false.} \item{na.action}{a function which indicates what should happen when the data contain missing values (\code{NA}s).} \item{weights}{an optional vector of weights (interpreted as case weights).} \item{model}{an IRT model fitting function with a suitable \code{itempar} method, by default \code{\link{raschmodel}}.} } \details{ The anchor methods provided consist of an anchor class that determines characteristics of the anchor and an anchor selection that determines the ranking order of candidate anchor items. In the \code{constant} anchor class, the anchor length is pre-defined by the user within the argument \code{length}, defaulting to a length of one. In contrast, the iterative \code{forward} class starts with a single anchor item and includes items in the anchor as long as the anchor length is shorter than a certain percentage of the number of items that do not display statistically significant DIF (default: 0.8). Furthermore, a percentage of first anchor candidates is excluded from consideration (default: 0.1) and the user is allowed to set a maximum number of anchor items using the argument \code{length}. A detailed description of the anchor classes can be found in Kopf et al. (2015a). In more recent work Strobl et al. (2021) suggest a simpler yet powerful anchor method based on inequality criteria like the Gini coefficient. A similar approach based on the component loss function (CLF) was suggested by Muthn & Asparouhov (2014). These criteria can be shown to attain their optimium for a single-anchor, thus correponding to a \code{constant} class of \code{length} 1. Due to the simple structure in combination with good empirical performance the Gini-based selection was made the default in version 0.7-0 of the package. Both anchor classes require an explicit anchor selection strategy (as opposed to the \code{all-other} anchor class which is therefore not included in the function \code{anchor}). The anchor selection strategy determines the ranking order of candidate anchor items. In case of two groups, each item \eqn{j, j = 1, \ldots, k}{j, j = 1, \dots, k} (where \eqn{k}{k} denotes the number of items in the test) obtains a criterion value \eqn{c_j}{c_j} that is defined by the anchor selection strategy. The ranking order is determined by the rank of the criterion value rank\eqn{(c_j)}{(c_j)}. The criterion values \eqn{c_j}{c_j} for item \eqn{j}{j} from the different anchor selection strategies are provided in the following equations: \eqn{d_j}{d_j} denotes the difference of the item parameters, \eqn{t_j}{t_j} the corresponding test statistic, and \eqn{p_j}{p_j} the resulting p-values. In all cases, the anchor items are given in parentheses. Furthermore, \eqn{\mathrm{Gini}(\cdot)}{Gini(.)} denotes the Gini inequality index, \eqn{\mathrm{CLF}(\cdot)}{CLF(.)} the component loss function (sum of square root values), \eqn{1(\cdot)}{1(.)} the indicator function, \eqn{\lceil 0.5\cdot k \rceil}{<0.5k>} the empirical 50\% quantile, and \eqn{A_\mathrm{purified}}{A_{purified}} the anchor after purification steps. More detailed descriptions are available in Strobl et al. (2021) and Kopf et al. (2015b). Gini selection (of item parameter differences) by Strobl et al. (2021): \deqn{ c_j^\mathrm{Gini} = - \mathrm{Gini} (\{ |d_1(j)|, \ldots, |d_k(j)| \}) }{% c_j^{Gini} = -Gini({|d_1(j)|, \ldots, |d_k(j)|}) } GiniT selection (of test statistics) similar to Strobl et al. (2021): \deqn{ c_j^\mathrm{GiniT} = - \mathrm{Gini} (\{ |t_1(j)|, \ldots, |t_k(j)| \}) }{% c_j^{GiniT} = -Gini({|t_1(j)|, \ldots, |t_k(j)|}) } CLF selection (of item parameter differences) by Muthn & Asparouhov (2014): \deqn{ c_j^\mathrm{CLF} = \mathrm{CLF} (\{ |d_1(j)|, \ldots, |d_k(j)| \}) }{% c_j^{CLF} = CLF({|d_1(j)|, \ldots, |d_k(j)|}) } CLFT selection (of test statistics) similar to Muthn & Asparouhov (2014): \deqn{ c_j^\mathrm{CLFT} = \mathrm{CLF} (\{ |t_1(j)|, \ldots, |t_k(j)| \}) }{% c_j^{CLFT} = CLF({|t_1(j)|, \ldots, |t_k(j)|}) } All-other selection by Woods (2009), here abbreviated AO: \deqn{ c_j^\mathrm{AO} = | t_j (\{1,\ldots,k\}\textbackslash j) |}{% c_j^{AO} = | t_j ({1,\dots,k}\\j) |} All-other purified selection by Wang et al. (2012), here abbreviated AOP: \deqn{ c_j^\mathrm{AOP} = | t_j ( A_\mathrm{purified} ) |}{% c_j^{AOP} = | t_j ( A_{purified} ) |} Number of significant threshold selection based on Wang et al. (2004), here abbreviated NST: \deqn{ c_j^\mathrm{NST} = \sum_{l \in \{1,\ldots,k\} \textbackslash j} 1 \left\{ p_j ( \{l\} ) \leq \alpha \right\}) |}{% c_j^{NST} = \sum_{l in {1,\dots,k} \\ j} 1 { p_j ({l}) \le \alpha }) |} Mean test statistic selection by Shih et al. (2009), here abbreviated MT: \deqn{ c_j^\mathrm{MT} = \frac{1}{k-1} \sum_{l \in \{1,\ldots,k\} \textbackslash j} \left| t_j ( \{l\}) \right| }{% c_j^{MT} = 1/(k-1) \sum_{l in {1,\dots,k} \\ j} | t_j ({l}) |} Mean p-value selection by Kopf et al. (2015b), here abbreviated MP: \deqn{ c_j^\mathrm{MP} = - \frac{1}{k-1} \sum_{l \in \{1,\ldots,k\} \textbackslash j} p_j ( \{l\} ) }{% c_j^{MP} = - 1/(k-1) \sum_{l in {1,\dots,k} \\ j} p_j ({l})} Mean test statistic threshold selection by Kopf et al. (2015b), here abbreviated MTT: \deqn{ c_j^\mathrm{MTT} = \sum_{l \in \{1,\ldots,k\} \textbackslash j} 1 \left\{ \left| t_j ( \{l\} ) \right| > \left( \left| \frac{1}{k-1} \sum_{l \in \{ 1, \ldots, k \} \textbackslash j} t_j ( \{l\} ) \right| \right)_{\left( \lceil 0.5\cdot k\rceil \right)} \right\} }{% c_j^\mathrm{MTT} = \sum_{l in {1,\dots,k} \\ j} 1 { | t_j ({l}) | > ( | 1/(k-1) \sum_{l \in { 1,\dots, k } \\ j} t_j ({l}) | )_{<0.5k>}} } Mean p-value threshold selection by Kopf et al. (2015b), here abbreviated MPT: \deqn{ c_j^\mathrm{MPT} = - \sum_{l \in \{1,\ldots,k\} \textbackslash j} 1 \left\{ p_j ( \{l\} ) > \left( \frac{1}{k-1} \sum_{l \in \{ 1, \ldots, k \} \textbackslash j} p_j ( \{l\} ) \right)_{ \left( \lceil 0.5\cdot k\rceil \right)} \right\} }{% c_j^\mathrm{MPT} = - \sum_{l in {1,\dots,k} \\ j} 1 { p_j ({l}) > ( 1/(k-1) \sum_{l in { 1, \dots, k } \\ j} p_j ({l}))_{<0.5k>} } } Kopf et al. (2015b) recommend to combine the \code{class = "constant"} with \code{select = "MPT"} and the \code{class = "forward"} with \code{select = "MTT"}, respectively. The \code{all-other} anchor class (that assumes that DIF is balanced i.e. no group has an advantage in the test) is here not considered as explicit anchor selection and, thus, not included in the \code{anchor} function (but in the \code{\link{anchortest}} function). Note that the \code{all-other} anchor class requires strong prior knowledge that DIF is balanced. } \value{ An object of class \code{anchor}, i.e. a list including \item{anchor_items}{the integer index for the selected anchor items} \item{ranking_order}{a ranking order (integer index) of the candidate anchor items by their criterion values} \item{criteria}{the criterion values obtained in the anchor selection for each item (unsorted)} } \references{ Kopf J, Zeileis A, Strobl C (2015a). A Framework for Anchor Methods and an Iterative Forward Approach for DIF Detection. \emph{Applied Psychological Measurement}, \bold{39}(2), 83--103. \doi{10.1177/0146621614544195} Kopf J, Zeileis A, Strobl C (2015b). Anchor Selection Strategies for DIF Analysis: Review, Assessment, and New Approaches. \emph{Educational and Psychological Measurement}, \bold{75}(1), 22--56. \doi{10.1177/0013164414529792} Muthn B, Asparouhov T (2014). IRT Studies of Many Groups: The Alignment Method. \emph{Frontiers in Psychology}, \bold{5}, 978. \doi{10.3389/fpsyg.2014.00978} Shih CL, Wang WC (2009). Differential Item Functioning Detection Using the Multiple Indicators, Multiple Causes Method with a Pure Short Anchor. \emph{Applied Psychological Measurement}, \bold{33}(3), 184--199. Strobl C, Kopf J, Kohler L, von Oertzen T, Zeileis A (2021). Anchor Point Selection: Scale Alignment Based on an Inequality Criterion. \emph{Applied Psychological Measurement}, \bold{45}(3), 214--230. \doi{10.1177/0146621621990743} Wang WC (2004). Effects of Anchor Item Methods on the Detection of Differential Item Functioning within the Family of Rasch Models. \emph{Journal of Experimental Education}, \bold{72}(3), 221--261. Wang WC, Shih CL, Sun GW (2012). The DIF-Free-then-DIF Strategy for the Assessment of Differential Item Functioning. \emph{Educational and Psychological Measurement}, \bold{72}(4), 687--708. Woods C (2009). Empirical Selection of Anchors for Tests of Differential Item Functioning. \emph{Applied Psychological Measurement}, \bold{33}(1), 42--57. } \seealso{ \code{\link{anchortest}} } \examples{ ## Verbal aggression data data("VerbalAggression", package = "psychotools") ## Gini anchor (Strobl et al. 2021) for gender DIF in the self-to-blame situations anchor(resp2[, 1:12] ~ gender , data = VerbalAggression) ## alternatively: based on fitted raschmodel objects raschmodels <- with(VerbalAggression, lapply(levels(gender), function(i) raschmodel(resp2[gender == i, 1:12]))) anchor(raschmodels[[1]], raschmodels[[2]]) if(requireNamespace("multcomp")) { ## four anchor items from constant anchor class using MPT-selection (Kopf et al. 2015b) anchor(object = raschmodels[[1]], object2 = raschmodels[[2]], class = "constant", select = "MPT", length = 4) ## iterative forward anchor class using MTT-selection (Kopf et al. 2015b) set.seed(1) fanchor <- anchor(object = raschmodels[[1]], object2 = raschmodels[[2]], class = "forward", select = "MTT", range = c(0.05, 1)) fanchor ## the same using the formula interface set.seed(1) fanchor2 <- anchor(resp2[, 1:12] ~ gender , data = VerbalAggression, class = "forward", select = "MTT", range = c(0.05, 1)) ## criteria really the same? all.equal(fanchor$criteria, fanchor2$criteria, check.attributes = FALSE) } } \keyword{regression} psychotools/man/itempar.Rd0000644000176200001440000001333413351146166015355 0ustar liggesusers\name{itempar} \alias{itempar} \alias{itempar.btmodel} \alias{itempar.raschmodel} \alias{itempar.rsmodel} \alias{itempar.pcmodel} \alias{itempar.plmodel} \alias{itempar.gpcmodel} \alias{itempar.raschtree} \alias{itempar.bttree} \alias{coef.itempar} \alias{print.itempar} \alias{vcov.itempar} \title{Extract Item Parameters of Item Response Models} \description{ A class and generic function for representing and extracting the item parameters of a given item response model. } \usage{ itempar(object, \dots) \method{itempar}{raschmodel}(object, ref = NULL, alias = TRUE, vcov = TRUE, \dots) \method{itempar}{rsmodel}(object, ref = NULL, alias = TRUE, vcov = TRUE, \dots) \method{itempar}{pcmodel}(object, ref = NULL, alias = TRUE, vcov = TRUE, \dots) \method{itempar}{plmodel}(object, ref = NULL, alias = TRUE, vcov = TRUE, \dots) \method{itempar}{gpcmodel}(object, ref = NULL, alias = TRUE, vcov = TRUE, \dots) \method{itempar}{btmodel}(object, ref = NULL, alias = TRUE, vcov = TRUE, log = FALSE, \dots) } \arguments{ \item{object}{a fitted model or tree object whose item parameters should be extracted.} \item{ref}{a vector of labels or position indices of item parameters or a contrast matrix which should be used as restriction/for normalization. If \code{NULL} (the default) for all models except models estimated via MML, all items are used (sum zero restriction). For models estimated via MML (\code{plmodel}s and \code{gpcmodel}s), the parameters are by default identified via the distributional parameters of the person parameters (mean and variance of a normal distribution). Nevertheless, a restriction on the interval scale can be applied.} \item{alias}{logical. If \code{TRUE} (the default), the aliased parameter is included in the return vector (and in the variance-covariance matrix if \code{vcov} = TRUE). If \code{FALSE}, it is removed. If the restriction given in \code{ref} depends on several parameters, the first parameter of the restriction specified is (arbitrarily) chosen to be removed if \code{alias} is \code{FALSE}.} \item{vcov}{logical. If \code{TRUE} (the default), the (transformed) variance-covariance matrix of the item parameters is attached as attribute \code{vcov}. If \code{FALSE}, an \code{NA}-matrix is attached.} \item{log}{logical. Whether to return the estimated model parameters on the logit (\code{TRUE}) or preference scale (\code{FALSE}).} \item{\dots}{further arguments which are currently not used.} } \details{ \code{itempar} is both, a class to represent item parameters of item response models as well as a generic function. The generic function can be used to extract the item parameters of a given item response model. For Rasch models and n-parameter logistic models, \code{itempar} returns the estimated item difficulty parameters \eqn{\hat{\beta}_{j}} under the restriction specified in argument \code{ref}. For rating scale models, \code{itempar} returns computed item location parameters \eqn{\hat{\beta}_{j}} under the restriction specified in argument \code{ref}. These are computed from the estimated item-specific parameters \eqn{\hat{\xi}_{j}} (who mark the location of the first category of an item on the latent theta axis). For partial credit models and generalized partial credit models, \code{itempar} returns \sQuote{mean} absolute item threshold parameters, \eqn{\hat{\beta}_{j} = \frac{1}{p_{j}} \sum_{k = 1}^{p_{j}}\hat{\delta}_{jk}}, i.e., a single parameter per item is returned which results as the mean of the absolute item threshold parameters \eqn{\hat{\delta}_{jk}} of this item. Based upon these \sQuote{mean} absolute item threshold parameters \eqn{\hat{\beta}_{j}}, the restriction specified in argument \code{ref} is applied. For all models, the variance-covariance matrix of the returned item parameters is adjusted according to the multivariate delta rule. For objects of class \code{itempar}, several methods to standard generic functions exist: \code{print}, \code{coef}, \code{vcov}. \code{coef} and \code{vcov} can be used to extract the estimated calculated item parameters and their variance-covariance matrix without additional attributes. Based on this Wald tests or confidence intervals can be easily computed, e.g., via \code{confint}. Two-sample item-wise Wald tests for DIF in the item parameters can be carried out using the function \code{\link{anchortest}}. } \value{ A named vector with item parameters of class \code{itempar} and additional attributes \code{model} (the model name), \code{ref} (the items or parameters used as restriction/for normalization), \code{alias} (either \code{FALSE} or a named character vector with the removed aliased parameter, and \code{vcov} (the adjusted covariance matrix of the estimates if \code{vcov = TRUE} or an \code{NA}-matrix otherwise). } \seealso{\code{\link{personpar}}, \code{\link{threshpar}}, \code{\link{discrpar}}, \code{\link{guesspar}}, \code{\link{upperpar}}} \examples{ o <- options(digits = 4) ## load verbal aggression data data("VerbalAggression", package = "psychotools") ## fit a Rasch model to dichotomized verbal aggression data raschmod <- raschmodel(VerbalAggression$resp2) ## extract item parameters with sum zero or use last two items as anchor ip1 <- itempar(raschmod) ip2a <- itempar(raschmod, ref = 23:24) # with position indices ip2b <- itempar(raschmod, ref = c("S4WantShout", "S4DoShout")) # with item label ip1 ip2a all.equal(ip2a, ip2b) ## extract vcov vc1 <- vcov(ip1) vc2 <- vcov(ip2a) ## adjusted standard errors, ## smaller with more items used as anchors sqrt(diag(vc1)) sqrt(diag(vc2)) ## Wald confidence intervals confint(ip1) confint(ip2a) options(digits = o$digits) } \keyword{classes} psychotools/man/rsmodel.Rd0000644000176200001440000001167113377362317015371 0ustar liggesusers\name{rsmodel} \alias{rsmodel} \alias{RSModel.fit} \alias{print.rsmodel} \alias{summary.rsmodel} \alias{print.summary.rsmodel} \alias{coef.rsmodel} \alias{bread.rsmodel} \alias{estfun.rsmodel} \alias{logLik.rsmodel} \alias{vcov.rsmodel} \title{Rating Scale Model Fitting Function} \description{ \code{rsmodel} is a basic fitting function for rating scale models. } \usage{ rsmodel(y, weights = NULL, start = NULL, reltol = 1e-10, deriv = c("sum", "diff"), hessian = TRUE, maxit = 100L, full = TRUE, \dots) } \arguments{ \item{y}{item response object that can be coerced (via \code{\link[base]{as.matrix}}) to a numeric matrix with scores 0, 1, \dots Typically, either already a matrix, data frame, or dedicated object of class \code{\link{itemresp}}.} \item{weights}{an optional vector of weights (interpreted as case weights).} \item{deriv}{character. If "sum" (the default), the first derivatives of the elementary symmetric functions are calculated with the sum algorithm. Otherwise ("diff") the difference algorithm (faster but numerically unstable) is used.} \item{start}{an optional vector of starting values.} \item{hessian}{logical. Should the Hessian of the final model be computed? If set to \code{FALSE}, the \code{vcov} method can only return \code{NA}s and consequently no standard errors or tests are available in the \code{summary}.} \item{reltol, maxit, \dots}{further arguments passed to \code{\link[stats]{optim}}.} \item{full}{logical. Should a full model object be returned? If set to \code{FALSE}, no variance-covariance matrix and no matrix of estimating functions are computed.} } \details{ \code{rsmodel} provides a basic fitting function for rating scales models, intended as a building block for fitting rating scale trees. It estimates the rating scale model in the parametrization suggested by Andrich (1978), i.e., item-specific parameters \eqn{\xi_{j}} who mark the location of the first absolute threshold of an item on the theta axis and cumulative relative threshold parameters \eqn{\kappa_{k}} are estimated by the function \code{rsmodel}. \code{rsmodel} returns an object of class \code{"rsmodel"} (and class \code{"pcmodel"}) for which several basic methods are available, including \code{print}, \code{plot}, \code{summary}, \code{coef}, \code{vcov}, \code{logLik}, \code{\link{discrpar}}, \code{estfun}, \code{\link{itempar}}, \code{\link{threshpar}}, and \code{\link{personpar}}. } \value{ \code{rsmodel} returns an S3 object of class \code{"rsmodel"}, i.e., a list with the following components: \item{coefficients}{a named vector of estimated item-specific parameters (without the first item parameter which is constrained to 0) and estimated cumulative relative treshold parameters (again without first threshold parameter which is also constrained to 0),} \item{vcov}{covariance matrix of the parameters in the model,} \item{data}{modified data, used for model-fitting, i.e., cleaned for items without variance, centralized so that the first category is zero for all items and without observations with zero weight. Be careful, this is different than for objects of class \code{"raschmodel"} or \code{"btmodel"}, where \code{data} contains the \emph{original} data,} \item{items}{logical vector of length \code{ncol(y)}, which indicates which items have variance (\code{TRUE}), i.e., are identified and have been used for the estimation or not (\code{FALSE}),} \item{categories}{integer vector of length \code{ncol(y)}, which contains the number of categories minus one per item,} \item{n}{number of observations (with non-zero weights),} \item{n_org}{original number of observations in \code{y},} \item{weights}{the weights used (if any),} \item{na}{logical indicating whether the data contains NAs,} \item{esf}{list of elementary symmetric functions and their derivatives for estimated parameters,} \item{loglik}{log-likelihood of the fitted model,} \item{df}{number of estimated parameters,} \item{code}{convergence code from \code{optim},} \item{iterations}{number of iterations used by \code{optim},} \item{reltol}{tolerance passed to \code{optim}.} } \references{ Andrich D (1978). Application of a Psychometric Rating Model to Ordered Categories Which Are Scored with Successive Integers. \emph{Psychometrika}, \bold{2}(4), 581--594. } \seealso{\code{\link{pcmodel}}, \code{\link{gpcmodel}}, \code{\link{raschmodel}}, \code{\link{plmodel}}, \code{\link{btmodel}}} \examples{ o <- options(digits = 4) ## Verbal aggression data data("VerbalAggression", package = "psychotools") ## Rating scale model for the other-to-blame situations rsm <- rsmodel(VerbalAggression$resp[, 1:12]) summary(rsm) ## visualizations plot(rsm, type = "profile") plot(rsm, type = "regions") plot(rsm, type = "curves") plot(rsm, type = "information") plot(rsm, type = "piplot") options(digits = o$digits) } \keyword{regression} psychotools/man/predict.pcmodel.Rd0000644000176200001440000001011413356511544016762 0ustar liggesusers\name{predict.pcmodel} \alias{predict.pcmodel} \alias{predict.rsmodel} \alias{predict.raschmodel} \alias{predict.gpcmodel} \alias{predict.plmodel} \title{Predict Methods for Item Response Models} \description{ Prediction of (cumulated) response probabilities and responses based on fitted item response models. } \usage{ \S3method{predict}{pcmodel}(object, newdata = NULL, type = c("probability", "cumprobability", "mode", "median", "mean", "category-information", "item-information", "test-information"), ref = NULL, \dots) } \arguments{ \item{object}{a fitted model object whose item parameters should be used for prediction.} \item{newdata}{an optional (possibly named) vector of person parameters used for prediction. If \code{NULL} (the default), the person parameters of the subjects used to fit the model in \code{object} are used.} \item{type}{character of length one which determines the type of prediction (see details below).} \item{ref}{arguments passed over to internal calls of \code{itempar} or \code{threshpar}. Not used for models estimated via MML.} \item{\dots}{further arguments which are currently not used.} } \details{ Depending on the value of \code{type} either probabilities, responses or some form of information under the model specified in \code{object} are returned: If \code{type} is \code{"probability"}, the category response probabilities are returned. If \code{type} is \code{"cumprobability"}, the cumulated category response probabilities are returned, i.e., \eqn{P(X_{ij} \geq k)} with \eqn{k} corresponding to the categories of item \eqn{j}. If \code{type} is \code{"mode"}, the most probable category response for a given subject and item is returned. If \code{type} is \code{"median"}, the first category \eqn{k} where \eqn{P(X_{ij} = k) \geq 0.5} is returned. If \code{type} is \code{"mean"}, the rounded expected category response, i.e., \eqn{E(X_{ij}|\theta_{i})}, is returned. If \code{type} is \code{"category-information"}, the item-category information as suggested by Bock (1972) is returned. If \code{type} is \code{"item-information"}, the item information as suggested by Samejima (1974) is returned. If \code{type} is \code{"test-information"}, the sum over the individual item information values is returned. } \value{ A (possibly named) numeric matrix with rows corresponding to subjects and columns corresponding to the whole test, the single items or categories. The exact content depends on the value of \code{type} (see details above). } \references{ Bock RD (1972). Estimating Item Parameters and Latent Ability When Responses Are Scored in Two or More Nominal Categories. \emph{Psychometrika}, \bold{37}(1), 29--51. Samejima F (1974). Normal Ogive Model on the Continuous Response Level in the Multidimensional Latent Space. \emph{Psychometrika}, \bold{39}(1), 111--121. } \seealso{ The help page of the generic function \code{\link{predict}} and other predict methods (e.g., \code{\link{predict.lm}}, \code{\link{predict.glm}}, \dots) } \examples{ o <- options(digits = 4) ## load verbal aggression data data("VerbalAggression", package = "psychotools") ## fit a partial credit model to first ten items pcmod <- pcmodel(VerbalAggression$resp[, 1:10]) ## predicted response probabilities for each subject and category (the default) head(predict(pcmod), 3) ## predicted mode (most probable category) for certain subjects whose person ## parameters are given via argument "newdata" predict(pcmod, type = "mode", newdata = c("Sarah" = 1.2, "Michael" = 0.1, "Arnd" = -0.8)) ## rounded expected category value for the same subjects predict(pcmod, type = "mean", newdata = c("Sarah" = 1.2, "Michael" = 0.1, "Arnd" = -0.8)) ## in the Rasch model mode, mean and median are the same raschmod <- raschmodel(VerbalAggression$resp2[, 1:10]) med <- predict(raschmod, type = "median") mn <- predict(raschmod, type = "mean") mod <- predict(raschmod, type = "mode") head(med, 3) all.equal(med, mn) all.equal(mod, mn) options(digits = o$digits) } \keyword{regression} psychotools/man/itemresp.Rd0000644000176200001440000001413312401711017015526 0ustar liggesusers\name{itemresp} \alias{itemresp} \alias{is.na.itemresp} \alias{labels.itemresp} \alias{labels<-.itemresp} \alias{length.itemresp} \alias{levels.itemresp} \alias{mscale.itemresp} \alias{mscale<-.itemresp} \alias{names.itemresp} \alias{names<-.itemresp} \alias{rep.itemresp} \alias{str.itemresp} \alias{xtfrm.itemresp} \title{Data Structure for Item Response Data} \description{ A class for representing data from questionnaires along with methods for many generic functions. } \usage{ itemresp(data, mscale = NULL, labels = NULL, names = NULL) } \arguments{ \item{data}{matrix or data frame. A matrix or data frame with integer values or factors where the rows correspond to subjects and the columns to items. See below for details.} \item{mscale}{integer or character. A list of vectors (either integer or character) giving the measurement scale. See below for details. By default guessed from \code{data}.} \item{labels}{character. A vector of character labels for the items. By default, the column names of \code{data} are used or, if these are not available, the string \code{"item"} along with numbers 1, 2, \dots is used.} \item{names}{character. A vector of names (or IDs) for the subjects. By default, no subject names are used.} } \details{ \code{itemresp} is designed for item response data of \eqn{n} subjects for \eqn{k} items. The item responses should be coded in a matrix \code{data} with \eqn{n} rows (subjects) and \eqn{k} columns (items). Alternatively, \code{data} can be a data frame with \eqn{n} rows (subjects) and \eqn{k} variables (items), which can be either factors or integer valued vectors. \code{mscale} provides the underlying measurement scale either as integer or character vector(s). If all items are measured on the same scale, \code{mscale} can be a vector. Alternatively, it can be provided as a named list of vectors for each item. If the list contains one unnamed element, this element will be used as the measurement scale for items that have not been named. Integers or characters not present in \code{mscale} but in \code{data} will be replaced by \code{NA}. All items must be measured with at least 2 categories. By default, \code{mscale} is set to the full range of observed values for all integer items (see example below) and the corresponding levels for all factor items in \code{data}. Methods to standard generic functions include: \code{str}, \code{length} (number of subjects), \code{dim} (number of subjects and items), \code{is.na} (only \code{TRUE} if all item responses are \code{NA} for a subject), \code{print} (see \code{\link{print.itemresp}} for details), \code{summary} and \code{plot} (see \code{\link{summary.itemresp}} for details), subsetting via \code{[} and \code{subset} (see \code{\link{subset.itemresp}} for details), \code{is.itemresp} and various coercion functions to other classes (see \code{\link{as.list.itemresp}} for details). Extracting/replacing properties is available through: \code{labels} for the item labels, \code{mscale} for the measurement scale, \code{names} for subject names/IDs. } \value{ \code{itemresp} returns an object of class \code{"itemresp"} which is a matrix (\code{data} transformed to integers 0, 1, \dots) plus an attribute \code{"mscale"} as a named list for each item (after being checked and potentially suitably coerced or transformed to all integer or all character). } \seealso{\code{\link{print.itemresp}}, \code{\link{summary.itemresp}}, \code{\link{as.list.itemresp}}, \code{\link{subset.itemresp}}} \examples{ ## binary responses to three items, coded as matrix x <- cbind(c(1, 0, 1, 0), c(1, 0, 0, 0), c(0, 1, 1, 1)) ## transformed to itemresp object xi <- itemresp(x) ## printing (see also ?print.itemresp) print(xi) print(xi, labels = TRUE) ## subsetting/indexing (see also ?subset.itemresp) xi[2] xi[c(TRUE, TRUE, FALSE, FALSE)] subset(xi, items = 1:2) dim(xi) length(xi) ## summary/visualization (see also ?summary.itemresp) summary(xi) plot(xi) ## query/set measurement scale labels ## extract mscale (tries to collapse to vector) mscale(xi) ## extract as list mscale(xi, simplify = FALSE) ## replacement by list mscale(xi) <- list(item1 = c("no", "yes"), item2 = c("nay", "yae"), item3 = c("-", "+")) xi mscale(xi) ## replacement with partially named list plus default mscale(xi) <- list(item1 = c("n", "y"), 0:1) mscale(xi) ## replacement by vector (if number of categories constant) mscale(xi) <- c("-", "+") mscale(xi, simplify = FALSE) ## query/set item labels and subject names labels(xi) labels(xi) <- c("i1", "i2", "i3") names(xi) names(xi) <- c("John", "Joan", "Jen", "Jim") print(xi, labels = TRUE) ## coercion (see also ?as.list.itemresp) ## to integer matrix as.matrix(xi) ## to data frame with single itemresp column as.data.frame(xi) ## to list of factors as.list(xi) ## to data frame with factors as.list(xi, df = TRUE) ## polytomous responses with missing values and unequal number of ## categories in a data frame d <- data.frame( q1 = c(-2, 1, -1, 0, NA, 1, NA), q2 = c(3, 5, 2, 5, NA, 2, 3), q3 = factor(c(1, 2, 1, 2, NA, 3, 2), levels = 1:3, labels = c("disagree", "neutral", "agree"))) di <- itemresp(d) di ## auto-completion of mscale: full range (-2, ..., 2) for q1, starting ## from smallest observed (negative) value (-2) to the same (positive) ## value (2), full (positive) range for q2, starting from smallest ## observed value (2) to largest observed value (5), missing category of ## 4 is detected, for q3 given factor levels are used mscale(di) ## set mscale for q2 and add category 1, q1 and q3 are auto-completed: di <- itemresp(d, mscale = list(q2 = 1:5)) ## is.na.itemresp - only true for observation 5 (all missing) is.na(di) ## illustration for larger data set data("VerbalAggression", package = "psychotools") r <- itemresp(VerbalAggression$resp[, 1:12]) str(r) head(r) plot(r) summary(r) prop.table(summary(r), 1) ## dichotomize response r2 <- r mscale(r2) <- c(0, 1, 1) plot(r2) ## transform to "likert" package if(require("likert")) { lik <- likert(as.data.frame(as.list(r))) lik plot(lik) } } \keyword{classes} psychotools/man/infoplot.Rd0000644000176200001440000001012513405674275015550 0ustar liggesusers\name{infoplot} \alias{infoplot} \title{Information Plots for IRT Models} \description{ Base graphics plotting function for information plot visualization of IRT models. } \usage{ infoplot(object, what = c("categories", "items", "test"), ref = NULL, items = NULL, names = NULL, layout = NULL, xlim = NULL, ylim = NULL, col = NULL, lty = NULL, lwd = NULL, main = NULL, legend = TRUE, xlab = "Latent trait", ylab = "Information", add = FALSE, \dots) } \arguments{ \item{object}{a fitted model object of class \code{"raschmodel"}, \code{"rsmodel"}, \code{"pcmodel"}, \code{"plmodel"} or \code{"gpcmodel"}.} \item{what}{character, specifying the type of information to visualize.} \item{ref}{argument passed over to internal calls of \code{\link{predict}}.} \item{items}{character or numeric, specifying the items for which information curves should be visualized.} \item{names}{character, specifying labels for the items.} \item{layout}{matrix, specifying how the item or category information curves of different items should be arranged. If \code{null} and \code{what} is set to \code{"items"}, the item information curves are overlayed within a single plot.} \item{xlim, ylim}{numeric, specifying the x and y axis limits.} \item{col}{character, specifying the colors of the test, item or category information curves.} \item{lty}{numeric, specifying the line type of the information curves.} \item{lwd}{numeric, specifying the line width of the information curves.} \item{main}{character, specifying the overall title of the plot.} \item{legend}{logical, specifying if a legend is drawn when multiple item information curves are overlayed. The labels in the legend correspond to the item names (which can be specified in the argument \code{names}).} \item{xlab, ylab}{character, specifying the x and y axis labels.} \item{add}{logical. If \code{TRUE}, new information curves are added to an existing plot. Only possible for a test or a single item information curve.} \item{\dots}{further arguments passed to internal calls of \code{\link{matplot}}.} } \details{ The information plot visualization illustrates the test, item or category information as a function of the ability parameter \eqn{\theta} under a certain IRT model. Further details on the computation of the displayed information can be found on the help page of the function \code{\link{predict.pcmodel}}. } \seealso{\code{\link{curveplot}}, \code{\link{regionplot}}, \code{\link{profileplot}}, \code{\link{piplot}}} \examples{ ## load verbal aggression data data("VerbalAggression", package = "psychotools") ## fit Rasch and partial credit model to verbal aggression data rmmod <- raschmodel(VerbalAggression$resp2) pcmod <- pcmodel(VerbalAggression$resp) ## category information plots for all items under the dichotomous RM plot(rmmod, type = "information", what = "categories") ## category information plots for all items under the PCM plot(pcmod, type = "information", what = "categories") ## overlayed item information plots for the first six items of the ## data set under the PCM plot(pcmod, type = "information", what = "items", items = 1:6) ## a comparison of the item information for the first six items under the ## dichotomous RM and the PCM plot(pcmod, type = "information", what = "items", items = 1:6, xlim = c(-5, 5)) plot(rmmod, type = "information", what = "items", items = 1:6, lty = 2, add = TRUE) legend(x = "topright", legend = c("PCM", "RM"), lty = 1:2, bty = "n") ## a comparison of the test information based on all items of the ## data set under the dichotomous RM and the PCM plot(pcmod, type = "information", what = "test", items = 1:6, xlim = c(-5, 5)) plot(rmmod, type = "information", what = "test", items = 1:6, lty = 2, add = TRUE) legend(x = "topright", legend = c("PCM", "RM"), lty = 1:2, bty = "n") if(requireNamespace("mirt")) { ## fit 2PL to verbal aggression data twoplmod <- plmodel(VerbalAggression$resp2) ## category information plots for all items under the dichotomous 2PL plot(twoplmod, type = "information", what = "categories") } } \keyword{aplot} psychotools/man/VerbalAggression.Rd0000644000176200001440000000453313613570026017147 0ustar liggesusers\name{VerbalAggression} \alias{VerbalAggression} \title{Situation-Response Questionnaire on Verbal Aggression} \description{ Responses of 316 subjects to 24 items describing possible reactions to 4 different frustrating situations. } \usage{data("VerbalAggression")} \format{ A data frame containing 316 observations on 4 variables. \describe{ \item{resp}{Item response matrix with values 0/1/2 coding no/perhaps/yes, respectively.} \item{resp2}{Dichotomized item response matrix with perhaps/yes merged to 1.} \item{gender}{Factor coding gender.} \item{anger}{Trait anger, assessed by the Dutch adaptation of the state-trait anger scale (STAS).} } } \details{ The 24 items are constructed by factorial combination of four different frustrating situations (see below), three possible verbally aggressive responses (curse, scold, shout), and two behavioural models (want, do). The four situations are \tabular{rl}{ S1:\tab A bus fails to stop for me.\cr S2:\tab I miss a train because a clerk gave me faulty information.\cr S3:\tab The grocery store closes just as I am about to enter.\cr S4:\tab The operator disconnects me when I used up my last 10 cents for a call. } Note that the first two situations are other-to-blame situations, and the latter two are self-to-blame situations. The subjects were 316 first-year psychology students from a university in the Dutch speaking part of Belgium. Participation was a partial fulfillment of the requirement to participate in research. The sample consists of 73 males and 243 females, reflecting the gender proportion among psychology students. The average age was 18.4. } \source{ Online materials accompanying De Boeck and Wilson (2004). \url{http://bear.soe.berkeley.edu/EIRM/} } \references{ De Boeck, P., Wilson, M. (eds) (2004). Explanatory Item Response Models: A Generalized Linear and Nonlinear Approach. New York: Springer-Verlag. Smits, D.J.M., De Boeck, P., Vansteelandt, K. (2004). The Inhibition of Verbally Aggressive Behaviour \emph{European Journal of Personality}, \bold{18}, 537-555. doi:10.1002/per.529 } \seealso{\code{\link{raschmodel}}} \examples{ data("VerbalAggression", package = "psychotools") ## Rasch model for the self-to-blame situations m <- raschmodel(VerbalAggression$resp2[, 1:12]) plot(m) ## IGNORE_RDIFF_BEGIN summary(m) ## IGNORE_RDIFF_END } \keyword{datasets} psychotools/man/regionplot.Rd0000644000176200001440000001146113406033530016064 0ustar liggesusers\name{regionplot} \alias{regionplot} \title{Region Plots for IRT Models} \description{ Base graphics plotting function for region plot visualization of IRT models. } \usage{ regionplot(object, parg = list(type = NULL, ref = NULL, alias = TRUE), names = TRUE, main = NULL, xlab = "", ylab = "Latent trait", ylim = NULL, off = 0.1, col = NULL, linecol = 2, srt = 45, adj = c(1.1, 1.1), axes = TRUE, \dots) } \arguments{ \item{object}{a fitted model object of class \code{"raschmodel"}, \code{"rsmodel"}, \code{"pcmodel"}, \code{"plmodel"} or \code{"gpcmodel"}.} \item{parg}{list of arguments passed over to internal calls of \code{\link{threshpar}}. See the help page of \code{\link{threshpar}} for more details.} \item{names}{logical or character. If \code{TRUE}, the names of the items are displayed on the x-axis. If \code{FALSE}, numbers of items are shown. Alternatively a character vector of the same length as the number of items can be supplied.} \item{main}{character, specifying the overall title of the plot.} \item{xlab, ylab}{character, specifying the x and y axis labels.} \item{ylim}{numeric, specifying the y axis limits.} \item{off}{numeric, the distance (in scale units) between two item rectangles.} \item{col}{character, list or function, specifying the colors of the regions. Either a single vector with \eqn{k} color names, a list with \eqn{m} elements and each element is a character vector with color names for the regions of item \eqn{j} or a color-generating function like, e.g., \code{gray.colors}, which is then directly used to create the color names.} \item{linecol}{color for lines indicating \dQuote{hidden} categories.} \item{srt, adj}{numeric. Angle (\code{srt}) and adjustment (\code{adj}) in case names (rather than numbers) are used as x-axis labels. These are passed to \code{\link[graphics]{text}}.} \item{axes}{logical. Should axes be drawn?} \item{\dots}{further arguments passed to \code{\link{plot}}.} } \details{ The region plot visualization implemented here was already used by Van der Linden and Hambleton (1997) in the context of IRT and has been called "effect plots" by Fox & Hong (2009). In our implementation, these plots show, dependent on the chosen type of threshold parameters, different regions for the categories of an item over the theta axis. If \code{type} is set to \code{"modus"}, the cutpoints correspond to the threshold parameters and the rectangles mark the theta regions where a category is the single most probable category chosen with a certain value of the latent trait. If \code{type} is set to \code{"median"}, the cutpoints correspond to the point on the theta axis, where the cumulative probability to score in category \eqn{k} or higher is 0.5, i.e., \eqn{P(X_{ij} \geq k) = 0.5}. If set to \code{"mean"}, the cutpoints correspond to the point on the theta axis where the expected score \eqn{E(X_{ij})} is exactly between two categories, e.g., 0.5 for a dichotomous item. If \code{type} is set to \code{"mode"} and there are unordered threshold parameters, the location of the original threshold parameters are indicated by red dashed lines. } \references{ Fox J, Hong J (2009). Effect Displays in R for Multinomial and Proportional-Odds Logit Models: Extensions to the effects Package. \emph{Journal of Statistical Software}, \bold{32}(1), 1--24. Van der Linden WJ, Hambleton RK (1997). \emph{Handbook of Modern Item Response Theory}. Springer, New York. } \seealso{\code{\link{curveplot}}, \code{\link{profileplot}}, \code{\link{infoplot}}, \code{\link{piplot}}} \examples{ ## load verbal aggression data data("VerbalAggression", package = "psychotools") ## fit a Partial credit model to the items of the first other-to-blame ## situation: "A bus fails to stop for me" pcm <- pcmodel(VerbalAggression$resp[, 1:6]) ## a region plot with modus as cutpoint and custom labels lab <- paste(rep(c("Curse", "Scold", "Shout"), each = 2), rep(c("Want", "Do"), 3 ), sep = "-") plot(pcm, type = "regions", names = lab) ## compare the cutpoints (with ylim specified manually) opar <- par(no.readonly = TRUE) ylim <- c(-2, 2) layout(matrix(1:3, ncol = 1)) plot(pcm, type = "regions", parg = list(type = "mode"), main = "Modus as Cutpoint", ylim = ylim) plot(pcm, type = "regions", parg = list(type = "median"), main = "Median as Cutpoint", ylim = ylim) plot(pcm, type = "regions", parg = list(type = "mean"), main = "Mean as Cutpoint", ylim = ylim) par(opar) ## PCM for full verbal aggression data set pcm_va <- pcmodel(VerbalAggression$resp) plot(pcm_va, type = "regions") if(requireNamespace("mirt")) { ## generalized partial credit model for full verbal aggression data set gpcm_va <- gpcmodel(VerbalAggression$resp) plot(gpcm_va, type = "regions") } } \keyword{aplot} psychotools/man/as.list.itemresp.Rd0000644000176200001440000000413412022326334017105 0ustar liggesusers\name{as.list.itemresp} \alias{is.itemresp} \alias{as.list.itemresp} \alias{as.character.itemresp} \alias{as.data.frame.itemresp} \alias{as.double.itemresp} \alias{as.integer.itemresp} \alias{as.matrix.itemresp} \title{Coercing Item Response Data} \description{ Coercing \code{"itemresp"} data objects to other classes. } \usage{ \method{as.list}{itemresp}(x, items = NULL, mscale = TRUE, df = FALSE, \dots) } \arguments{ \item{x}{an object of class \code{"itemresp"}.} \item{items}{character, integer, or logical for subsetting the items.} \item{mscale}{logical. Should the measurement scale labels be used for creating factor levels? If \code{FALSE}, the values 0, 1, \dots are used.} \item{df}{logical. Should a data frame of factors be returned? If \code{FALSE}, a plain list of factors is returned.} \item{\dots}{currently not used.} } \details{ The \code{as.list} method coerces item response data to a list (or data frame) of factors with factor levels either taken from the \code{mscale(x)} or as the values 0, 1, \dots. The \code{as.data.frame} method returns a data frame with a single column of class \code{"itemresp"}. Furthermore, \code{as.matrix}, \code{as.integer}, \code{as.double} all return a matrix with the item responses coded as values 0, 1, \dots The \code{as.character} method simply calls \code{\link{format.itemresp}}. \code{is.itemresp} can be used to check wether a given object is of class \code{"itemresp"}. } \seealso{\code{\link{itemresp}}} \examples{ ## item responses from binary matrix x <- cbind(c(1, 0, 1, 0), c(1, 0, 0, 0), c(0, 1, 1, 1)) xi <- itemresp(x) ## change mscale mscale(xi) <- c("-", "+") xi ## coercion to list of factors with levels taken from mscale as.list(xi) ## same but levels taken as integers 0, 1 as.list(xi, mscale = FALSE) ## only for first two items as.list(xi, items = 1:2) ## result as data.frame as.list(xi, df = TRUE) ## data frame with single itemresp column as.data.frame(xi) ## integer matrix as.matrix(xi) ## character vector as.character(xi) ## check class of xi is.itemresp(xi) } \keyword{classes} psychotools/man/YouthGratitude.Rd0000644000176200001440000001412012745627143016674 0ustar liggesusers\name{YouthGratitude} \alias{YouthGratitude} \title{Measuring Gratitude in Youth} \description{ Cross-section data on several gratitude scales for children and adolescents. } \usage{data("YouthGratitude")} \format{ A data frame containing 1405 observations on 28 variables. \describe{ \item{id}{Integer person ID.} \item{age}{Age in years (10--19 years).} \item{agegroup}{Factor coding of age with levels \code{"10-11"}, \code{"12-13"}, \code{"14"}, \code{"15"}, \code{"16"}, \code{"17-19"}.} \item{losd_1}{Life has been good to me.} \item{losd_2}{There never seems to be enough to go around, and I never seem to get my share. (Reverse scored.)} \item{losd_3}{I really don't think that I've gotten all the good things that I deserve in life. (Reverse scored.)} \item{losd_4}{More bad things have happened to me in my life than I deserve. (Reverse scored.)} \item{losd_5}{Because of what I've gone through in my life, I really feel like the world owes me something. (Reverse scored.)} \item{losd_6}{For some reason I never seem to get the advantages that others get. (Reverse scored.)} \item{sa_1}{Oftentimes I have been overwhelmed at the beauty of nature.} \item{sa_2}{Every Fall I really enjoy watching the leaves change colors.} \item{sa_3}{I think that it's important to 'Stop and smell the roses.'} \item{sa_4}{I think that it's important to pause often to 'count my blessings.'} \item{sa_5}{I think it's important to enjoy the simple things in life.} \item{sa_6}{I think it's important to appreciate each day that you are alive.} \item{ao_1}{I couldn't have gotten where I am today without the help of many people.} \item{ao_2}{Although I think it's important to feel good about your accomplishments, I think that it's also important to remember how others have contributed to my accomplishments.} \item{ao_3}{Although I'm basically in control of my life, I can't help but think about all those who have supported me and helped me along the way.} \item{ao_4}{I feel deeply appreciative for the things others have done for me in my life.} \item{gq6_1}{I have so much in life to be thankful for.} \item{gq6_2}{If I had to list everything that I felt thankful for, it would be a very long list.} \item{gq6_3}{When I look at the world, I don't see much to be thankful for.} \item{gq6_4}{I am thankful to a wide variety of people. (Reverse scored.)} \item{gq6_5}{As I get older I find myself more able to appreciate the people, events, and situations that have been part of my life history.} \item{gq6_6}{Long amounts of time can go by before I feel gratitude to something or someone. (Reverse scored.)} \item{gac_1}{Grateful.} \item{gac_2}{Thankful.} \item{gac_3}{Appreciative.} } } \details{ The gratitude scales employed are:\cr GRAT: Gratitude, Resentment, Appreciation Test (1--9).\cr Short form with subscales LOSD (lack of a sense of deprivation), SA (simple appreciation), and AO (appreciation for others).\cr GQ-6: Gratitude Questionnaire-6 (1--7).\cr GAC: Gratitude Adjective Checklist (1--5). The item \code{losd_1} has been omitted from all analyses in Froh et al. (2011) because it loaded lowly on all factors. Hence \code{losd_1} is not listed in Table B1 of Froh et al. (2011). Instead, the remaining items are labeled \code{losd_1} to \code{losd_5}. } \source{ Provided by Jeff Froh and Jinyan Fan. } \references{ Froh JJ, Fan J, Emmons RA, Bono G, Huebner ES, Watkins P (2011). Measuring Gratitude in Youth: Assessing the Psychometric Properties of Adult Gratitude Scales in Children and Adolescents. \emph{Psychological Assessment}, \bold{23}(2), 311--324. } \examples{ data("YouthGratitude", package = "psychotools") summary(YouthGratitude) ## modeling can be carried out using package lavaan \dontrun{ ## remove cases with 'imputed' values (not in 1, ..., 9) yg <- YouthGratitude[apply(YouthGratitude[, 4:28], 1, function(x) all(x %in% 1:9)), ] ## GQ-6 gq6_congeneric <- cfa( 'f1 =~ gq6_1 + gq6_2 + gq6_3 + gq6_4 + gq6_5', data = yg, group = "agegroup", meanstructure = TRUE) gq6_tauequivalent <- cfa( 'f1 =~ gq6_1 + gq6_2 + gq6_3 + gq6_4 + gq6_5', data = yg, group = "agegroup", meanstructure = TRUE, group.equal = "loadings") gq6_parallel <- cfa( 'f1 =~ gq6_1 + gq6_2 + gq6_3 + gq6_4 + gq6_5', data = yg, group = "agegroup", meanstructure = TRUE, group.equal = c("loadings", "residuals", "lv.variances")) anova(gq6_congeneric, gq6_tauequivalent, gq6_parallel) t(sapply( list(gq6_congeneric, gq6_tauequivalent, gq6_parallel), function(m) fitMeasures(m)[c("chisq", "df", "cfi", "srmr")] )) ## GAC gac_congeneric <- cfa( 'f1 =~ gac_1 + gac_2 + gac_3', data = yg, group = "agegroup", meanstructure = TRUE) gac_tauequivalent <- cfa( 'f1 =~ gac_1 + gac_2 + gac_3', data = yg, group = "agegroup", meanstructure = TRUE, group.equal = "loadings") gac_parallel <- cfa( 'f1 =~ gac_1 + gac_2 + gac_3', data = yg, group = "agegroup", meanstructure = TRUE, group.equal = c("loadings", "residuals", "lv.variances")) anova(gac_congeneric, gac_tauequivalent, gac_parallel) t(sapply( list(gac_congeneric, gac_tauequivalent, gac_parallel), function(m) fitMeasures(m)[c("chisq", "df", "cfi", "srmr")] )) ## GRAT grat_congeneric <- cfa( 'f1 =~ losd_2 + losd_3 + losd_4 + losd_5 + losd_6 f2 =~ sa_1 + sa_2 + sa_3 + sa_4 + sa_5 + sa_6 f3 =~ ao_1 + ao_2 + ao_3 + ao_4', data = yg, group = "agegroup", meanstructure = TRUE) grat_tauequivalent <- cfa( 'f1 =~ losd_2 + losd_3 + losd_4 + losd_5 + losd_6 f2 =~ sa_1 + sa_2 + sa_3 + sa_4 + sa_5 + sa_6 f3 =~ ao_1 + ao_2 + ao_3 + ao_4', data = yg, group = "agegroup", meanstructure = TRUE, group.equal = "loadings") grat_parallel <- cfa( 'f1 =~ losd_2 + losd_3 + losd_4 + losd_5 + losd_6 f2 =~ sa_1 + sa_2 + sa_3 + sa_4 + sa_5 + sa_6 f3 =~ ao_1 + ao_2 + ao_3 + ao_4', data = yg, group = "agegroup", meanstructure = TRUE, group.equal = c("loadings", "residuals", "lv.variances")) anova(grat_congeneric, grat_tauequivalent, grat_parallel) t(sapply( list(grat_congeneric, grat_tauequivalent, grat_parallel), function(m) fitMeasures(m)[c("chisq", "df", "cfi", "srmr")] )) } } \keyword{datasets} psychotools/man/upperpar.Rd0000644000176200001440000000751013405674164015555 0ustar liggesusers\name{upperpar} \alias{upperpar} \alias{upperpar.raschmodel} \alias{upperpar.rsmodel} \alias{upperpar.pcmodel} \alias{upperpar.plmodel} \alias{upperpar.gpcmodel} \alias{coef.upperpar} \alias{print.upperpar} \alias{vcov.upperpar} \title{Extract Upper Asymptote Parameters of Item Response Models} \description{ A class and generic function for representing and extracting the upper asymptote parameters of a given item response model. } \usage{ upperpar(object, \dots) \method{upperpar}{raschmodel}(object, alias = TRUE, vcov = TRUE, \dots) \method{upperpar}{rsmodel}(object, alias = TRUE, vcov = TRUE, \dots) \method{upperpar}{pcmodel}(object, alias = TRUE, vcov = TRUE, \dots) \method{upperpar}{plmodel}(object, alias = TRUE, logit = FALSE, vcov = TRUE, \dots) \method{upperpar}{gpcmodel}(object, alias = TRUE, vcov = TRUE, \dots) } \arguments{ \item{object}{a fitted model object whose upper asymptote parameters should be extracted.} \item{alias}{logical. If \code{TRUE} (the default), the aliased parameters are included in the return vector (and in the variance-covariance matrix if \code{vcov} = TRUE). If \code{FALSE}, these parameters are removed. For \code{raschmodel}s, \code{rsmodel}s, \code{pcmodel}s and \code{gpcmodel}s, where all upper asymptote parameters are fixed to 1, this means that an empty numeric vector and an empty variance-covariace matrix is returned if \code{alias} is \code{FALSE}.} \item{logit}{logical. If a \code{plmodel} of \code{type} \code{"3PLu"} or \code{"4PL"} model has been fit, the upper asymptote parameters were estimated on the logit scale. If \code{logit = FALSE}, these estimates and the variance-covariance (if requested) are retransformed using the logistic function and the delta method.} \item{vcov}{logical. If \code{TRUE} (the default), the variance-covariance matrix of the upper asymptote parameters is attached as attribute \code{vcov}.} \item{\dots}{further arguments which are currently not used.} } \details{ \code{upperpar} is both, a class to represent upper asymptote parameters of item response models as well as a generic function. The generic function can be used to extract the upper asymptote parameters of a given item response model. For objects of class \code{upperpar}, several methods to standard generic functions exist: \code{print}, \code{coef}, \code{vcov}. \code{coef} and \code{vcov} can be used to extract the upper asymptote parameters and their variance-covariance matrix without additional attributes. } \value{ A named vector with upper asymptote parameters of class \code{upperpar} and additional attributes \code{model} (the model name), \code{alias} (either \code{TRUE} or a named numeric vector with the aliased parameters not included in the return value), \code{logit} (indicating whether the estimates are on the logit scale or not), and \code{vcov} (the estimated and adjusted variance-covariance matrix). } \seealso{\code{\link{personpar}}, \code{\link{itempar}}, \code{\link{threshpar}}, \code{\link{discrpar}}, \code{\link{guesspar}}} \examples{ if(requireNamespace("mirt")) { o <- options(digits = 3) ## load simulated data data("Sim3PL", package = "psychotools") ## fit 2PL to data simulated under the 3PLu twoplmod <- plmodel(Sim3PL$resp2) ## extract the upper asymptote parameters (all fixed at 1) up1 <- upperpar(twoplmod) ## fit 3PLu to data simulated under the 3PLu threeplmodu <- plmodel(Sim3PL$resp2, type = "3PLu") ## extract the upper asymptote parameters up2 <- upperpar(threeplmodu) ## extract the standard errors sqrt(diag(vcov(up2))) ## extract the upper asymptote parameters on the logit scale up2_logit <- upperpar(threeplmodu, logit = TRUE) ## along with the delta transformed standard errors sqrt(diag(vcov(up2_logit))) options(digits = o$digits) } } \keyword{classes} psychotools/man/paircomp.Rd0000644000176200001440000001072311633517437015531 0ustar liggesusers\name{paircomp} \alias{paircomp} \alias{length.paircomp} \alias{c.paircomp} \alias{[.paircomp} \alias{rep.paircomp} \alias{xtfrm.paircomp} \alias{as.character.paircomp} \alias{as.data.frame.paircomp} \alias{as.double.paircomp} \alias{as.integer.paircomp} \alias{as.matrix.paircomp} \alias{covariates.paircomp} \alias{covariates<-.paircomp} \alias{labels.paircomp} \alias{labels<-.paircomp} \alias{names.paircomp} \alias{names<-.paircomp} \alias{mscale.paircomp} \alias{mscale<-.paircomp} \alias{str.paircomp} \alias{summary.paircomp} \alias{is.na.paircomp} \title{Data Structure for Paired Comparisons} \description{ A class for representing data from paired comparison experiments along with methods for many generic functions. } \usage{ paircomp(data, labels = NULL, mscale = NULL, ordered = FALSE, covariates = NULL) } \arguments{ \item{data}{matrix. A matrix with integer values where the rows correspond to subjects and the columns to paired comparisons between objects. See below for details.} \item{labels}{character. A vector of character labels for the objects. By default a suitable number of \code{letters} is used.} \item{mscale}{integer. A vector of integers giving the measurement scale. See below for details. By default guessed from \code{data}.} \item{ordered}{logical. Does \code{data} contain both orderings of each comparison?} \item{covariates}{data.frame. An optional data.frame with object covariates, i.e., it must have the same number of rows as the length of \code{labels}. May be \code{NULL} (default).} } \details{ \code{paircomp} is designed for holding paired comparisons of \eqn{k} objects measured for \eqn{n} subjects. The comparisons should be coded in an integer matrix \code{data} with \eqn{n} rows (subjects) and \eqn{k \choose 2} columns (unless \code{ordered = TRUE}, see below). The columns must be ordered so that objects are sequentially compared with all previous objects, i.e.: 1:2, 1:3, 2:3, 1:4, 2:4, 3:4, etc. Each column represents the results of a comparison for two particular objects. Positive values signal that the first object was preferred, negative values that the second was preferred, zero signals no preference. Larger absolute values signal stronger preference. \code{mscale} provides the underlying measurement scale. It must be a symmetric sequence of integers of type \code{(-i):i} where \code{i} must be at least \code{1}. However, it may exclude \code{0} (i.e., forced choice). If \code{ordered = TRUE}, the order of comparison matters and thus \code{data} is assumed to have twice as many columns. The second half of columns then corresponds to the comparisons 2:1, 3:1, 3:2, 4:1, 4:2, 4:3, etc. } \value{ \code{paircomp} returns an object of class \code{"paircomp"} which is a matrix (essentially \code{data}) with all remaining arguments of \code{paircomp} as attributes (after being checked and potentially suitably coerced or transformed). } \seealso{\code{\link{subset.paircomp}}, \code{\link{print.paircomp}}} \examples{ ## a simple paired comparison pc <- paircomp(rbind( c(1, 1, 1), # a > b, a > c, b > c c(1, 1, -1), # a > b, a > c, b < c c(1, -1, -1), # a > b, a < c, b < c c(1, 1, 1))) ## basic methods pc str(pc) summary(pc) pc[2:3] c(pc[2], pc[c(1, 4)]) ## methods to extract/set attributes labels(pc) labels(pc) <- c("ah", "be", "ce") pc mscale(pc) covariates(pc) covariates(pc) <- data.frame(foo = factor(c(1, 2, 2), labels = c("foo", "bar"))) covariates(pc) names(pc) names(pc) <- LETTERS[1:4] pc ## reorder() and subset() both select a subset of ## objects and/or reorders the objects reorder(pc, c("ce", "ah")) ## include paircomp object in a data.frame ## (i.e., with subject covariates) dat <- data.frame( x = rnorm(4), y = factor(c(1, 2, 1, 1), labels = c("hansi", "beppi"))) dat$pc <- pc dat ## formatting with long(er) labels and extended scale pc2 <- paircomp(rbind( c(4, 1, 0), c(1, 2, -1), c(1, -2, -1), c(0, 0, -3)), labels = c("Nordrhein-Westfalen", "Schleswig-Holstein", "Baden-Wuerttemberg")) ## default: abbreviate print(pc2) print(pc2, abbreviate = FALSE) print(pc2, abbreviate = FALSE, width = FALSE) ## paired comparisons with object covariates pc3 <- paircomp(rbind( c(2, 1, 0), c(1, 1, -1), c(1, -2, -1), c(0, 0, 0)), labels = c("New York", "Rio", "Tokyo"), covariates = data.frame(hemisphere = factor(c(1, 2, 1), labels = c("North", "South")))) covariates(pc3) } \keyword{classes} psychotools/man/rrsm.Rd0000644000176200001440000000342413752634464014706 0ustar liggesusers\name{rrsm} \alias{rrsm} \title{Simulate Data under a Rating Scale Model} \description{ \code{rrsm} simulates IRT data under a rating scale model.} \usage{ rrsm(theta, beta, tau, nullcats = FALSE, return_setting = TRUE) } \arguments{ \item{theta}{numeric vector of person parameters. Can also be a list, then a list of length \code{length(theta)} is returned, containing multiple simulated data sets.} \item{beta}{numeric vector of item difficulty parameters.} \item{tau}{numeric vector of threshold parameters.} \item{nullcats}{logical. Should null categories be allowed?} \item{return_setting}{logical. Should a list containing slots of "beta", "tau", and "theta", as well as the simulated data matrix "data" be returned (default) or only the simulated data matrix?} } \value{ \code{rrsm} returns either a list of the following components: \item{beta}{numeric vector of item difficulty parameters used,} \item{tau}{numeric vector of threshold parameters used,} \item{theta}{numeric vector (or list) of person parameters used,} \item{data}{numeric matrix containing the simulated data,} or (if \code{return_setting = FALSE}) only the numeric matrix containing the simulated data. } \seealso{\code{\link{rpcm}}, \code{\link{rgpcm}}, \code{\link{rrm}}, \code{\link{rpl}}} \examples{ set.seed(1) ## item responses under a rating scale model (RSM) with ## 6 persons with three different person parameters ## 9 increasingly difficult items ## 3 different threshold parameters ppar <- rep(-1:1, each = 2) ipar <- seq(-2, 2, by = 0.5) tpar <- 0:2 sim <- rrsm(theta = ppar, beta = ipar, tau = tpar) ## simulated item response data along with setting parameters sim ## print and plot corresponding item response object iresp <- itemresp(sim$data) iresp plot(iresp) } psychotools/man/GermanParties2009.Rd0000644000176200001440000000616412745627725017006 0ustar liggesusers\name{GermanParties2009} \alias{GermanParties2009} \encoding{latin1} \title{Choice among German Political Parties} \description{ Preferences of 192 respondents choosing among five German political parties and abstention from voting. } \usage{data("GermanParties2009")} \format{ A data frame containing 192 observations on 6 variables. \describe{ \item{preference}{Paired comparison of class \code{\link{paircomp}}. All 15 pairwise choices among five German parties and abstention from voting.} \item{ordered.pref}{Ordered paired comparison of class \code{\link{paircomp}}. Same as \code{preference}, but within-pair order is recognized.} \item{gender}{Factor coding gender.} \item{age}{Integer. Age of the respondents in years.} \item{education}{Ordered factor. Level of education: 1 no degree, 2 Hauptschule (Secondary General School), 3 Realschule (Intermediate Secondary School), 4 Gymnasium (High School), 5 Studium (University)} \item{crisis}{Factor. Do you feel affected by the economic crisis?} \item{interviewer}{Factor. Interviewer id.} } } \details{ A survey was conducted at the Department of Psychology, Universitt Tbingen, in June 2009, three months before the German election. The sample was stratified by gender and age (younger versus older than 30 years) with 48 participants in each group. The parties to be compared were Die Linke (socialists), Die Grnen (ecologists), SPD (social democrats), CDU/CSU (conservatives), and FDP (liberals). In addition, there was the option of abstaining from voting (coded as \code{none}). Participants were presented with 15 pairs of options in random order. On each trial, their task was to choose the party they would rather vote for at an election for the German parliament. A given participant compared each pair in one order only, hence the NA's in \code{ordered.pref}. In order to minimize response biases, the pairs of options were read to the participants one at a time. Participants made their choices by crossing either \dQuote{First Option} or \dQuote{Second Option} on an anonymous response sheet. The interviewers were Psychology Master's students who collected the data for course credits. Since they mainly interviewed people they knew, the results are not representative of the political opinions in Germany. As far as the winner of the survey (Die Grnen) is concerned, however, the results agree with the outcome of the election for the Tbingen voters. The results of the election on September 27, 2009 (number of so-called Zweitstimmen in percent) were: \tabular{lrr}{ \tab Germany \tab Tbingen\cr Die Linke \tab 11.9 \tab 8.5\cr Die Grnen \tab 10.7 \tab 27.9\cr SPD \tab 23.0 \tab 21.1\cr CDU/CSU \tab 33.8 \tab 23.0\cr FDP \tab 14.6 \tab 13.9\cr Others \tab 6.0 \tab 5.7\cr } The voter turnout was 70.8 percent in Germany and 80.5 percent in Tbingen. } \seealso{\code{\link{paircomp}}} \examples{ data("GermanParties2009", package = "psychotools") summary(GermanParties2009$preference) } \keyword{datasets} psychotools/man/rpcm.Rd0000644000176200001440000000325313750026052014646 0ustar liggesusers\name{rpcm} \alias{rpcm} \title{Simulate Data under a Partial Credit Model} \description{ \code{rpcm} simulates IRT data under a partial credit model.} \usage{ rpcm(theta, delta, nullcats = FALSE, return_setting = TRUE) } \arguments{ \item{theta}{numeric vector of person parameters. Can also be a list, then a list of length \code{length(theta)} is returned, containing multiple simulated data sets.} \item{delta}{list of numeric vectors of item threshold parameters.} \item{nullcats}{logical. Should null categories be allowed?} \item{return_setting}{logical. Should a list containing slots of "delta", and "theta", as well as the simulated data matrix "data" be returned (default) or only the simulated data matrix?} } \value{ \code{rpcm} returns either a list of the following components: \item{delta}{list of numeric vectors of item threshold parameters used,} \item{theta}{numeric vector of person parameters used,} \item{data}{numeric matrix containing the simulated data,} or (if \code{return_setting = FALSE}) only the numeric matrix containing the simulated data. } \seealso{\code{\link{rgpcm}}, \code{\link{rrsm}}, \code{\link{rrm}}, \code{\link{rpl}}} \examples{ set.seed(1) ## item responses under a partial credit model (PCM) with ## 6 persons with three different person parameters ## 8 items with different combinations of two or three threshold parameters ppar <- rep(-1:1, each = 2) tpar <- rep(list(-2:0, -1:1, 0:1, 0:2), each = 2) sim <- rpcm(theta = ppar, delta = tpar) ## simulated item response data along with setting parameters sim ## print and plot corresponding item response object iresp <- itemresp(sim$data) iresp plot(iresp) } psychotools/man/worth.Rd0000644000176200001440000000131113406036446015047 0ustar liggesusers\name{worth} \alias{worth} \title{Extract Worth Parameters} \description{ Generic functions for extracting worth parameters from paired comparison models. } \usage{ worth(object, \dots) } \arguments{ \item{object}{an object.} \item{\dots}{arguments passed to methods.} } \details{ Since version 0.3-0, calls to \code{worth} are internally passed over to \code{itempar}. } \seealso{\code{\link{btmodel}}, \code{\link{raschmodel}}} \examples{ o <- options(digits = 4) ## data data("GermanParties2009", package = "psychotools") ## Bradley-Terry model bt <- btmodel(GermanParties2009$preference) ## worth parameters worth(bt) ## or itempar(bt) options(digits = o$digits) } \keyword{classes} psychotools/man/rpl.Rd0000644000176200001440000000460214030723513014477 0ustar liggesusers\name{rpl} \alias{rpl} \title{Simulate Data under a Parametric Logistic IRT Model} \description{ \code{rpl} simulates IRT data under a parametric logistic IRT model of type "2PL", "3PL", "3PLu", "4PL", and "Rasch/1PL". } \usage{ rpl(theta, a = NULL, b, g = NULL, u = NULL, return_setting = TRUE) } \arguments{ \item{theta}{numeric vector of person parameters. Can also be a list, then a list of length \code{length(theta)} is returned, containing multiple simulated data matrices.} \item{a}{numeric vector of item discrimination parameters. If \code{NULL}, by default set to a vector of ones of length \code{length(b)}.} \item{b}{numeric vector of item difficulty parameters.} \item{g}{numeric vector of so-called item guessing parameters. If \code{NULL}, by default set to a vector of zeroes of length \code{length(b)}.} \item{u}{numeric vector of item upper asymptote parameters. If \code{NULL}, by default set to a vector of ones of length \code{length(b)}.} \item{return_setting}{logical. Should a list containing slots of "a", "b", "g", "u", and "theta", as well as the simulated data matrix "data" be returned (default) or only the simulated data matrix.} } \value{ \code{rpl} returns either a list of the following components: \item{a}{numeric vector of item discrimination parameters used,} \item{b}{numeric vector of item difficulty parameters used,} \item{g}{numeric vector of item guessing parameters used,} \item{u}{numeric vector of item upper asymptote parameters used,} \item{theta}{numeric vector of person parameters used,} \item{data}{numeric matrix containing the simulated data,} or (if \code{return_setting = FALSE}) only the numeric matrix containing the simulated data. } \seealso{\code{\link{rrm}}, \code{\link{rgpcm}}, \code{\link{rpcm}}, \code{\link{rrsm}}} \examples{ set.seed(1) ## item responses under a 2PL (two-parameter logistic) model from ## 6 persons with three different person parameters ## 9 increasingly difficult items and corresponding discrimination parameters ## no guessing (= 0) and upper asymptote 1 ppar <- rep(c(-2, 0, 2), each = 2) ipar <- seq(-2, 2, by = 0.5) dpar <- rep(c(0.5, 1, 1.5), each = 3) sim <- rpl(theta = ppar, a = dpar, b = ipar) ## simulated item response data along with setting parameters sim ## print and plot corresponding item response object iresp <- itemresp(sim$data) iresp plot(iresp) } psychotools/man/mptmodel.Rd0000644000176200001440000000664013356511544015540 0ustar liggesusers\name{mptmodel} \alias{mptmodel} \alias{coef.mptmodel} \alias{confint.mptmodel} \alias{deviance.mptmodel} \alias{estfun.mptmodel} \alias{logLik.mptmodel} \alias{predict.mptmodel} \alias{print.mptmodel} \alias{summary.mptmodel} \alias{print.summary.mptmodel} \alias{vcov.mptmodel} \alias{mptspec} \alias{print.mptspec} \alias{update.mptspec} \title{Multinomial Processing Tree (MPT) Model Fitting Function} \description{ \code{mptmodel} is a basic fitting function for multinomial processing tree (MPT) models. } \usage{ mptmodel(y, weights = NULL, spec, treeid = NULL, optimargs = list(control = list(reltol = .Machine$double.eps^(1/1.2), maxit = 1000), init = NULL), start = NULL, vcov = TRUE, estfun = FALSE, \dots) } \arguments{ \item{y}{matrix of response frequencies.} \item{weights}{an optional vector of weights (interpreted as case weights).} \item{spec}{an object of class \code{mptspec}: typically result of a call to \code{\link{mptspec}}. A symbolic description of the model to be fitted.} \item{treeid}{a vector that identifies each tree in a joint multinomial model.} \item{optimargs}{a list of arguments passed to the optimization function (\code{\link{optim}}).} \item{start}{a vector of starting values for the parameter estimates between zero and one.} \item{vcov}{logical. Should the estimated variance-covariance be included in the fitted model object?} \item{estfun}{logical. Should the empirical estimating functions (score/gradient contributions) be included in the fitted model object?} \item{\dots}{further arguments passed to functions.} } \details{ \code{mptmodel} provides a basic fitting function for multinomial processing tree (MPT) models, intended as a building block for fitting MPT trees in the \pkg{psychotree} package. While \code{mptmodel} is intended for individual response frequencies, the \pkg{mpt} package provides functions for aggregate data. MPT models are specified using the \code{mptspec} function. See the documentation in the \pkg{mpt} package for details. \code{mptmodel} returns an object of class \code{"mptmodel"} for which several basic methods are available, including \code{print}, \code{plot}, \code{summary}, \code{coef}, \code{vcov}, \code{logLik}, \code{estfun} and \code{\link{predict}}. } \value{ \code{mptmodel} returns an S3 object of class \code{"mptmodel"}, i.e., a list with components as follows: \item{y}{a matrix with the response frequencies,} \item{coefficients}{estimated parameters (for extraction, the \code{coef} function is preferred),} \item{loglik}{log-likelihood of the fitted model,} \item{npar}{number of estimated parameters,} \item{weights}{the weights used (if any),} \item{nobs}{number of observations (with non-zero weights),} \item{ysum}{the aggregate response frequencies,} \item{fitted, goodness.of.fit, ...}{see \code{mpt} in the \pkg{mpt} package.} } \seealso{\code{\link{btmodel}}, \code{\link{pcmodel}}, \code{\link{gpcmodel}}, \code{\link{rsmodel}}, \code{\link{raschmodel}}, \code{\link{plmodel}}, \code{\link{mptspec}}, the \pkg{mpt} package} \examples{ o <- options(digits = 4) ## data data("SourceMonitoring", package = "psychotools") ## source-monitoring MPT model mpt1 <- mptmodel(SourceMonitoring$y, spec = mptspec("SourceMon")) summary(mpt1) plot(mpt1) options(digits = o$digits) } \keyword{regression} psychotools/man/curveplot.Rd0000644000176200001440000000706513613777122015746 0ustar liggesusers\name{curveplot} \alias{curveplot} \title{Response Curve Plots for IRT Models} \description{ Base graphics plotting function for response curve plot visualization of IRT models. } \usage{ curveplot(object, ref = NULL, items = NULL, names = NULL, layout = NULL, xlim = NULL, ylim = c(0, 1), col = NULL, lty = NULL, main = NULL, xlab = "Latent trait", ylab = "Probability", add = FALSE, \dots) } \arguments{ \item{object}{a fitted model object of class \code{"raschmodel"}, \code{"rsmodel"}, \code{"pcmodel"}, \code{"plmodel"} or \code{"gpcmodel"}.} \item{ref}{argument passed over to internal calls of \code{\link{predict}}.} \item{items}{character or numeric, specifying the items for which response curves should be visualized.} \item{names}{character, specifying labels for the items.} \item{layout}{matrix, specifying how the response curve plots of different items should be arranged.} \item{xlim, ylim}{numeric, specifying the x and y axis limits.} \item{col}{character, specifying the colors of the response curve lines. The length of \code{col} should be the maximum number of available categories.} \item{lty}{numeric, specifying the line type of the response curve lines. The length of \code{lty} should either be one or the maximum number of available categories. In the first case, a single line type is used for all category response curves. In the latter case, separate line types for each category response curve are used.} \item{main}{character, specifying the overall title of the plot.} \item{xlab, ylab}{character, specifying the x and y axis labels.} \item{add}{logical. If \code{TRUE}, new response curves are added to an existing plot. Only possible when a single item is visualized.} \item{\dots}{further arguments passed to internal calls of \code{\link{matplot}}.} } \details{ The response curve plot visualization illustrates the predicted probabilities as a function of the ability parameter \eqn{\theta} under a certain IRT model. This type of visualization is sometimes also called item/category operating curves or item/category characteristic curves. } \seealso{\code{\link{regionplot}}, \code{\link{profileplot}}, \code{\link{infoplot}}, \code{\link{piplot}}} \examples{ ## load verbal aggression data data("VerbalAggression", package = "psychotools") ## fit Rasch, rating scale and partial credit model to verbal aggression data rmmod <- raschmodel(VerbalAggression$resp2) rsmod <- rsmodel(VerbalAggression$resp) pcmod <- pcmodel(VerbalAggression$resp) ## curve plots of the dichotomous RM plot(rmmod, type = "curves") ## curve plots under the RSM for the first six items of the data set plot(rsmod, type = "curves", items = 1:6) ## curve plots under the PCM for the first six items of the data set with ## custom labels plot(pcmod, type = "curves", items = 1:6, names = paste("Item", 1:6)) ## compare the predicted probabilities under the RSM and the PCM for a single ## item plot(rsmod, type = "curves", item = 1) plot(pcmod, type = "curves", item = 1, lty = 2, add = TRUE) legend(x = "topleft", y = 1.0, legend = c("RSM", "PCM"), lty = 1:2, bty = "n") \donttest{ if(requireNamespace("mirt")) { ## fit 2PL and generaliced partial credit model to verbal aggression data twoplmod <- plmodel(VerbalAggression$resp2) gpcmod <- gpcmodel(VerbalAggression$resp) ## curve plots of the dichotomous 2PL plot(twoplmod, type = "curves", xlim = c(-6, 6)) ## curve plots under the GPCM for the first six items of the data set plot(gpcmod, type = "curves", items = 1:6, xlim = c(-6, 6)) } } } \keyword{aplot} psychotools/man/mscale.Rd0000644000176200001440000000153112401556440015147 0ustar liggesusers\name{mscale} \alias{mscale} \alias{mscale<-} \title{Extract/Replace Measurement Scale} \description{ Generic functions for extracting and replacing the measurement scale from an object. } \usage{ mscale(object, \dots) mscale(object) <- value } \arguments{ \item{object}{an object.} \item{\dots}{arguments passed to methods.} \item{value}{an object describing the measurement scale.} } \examples{ ## methods for "paircomp" data pc <- paircomp(rbind( c(2, 1, 0), c(1, 1, -1), c(1, -2, -1), c(0, 0, 0))) pc ## extract mscale(pc) ## replace (collapse to >/=/< scale) mscale(pc) <- sign(mscale(pc)) pc ## similar for "itemresp" data ir <- itemresp(cbind( c(-1, 0, 1, 1, 0), c(0, 1, 2, 1, 2), c(1, 2, 1, 1, 3))) ir ## extract mscale(ir) ## replace (single scale for all items) mscale(ir) <- 1:3 ir } \keyword{classes} psychotools/man/rrm.Rd0000644000176200001440000000274613751360054014517 0ustar liggesusers\name{rrm} \alias{rrm} \title{Simulate Data under a Rasch model} \description{ \code{rrm} simulates IRT data under a Rasch model. } \usage{ rrm(theta, beta, return_setting = TRUE) } \arguments{ \item{theta}{numeric vector of person parameters. Can also be a list, then a list of length \code{length(theta)} is returned, containing multiple simulated data matrices.} \item{beta}{numeric vector of item difficulty parameters.} \item{return_setting}{logical. Should a list containing slots of "beta", and "theta", as well as the simulated data matrix "data" be returned (default) or only the simulated data matrix.} } \value{ \code{rrm} returns either a list of the following components: \item{beta}{numeric vector of item difficulty parameters used,} \item{theta}{numeric vector of person parameters used,} \item{data}{numeric matrix containing the simulated data,} or (if \code{return_setting = FALSE}) only the numeric matrix containing the simulated data. } \seealso{\code{\link{rpl}}, \code{\link{rpcm}}, \code{\link{rrsm}}, \code{\link{rgpcm}}} \examples{ set.seed(1) ## item responses under a Rasch model from ## 6 persons with three different person parameters ## 9 increasingly difficult items ppar <- rep(-1:1, each = 2) ipar <- seq(-2, 2, by = 0.5) sim <- rrm(theta = ppar, beta = ipar) ## simulated item response data along with setting parameters sim ## print and plot corresponding item response object iresp <- itemresp(sim$data) iresp plot(iresp) } psychotools/man/MathExam14W.Rd0000644000176200001440000001266413277176104015723 0ustar liggesusers\name{MathExam14W} \alias{MathExam14W} \encoding{latin1} \title{Mathematics 101 Exam Results} \description{ Responses of 729 students to 13 items in a written exam of introductory mathematics along with several covariates. } \usage{data("MathExam14W")} \format{ A data frame containing 729 observations on 9 variables. \describe{ \item{solved}{Item response matrix (of class \code{\link{itemresp}}) with values 1/0 coding solved correctly/other.} \item{credits}{Item response matrix (of class \code{\link{itemresp}}) with values 2/1/0 coding solved correctly/incorrectly/not attempted.} \item{nsolved}{Integer. The number of items solved correctly.} \item{tests}{Integer. The number of online test exercises solved correctly prior to the written exam.} \item{gender}{Factor indicating gender.} \item{study}{Factor indicating two different types of business/economics degrees. Either the 3-year bachelor program (571) or the 4-year diploma program (155).} \item{semester}{Integer. The number of semesters enrolled in the given university program.} \item{attempt}{Factor. The number of times the course/exam has been attempted (including the current attempt).} \item{group}{Factor indicating whether the students were in the first or second batch (with somewhat different items) in the exam.} } } \details{ The data provides individual end-term exam results from a Mathematics 101 course for first-year business and economics students at Universit\enc{}{ae}t Innsbruck. The format of the course comprised biweekly online tests (26 numeric exercises, conducted in OpenOLAT) and a written exam at the end of the semester (13 single-choice exercises with five answer alternatives). The course covers basics of analysis, linear algebra, financial mathematics, and probability calculus (where the latter is not assessed in this exam). In this exam, 729 students participated (out of 941 registered in the course). To avoid cheating, all students received items with essentially the same questions but different numbers (using the exams infrastructure of Zeileis et al. 2014). Also, due to the large number of students two groups of students had to be formed which received partially different items. The items which differed (namely 1, 5, 6, 7, 8, 9, 11, 12) varied in the setup/story, but not in the mathematical skills needed to solve the exercises. Prior to the exam, the students could select themselves either into the first group (early in the morning) or the second group (starting immediately after the end of the first group). Correctly solved items yield 100 percent of the associated points. Items without correct solution can either be unanswered (0 percent) or receive an incorrect answer (minus 25 percent) to discourage random guessing. In the examples below, the items are mostly only considered as binary. Typically, students with 8 out of 13 correct answers passed the course. } \source{ Department of Statistics, Universit\enc{}{ae}t Innsbruck } \references{ Zeileis A, Umlauf N, Leisch F (2014). Flexible Generation of E-Learning Exams in R: Moodle Quizzes, OLAT Assessments, and Beyond. \emph{Journal of Statistical Software}, \bold{58}(1), 1--36. doi:10.18637/jss.v058.i01 } \seealso{\code{\link{itemresp}}, \code{\link{raschmodel}}, \code{\link{pcmodel}}, \code{\link{anchortest}}} \examples{ ## load data and exclude extreme scorers data("MathExam14W", package = "psychotools") MathExam14W <- transform(MathExam14W, points = 2 * nsolved - 0.5 * rowSums(credits == 1) ) me <- subset(MathExam14W, nsolved > 0 & nsolved < 13) ## item response data: ## solved (correct/other) or credits (correct/incorrect/not attempted) par(mfrow = c(1, 2)) plot(me$solved) plot(me$credits) ## PCA pr <- prcomp(me$solved, scale = TRUE) names(pr$sdev) <- 1:10 plot(pr, main = "", xlab = "Number of components") biplot(pr, col = c("transparent", "black"), main = "", xlim = c(-0.065, 0.005), ylim = c(-0.04, 0.065)) ## points achieved (and 50% threshold) par(mfrow = c(1, 1)) hist(MathExam14W$points, breaks = -4:13 * 2 + 0.5, col = "lightgray", main = "", xlab = "Points") abline(v = 12.5, lwd = 2, col = 2) ## Rasch and partial credit model ram <- raschmodel(me$solved) pcm <- pcmodel(me$credits) ## various types of graphics displays plot(ram, type = "profile") plot(pcm, type = "profile", add = TRUE, col = "blue") plot(ram, type = "piplot") plot(pcm, type = "piplot") plot(ram, type = "region") plot(pcm, type = "region") plot(ram, type = "curves") plot(pcm, type = "curves") \donttest{ ## test for differential item function with automatic anchoring ## passing vs. not passing students at1 <- anchortest(solved ~ factor(nsolved <= 7), data = me, adjust = "single-step") at1 plot(at1$final_tests) ## -> "good" students discriminate somewhat more ## (quad/payflow/lagrange are slightly more difficult) ## group 1 vs. group 2 at2 <- anchortest(solved ~ group, data = me, adjust = "single-step") at2 plot(at2$final_tests) ## -> quad/payflow/planning easier for group 1 ## -> hesse slightly easier for group 2 ## bring out differences between groups 1 and 2 ## by (anchored) item difficulty profiles ram1 <- raschmodel(subset(me, group == "1")$solved) ram2 <- raschmodel(subset(me, group == "2")$solved) plot(ram1, parg = list(ref = at2$anchor_items), ylim = c(-2, 3)) plot(ram2, parg = list(ref = at2$anchor_items), add = TRUE, col = "blue") legend("topleft", c("Group 1", "Group 2"), pch = 21, pt.bg = c("lightgray", "blue"), bty = "n") } } \keyword{datasets} psychotools/man/anchortest.Rd0000644000176200001440000002250714122241050016051 0ustar liggesusers\name{anchortest} \alias{anchortest} \alias{anchortest.default} \alias{anchortest.formula} \alias{print.anchortest} \alias{print.summary.anchortest} \alias{summary.anchortest} \title{ Anchor methods for the detection of uniform DIF in the Rasch model } \description{ The \code{anchortest} function provides a Wald test (see, e.g., Glas, Verhelst, 1995) for the detection of uniform differential item functioning (DIF) in the Rasch model between two pre-specified groups. A variety of anchor methods is available to build a common scale necessary for the comparison of the item parameters in the Rasch model. } \usage{ anchortest(object, \dots) \method{anchortest}{default}(object, object2, class = c("constant", "forward", "all-other", "fixed"), select = NULL, test = TRUE, adjust = "none", length = NULL, range = c(0.1, 0.8), \dots) \method{anchortest}{formula}(formula, data = NULL, subset = NULL, na.action = NULL, weights = NULL, model = raschmodel, \dots) } \arguments{ \item{object, object2}{Fitted model objects of class ``raschmodel'' estimated via conditional maximum likelihood using \code{\link{raschmodel}}.} \item{\dots}{further arguments passed over to an internal call of \code{\link{anchor.default}} in the formula method. In the default method, these additional arguments are currently not being used.} \item{class}{character. Available anchor classes are the \code{constant} anchor class implying a constant anchor length defined by \code{length}, the iterative \code{forward} anchor class that iteratively includes items in the anchor and the \code{all-other} anchor class, for an overview see Kopf et al. (2015a). Additionally, the class can be \code{fixed}, then \code{select} needs to be the numeric index of the fixed selected anchor items.} \item{select}{character or numeric. Several anchor selection strategies are available, for details see \code{\link{anchor}}. Alternatively, for \code{class = "fixed"}, \code{select} needs to be the numeric index of the fixed selected anchor items. Defaults are set such that \code{class = "constant"} is combined with \code{select = "Gini"} while \code{class = "forward"} is combined with \code{select = "MTT"}. And if \code{select} is numeric, then \code{class = "fixed"} is used.} \item{test}{logical. Should the Wald test be returned for the intended anchor method as final DIF test?} \item{adjust}{character. Should the final DIF test be adjusted for multiple testing? For the type of adjustment, see \code{\link[multcomp]{summary.glht}} and \code{\link{p.adjust}}.} \item{length}{integer. It pre-defines a maximum anchor length. Per default, the \code{forward} anchor grows up to the proportion of currently presumed DIF-free items specified in \code{range} and the \code{constant} anchor class selects four anchor items, unless an explicit limiting number is defined in \code{length} by the user.} \item{range}{numeric vector of length 2. The first element is the percentage of first anchor candidates to be excluded for consideration when the \code{forward} anchor class is used and the second element determines a percentage of currently presumed DIF-free items up to which the anchor from the \code{forward} anchor class is allowed to grow.} \item{formula}{formula of type \code{y ~ x} where \code{y} specifies a matrix of dichotomous item responses and \code{x} the grouping variable, e.g., gender, for which DIF should be tested for.} \item{data}{a data frame containing the variables of the specified \code{formula}.} \item{subset}{logical expression indicating elements or rows to keep: missing values are taken as false.} \item{na.action}{a function which indicates what should happen when the data contain missing values (\code{NA}s).} \item{weights}{an optional vector of weights (interpreted as case weights).} \item{model}{an IRT model fitting function with a suitable \code{itempar} method, by default \code{\link{raschmodel}}.} } \details{ To conduct the Wald test (see, e.g., Glas, Verhelst, 1995) for uniform DIF in the Rasch model, the user needs to specify an anchor method. The anchor methods can be divided in an anchor class that determines characteristics of the anchor method and an anchor selection that determines the ranking order of candidate anchor items. Explicit anchor selection strategies are used in the \code{constant} anchor class and in the iterative \code{forward} anchor class, for a detailed description see \code{\link{anchor}}. Since \eqn{k-1}{k-1} parameters are free in the estimation, only \eqn{k-1}{k-1} estimated standard errors result. Thus, the first anchor item obtains no DIF test result and we report \eqn{k-1}{k-1} test results. This decision is applied only to those methods that rely on an explicit anchor selection strategy. In the \code{constant} anchor class, the anchor length is pre-defined by the user within the argument \code{length}. The default is a single anchor item. The iterative \code{forward} class starts with a single anchor item and includes items in the anchor as long as the anchor length is shorter than a certain percentage of the number of items that do not display statistically significant DIF. The default proportion is set to 0.8 in the argument \code{range}. Alternatively, the user is allowed to set a maximum number of anchor items using the argument \code{length}. Both anchor classes require an explicit anchor selection strategy as opposed to the \code{all-other} anchor class. The \code{all-other} anchor class is here not considered as explicit anchor selection and, thus, only included in the \code{anchortest} function. For the \code{all-other} anchor class, the strategy is set to \code{"none"}, since all items except for the item currently studied for DIF are used as anchor. Thus, no explicit anchor selection strategy is required and we report \eqn{k}{k} test results. Note that the \code{all-other} anchor class requires strong prior knowledge that DIF is balanced. See Strobl et al. (2021) and Kopf et al. (2015ab) for a detailed introduction. For convenience a trivial \code{"fixed"} anchor class is provided where the \code{select}ed anchor is given directly (e.g., as chosen by a practitioner or by some other anchor selection method). } \value{ An object of class \code{anchor}, i.e. a list including \item{anchor_items}{the anchor items for DIF analysis.} \item{ranking_order}{a ranking order of candidate anchor items.} \item{criteria}{the criterion values obtained by the respective anchor selection.} \item{anchored_item_parameters}{ the anchored item parameters using the anchor items.} \item{anchored_covariances}{the anchored covariance matrices using the anchor items.} \item{final_tests}{the final Wald test for uniform DIF detection if intended.} } \references{ Glas CAW, Verhelst ND (1995). \dQuote{Testing the Rasch Model.} In Fischer GH, Molenaar IW (eds.), \emph{Rasch Models: Foundations, Recent Developments, and Applications}, chapter 5. Springer-Verlag, New York. Kopf J, Zeileis A, Strobl C (2015a). A Framework for Anchor Methods and an Iterative Forward Approach for DIF Detection. \emph{Applied Psychological Measurement}, \bold{39}(2), 83--103. \doi{10.1177/0146621614544195} Kopf J, Zeileis A, Strobl C (2015b). Anchor Selection Strategies for DIF Analysis: Review, Assessment, and New Approaches. \emph{Educational and Psychological Measurement}, \bold{75}(1), 22--56. \doi{10.1177/0013164414529792} Strobl C, Kopf J, Kohler L, von Oertzen T, Zeileis A (2021). Anchor Point Selection: Scale Alignment Based on an Inequality Criterion. \emph{Applied Psychological Measurement}, \bold{45}(3), 214--230. \doi{10.1177/0146621621990743} Wang WC (2004). Effects of Anchor Item Methods on the Detection of Differential Item Functioning within the Family of Rasch Models. \emph{Journal of Experimental Education}, \bold{72}(3), 221--261. Woods C (2009). Empirical Selection of Anchors for Tests of Differential Item Functioning. \emph{Applied Psychological Measurement}, \bold{33}(1), 42--57. } \seealso{\code{\link{anchor}}} \examples{ if(requireNamespace("multcomp")) { o <- options(digits = 4) ## Verbal aggression data data("VerbalAggression", package = "psychotools") ## Rasch model for the self-to-blame situations; gender DIF test raschmodels <- with(VerbalAggression, lapply(levels(gender), function(i) raschmodel(resp2[gender == i, 1:12]))) ## single anchor from Gini selection (default) gini1 <- anchortest(object = raschmodels[[1]], object2 = raschmodels[[2]]) gini1 summary(gini1) ## four anchor items from constant anchor class using MPT selection const1 <- anchortest(object = raschmodels[[1]], object2 = raschmodels[[2]], class = "constant", select = "MPT", length = 4) const1 summary(const1) ## iterative forward anchor class using MTT selection set.seed(1) forw1 <- anchortest(object = raschmodels[[1]], object2 = raschmodels[[2]], class = "forward", select = "MTT", test = TRUE, adjust = "none", range = c(0.05,1)) forw1 ## DIF test with fixed given anchor (arbitrarily selected to be items 1 and 2) anchortest(object = raschmodels[[1]], object2 = raschmodels[[2]], select = 1:2) options(digits = o$digits) } } \keyword{regression} psychotools/man/pcmodel.Rd0000644000176200001440000001604313356511544015340 0ustar liggesusers\name{pcmodel} \alias{pcmodel} \alias{PCModel.fit} \alias{print.pcmodel} \alias{summary.pcmodel} \alias{print.summary.pcmodel} \alias{coef.pcmodel} \alias{bread.pcmodel} \alias{estfun.pcmodel} \alias{logLik.pcmodel} \alias{vcov.pcmodel} \title{Partial Credit Model Fitting Function} \description{ \code{pcmodel} is a basic fitting function for partial credit models. } \usage{ pcmodel(y, weights = NULL, nullcats = c("keep", "downcode", "ignore"), start = NULL, reltol = 1e-10, deriv = c("sum", "diff"), hessian = TRUE, maxit = 100L, full = TRUE, \dots) } \arguments{ \item{y}{item response object that can be coerced (via \code{\link[base]{as.matrix}}) to a numeric matrix with scores 0, 1, \dots Typically, either already a matrix, data frame, or dedicated object of class \code{\link{itemresp}}.} \item{weights}{an optional vector of weights (interpreted as case weights).} \item{deriv}{character. If "sum" (the default), the first derivatives of the elementary symmetric functions are calculated with the sum algorithm. Otherwise ("diff") the difference algorithm (faster but numerically unstable) is used.} \item{nullcats}{character string, specifying how items with null categories (i.e., categories not observed) should be treated (see details below).} \item{start}{an optional vector of starting values.} \item{hessian}{logical. Should the Hessian of the final model be computed? If set to \code{FALSE}, the \code{vcov} method can only return \code{NA}s and consequently no standard errors or tests are available in the \code{summary}.} \item{reltol, maxit, \dots}{further arguments passed to \code{\link[stats]{optim}}.} \item{full}{logical. Should a full model object be returned? If set to \code{FALSE}, no variance-covariance matrix and no matrix of estimating functions are computed.} } \details{ \code{pcmodel} provides a basic fitting function for partial credit models, intended as a building block for fitting partial credit trees. It estimates the partial credit model suggested by Masters (1982) under the cumulative threshold parameterization, i.e., the item-category parameters \eqn{\eta_{jk} = \sum_{\ell = 1}^{k}\delta_{jk}} are estimated by the the function \code{pcmodel}. Null categories, i.e., categories which have not been used, can be problematic when estimating a partial credit model. Several strategies have been suggested to cope with null categories. \code{pcmodel} allows to select from three possible strategies via the argument \code{nullcats}. If \code{nullcats} is set to \code{"keep"} (the default), the strategy suggested by Wilson & Masters (1993) is used to handle null categories. That basically means that the integrity of the response framework is maintained, i.e., no category scores are changed. This is not the case, when \code{nullcats} is set to \code{"downcode"}. Then all categories above a null category are shifted down to close the existing gap. In both cases (\code{"keep"} and \code{"downcode"}) the number of estimated parameters is reduced by the number of null categories. When \code{nullcats} is set to \code{"ignore"}, these are literally ignored and a threshold parameter is estimated during the optimization nevertheless. This strategy is used by the related package \pkg{eRm} when fitting partial credit models via \code{eRm::PCM}. \code{pcmodel} returns an object of class \code{"pcmodel"} for which several basic methods are available, including \code{print}, \code{plot}, \code{summary}, \code{coef}, \code{vcov}, \code{logLik}, \code{\link{discrpar}}, \code{\link{itempar}}, \code{estfun}, \code{\link{threshpar}}, and \code{\link{personpar}}. } \value{ \code{pcmodel} returns an S3 object of class \code{"pcmodel"}, i.e., a list the following components: \item{coefficients}{a named vector of estimated item-category parameters (without the first item-category parameter which is constrained to 0),} \item{vcov}{covariance matrix of the parameters in the model,} \item{data}{modified data, used for model-fitting, i.e., cleaned for items without variance, centralized so that the first category is zero for all items, treated null categories as specified via argument \code{"nullcats"} and without observations with zero weight. Be careful, this is different than for objects of class \code{"raschmodel"} or \code{"btmodel"}, where \code{data} contains the \emph{original} data,} \item{items}{logical vector of length \code{ncol(dat)}, indicating which items have variance (\code{TRUE}), i.e., are identified and have been used for the estimation or not (\code{FALSE}),} \item{categories}{list of length \code{ncol(y)}, containing integer vectors starting from one to the number of categories minus one per item,} \item{n}{number of observations (with non-zero weights),} \item{n_org}{original number of observations in \code{y},} \item{weights}{the weights used (if any),} \item{na}{logical indicating whether the data contain NAs,} \item{nullcats}{either \code{NULL} or, if there have been null categories, a list of length \code{ncol(y)} with logical vectors specifying which categories are null categories (\code{TRUE}) or not (\code{FALSE}),} \item{esf}{list of elementary symmetric functions and their derivatives for estimated parameters,} \item{loglik}{log-likelihood of the fitted model,} \item{df}{number of estimated parameters,} \item{code}{convergence code from \code{optim},} \item{iterations}{number of iterations used by \code{optim},} \item{reltol}{tolerance passed to \code{optim}.} } \references{ Masters GN (1992). A Rasch Model for Partial Credit Scoring. \emph{Psychometrika}, \bold{47}(2), 149--174. Wilson M, Masters GN (1993). The Partial Credit Model and Null Categories. \emph{Psychometrika}, \bold{58}(1), 87--99. } \seealso{\code{\link{gpcmodel}}, \code{\link{rsmodel}}, \code{\link{raschmodel}}, \code{\link{plmodel}}, \code{\link{btmodel}}} \examples{ o <- options(digits = 4) ## Verbal aggression data data("VerbalAggression", package = "psychotools") ## Partial credit model for the other-to-blame situations pcm <- pcmodel(VerbalAggression$resp[, 1:12]) summary(pcm) ## visualizations plot(pcm, type = "profile") plot(pcm, type = "regions") plot(pcm, type = "piplot") plot(pcm, type = "curves") plot(pcm, type = "information") ## Get data of situation 1 ('A bus fails to ## stop for me') and induce a null category in item 2. pcd <- VerbalAggression$resp[, 1:6, drop = FALSE] pcd[pcd[, 2] == 1, 2] <- NA ## fit pcm to these data, comparing downcoding and keeping strategy pcm_va_keep <- pcmodel(pcd, nullcats = "keep") pcm_va_down <- pcmodel(pcd, nullcats = "downcode") plot(x = coef(pcm_va_keep), y = coef(pcm_va_down), xlab = "Threshold Parameters (Keeping)", ylab = "Threshold Parameters (Downcoding)", main = "Comparison of two null category strategies (I2 with null category)", pch = rep(as.character(1:6), each = 2)[-3]) abline(b = 1, a = 0) options(digits = o$digits) } \keyword{regression} psychotools/man/rgpcm.Rd0000644000176200001440000000365113751360054015023 0ustar liggesusers\name{rgpcm} \alias{rgpcm} \title{Simulate Data under a Generalized Partial Credit Model} \description{ \code{rgpcm} simulates IRT data under a generalized partial credit model.} \usage{ rgpcm(theta, a, b, nullcats = FALSE, return_setting = TRUE) } \arguments{ \item{theta}{numeric vector of person parameters. Can also be a list, then a list of length \code{length(theta)} is returned, containing multiple simulated data sets.} \item{a}{list of numerics of item discrimination parameters.} \item{b}{list of numeric vectors of item threshold parameters.} \item{nullcats}{logical. Should null categories be allowed?} \item{return_setting}{logical. Should a list containing slots of "a", "b", and "theta", as well as the simulated data matrix "data" be returned (default) or only the simulated data matrix?} } \value{ \code{rgpcm} returns either a list of the following components: \item{a}{list of numerics of item discrimination parameters used,} \item{b}{list of numeric vectors of item threshold parameters used,} \item{theta}{numeric vector of person parameters used,} \item{data}{numeric matrix containing the simulated data,} or (if \code{return_setting = FALSE}) only the numeric matrix containing the simulated data. } \seealso{\code{\link{rpcm}}, \code{\link{rrsm}}, \code{\link{rpl}}, \code{\link{rrm}}} \examples{ set.seed(1) ## item responses under a GPCM (generalized partial credit model) from ## 6 persons with three different person parameters ## 8 items with different combinations of two or three threshold parameters ## and corresponding discrimination parameters ppar <- rep(-1:1, each = 2) tpar <- rep(list(-2:0, -1:1, 0:1, 0:2), each = 2) dpar <- rep(list(1, 2), each = 4) sim <- rgpcm(theta = ppar, a = dpar, b = tpar) ## simulated item response data along with setting parameters sim ## print and plot corresponding item response object iresp <- itemresp(sim$data) iresp plot(iresp) } psychotools/man/elementary_symmetric_functions.Rd0000644000176200001440000001050112745626347022250 0ustar liggesusers\name{elementary_symmetric_functions} \alias{elementary_symmetric_functions} \title{Calculation of the Elementary Symmetric Functions and Their Derivatives} \description{ Calculation of \code{elementary_symmetric_functions} (ESFs), their first and, in the case of dichotomous items, second derivatives with sum or difference algorithm for the Rasch, rating scale and partial credit model. } \usage{ elementary_symmetric_functions(par, order = 0L, log = TRUE, diff = FALSE, engine = NULL) } \arguments{ \item{par}{numeric vector or a list. Either a vector of item difficulty parameters of dichotomous items (Rasch model) or a list of item-category parameters of polytomous items (rating scale and partial credit model).} \item{order}{integer between 0 and 2, specifying up to which derivative the ESFs should be calculated. Please note, second order derivatives are currently only possible for dichtomous items in an R implementation \code{engine == "R".}} \item{log}{logical. Are the parameters given in \code{par} on log scale? Primarily used for internal recursive calls of \code{elementary_symmetric_functions}.} \item{diff}{logical. Should the first and second derivatives (if requested) of the ESFs calculated with sum (\code{FALSE}) or difference algorithm (\code{TRUE}).} \item{engine}{character, either \code{"C"} or \code{"R"}. If the former, a C implementation is used to calculcate the ESFs and their derivatives, otherwise (\code{"R"}) pure R code is used.} } \value{ \code{elementary_symmetric_function} returns a list of length 1 + \code{order}. If \code{order = 0}, then the first (and only) element is a numeric vector with the ESFs of order 0 to the maximum score possible with the given parameters. If \code{order = 1}, the second element of the list contains a matrix, with the rows corresponding to the possible scores and the columns corresponding to the derivatives with respect to the i-th parameter of \code{par}. For dichotomous items and \code{order = 2}, the third element of the list contains an array with the second derivatives with respect to every possible combination of two parameters given in \code{par}. The rows of the individual matrices still correspond to the possibles scores (orders) starting from zero. } \details{ Depending on the type of \code{par}, the elementary symmetric functions for dichotomous (\code{par} is a numeric vector) or polytomous items (\code{par} is a list) are calculated. For dichotomous items, the summation and difference algorithm published in Liou (1994) is used. For calculating the second order derivatives, the equations proposed by Jansens (1984) are employed. For polytomous items, the summation and difference algorithm published by Fischer and Pococny (1994) is used (see also Fischer and Pococny, 1995). } \references{ Liou M (1994). More on the Computation of Higher-Order Derivatives of the Elementary Symmetric Functions in the Rasch Model. \emph{Applied Psychological Measurement}, \bold{18}, 53--62. Jansen PGW (1984). Computing the Second-Order Derivatives of the Symmetric Functions in the Rasch Model. \emph{Kwantitatieve Methoden}, \bold{13}, 131--147. Fischer GH, and Ponocny I (1994). An Extension of the Partial Credit Model with an Application to the Measurement of Change. \emph{Psychometrika}, \bold{59}(2), 177--192. Fischer GH, and Ponocny I (1995). \dQuote{Extended Rating Scale and Partial Credit Models for Assessing Change.} In Fischer GH, and Molenaar IW (eds.). \emph{Rasch Models: Foundations, Recent Developments, and Applications.} } \examples{ \donttest{ ## zero and first order derivatives of 100 dichotomous items di <- rnorm(100) system.time(esfC <- elementary_symmetric_functions(di, order = 1)) ## again with R implementation system.time(esfR <- elementary_symmetric_functions(di, order = 1, engine = "R")) ## are the results equal? all.equal(esfC, esfR) } ## calculate zero and first order elementary symmetric functions ## for 10 polytomous items with three categories each. pi <- split(rnorm(20), rep(1:10, each = 2)) x <- elementary_symmetric_functions(pi) ## use difference algorithm instead and compare results y <- elementary_symmetric_functions(pi, diff = TRUE) all.equal(x, y) } \keyword{misc} psychotools/man/MemoryDeficits.Rd0000644000176200001440000000351312745627651016646 0ustar liggesusers\name{MemoryDeficits} \alias{MemoryDeficits} \title{Memory Deficits in Psychiatric Patients} \description{ Response frequencies of 96 patients who took part in a pair-clustering experiment to assess their memory deficits. } \usage{data("MemoryDeficits")} \format{ A data frame containing 576 observations on 7 variables. \describe{ \item{ID}{Participant ID.} \item{group}{Factor with four levels specifying patient or control group of participant.} \item{trial}{Trial number from 1 to 6.} \item{E1}{Number of pairs recalled adjacently.} \item{E2}{Number of pairs recalled non-adjacently.} \item{E3}{Number of single pair members recalled.} \item{E4}{Number of non-recalled pairs.} } } \details{ Riefer, Knapp, Batchelder, Bamber and Manifold (2002) report a study on memory deficits in schizophrenic (n = 29) and organic alcoholic (n = 21) patients who were compared to two matched control groups (n = 25, n = 21). Participants were presented with 20 pairs of semantically related words. In a later memory test, they freely recalled the presented words. This procedure was repeated for a total of six study and test trials. Responses were classified into four categories: both words in a pair are recalled adjacently (E1) or non-adjacently (E2), one word in a pair is recalled (E3), neither word in a pair is recalled (E4). } \source{ The data were made available by William H. Batchelder. } \references{ Riefer DM, Knapp BR, Batchelder WH, Bamber D, Manifold V (2002). Cognitive Psychometrics: Assessing Storage and Retrieval Deficits in Special Populations with Multinomial Processing Tree Models. \emph{Psychological Assessment}, \bold{14}, 184--201. } \examples{ data("MemoryDeficits", package = "psychotools") aggregate(cbind(E1, E2, E3, E4) ~ trial + group, MemoryDeficits, sum) } \keyword{datasets} psychotools/man/FirstNames.Rd0000644000176200001440000000654613754576031016003 0ustar liggesusers\name{FirstNames} \alias{FirstNames} \encoding{latin1} \title{Popularity of First Names} \description{ Preferences of 192 respondents choosing among six boys names with respect to their popularity. } \usage{data("FirstNames")} \format{ A data frame containing 192 observations on 11 variables. \describe{ \item{preference}{Paired comparison of class \code{\link{paircomp}}. All 15 pairwise choices among six boys names: Tim, Lucas, Michael, Robin, Benedikt, and Julius.} \item{ordered.pref}{Ordered paired comparison of class \code{\link{paircomp}}. Same as \code{preference}, but within-pair order is recognized.} \item{gender}{Factor coding gender.} \item{age}{Integer. Age of the respondents in years.} \item{education}{Ordered factor. Level of education: 1 Hauptschule with degree (Secondary General School), 2 and 3 Realschule without and with degree (Intermediate Secondary School), 4 and 5 Gymnasium without and with degree (High School), 6 and 7 Studium without and with degree (University).} \item{children}{Integer. Number of children.} \item{state}{Factor. State of Germany where participant grew up.} \item{state.reg}{Factor. The region (south, north-west, east) each state belongs to.} \item{fname}{Factor. Participant's fist name(s). (Umlaute in Jrg and Jrgen have been transliterated to Joerg and Juergen for portability of the data.)} \item{interviewer}{Factor. Interviewer id.} \item{gender.int}{Factor coding interviewer's gender.} } } \details{ A survey was conducted at the Department of Psychology, Universitt Tbingen, in June 2009. The sample was stratified by gender and age (younger versus older than 30 years) with 48 participants in each group. The interviewers were Psychology Master's students who collected the data for course credits. Participants were presented with 15 pairs of boys names in random order. On each trial, their task was to choose the name they would rather give to their own child. The pairs of boys names were read to the participants one at a time. A given participant compared each pair in one order only, hence the NA's in \code{ordered.pref}. The names were selected to fall within the upper (Tim, Lucas), mid (Michael, Robin) and lower (Benedikt, Julius) range of the top 100 of the most popular boys names in Germany in the years from 1990 to 1999 (\url{https://www.beliebte-vornamen.de/3778-1990er-jahre.htm}). The names have either front (e, i) or back (o, u) vowels in the stressed syllables. Phonology of the name and attractiveness of a person have been shown to be related (Perfors, 2004; Hartung et al., 2009). } \references{ Hartung F, Klenovsak D, Santiago dos Santos L, Strobl C, Zaefferer D (2009). Are Tims Hot and Toms Not? Probing the Effect of Sound Symbolism on Perception of Facial Attractiveness. Presented at the \emph{31th Annual Meeting of the Cognitive Science Society}, July 27--August 1, Amsterdam, The Netherlands. Perfors A (2004). What's in a Name? The Effect of Sound Symbolism on Perception of Facial Attractiveness. Presented at the \emph{26th Annual Meeting of the Cognitive Science Society}, August 5--7, Chicago, USA. } \seealso{\code{\link{paircomp}}} \examples{ data("FirstNames", package = "psychotools") summary(FirstNames$preference) covariates(FirstNames$preference) } \keyword{datasets} psychotools/man/personpar.Rd0000644000176200001440000002004213613676163015725 0ustar liggesusers\name{personpar} \alias{personpar} \alias{personpar.raschmodel} \alias{personpar.rsmodel} \alias{personpar.pcmodel} \alias{personpar.plmodel} \alias{personpar.gpcmodel} \alias{coef.personpar} \alias{print.personpar} \alias{vcov.personpar} \title{Extract Person Parameters of Item Response Models} \description{ A class and generic function for representing and estimating the person parameters of a given item response model. } \usage{ personpar(object, \dots) \method{personpar}{raschmodel}(object, personwise = FALSE, ref = NULL, vcov = TRUE, interval = NULL, tol = 1e-8, \dots) \method{personpar}{rsmodel}(object, personwise = FALSE, ref = NULL, vcov = TRUE, interval = NULL, tol = 1e-8, \dots) \method{personpar}{pcmodel}(object, personwise = FALSE, ref = NULL, vcov = TRUE, interval = NULL, tol = 1e-8, \dots) \method{personpar}{plmodel}(object, personwise = FALSE, vcov = TRUE, interval = NULL, tol = 1e-6, method = "EAP", \dots) \method{personpar}{gpcmodel}(object, personwise = FALSE, vcov = TRUE, interval = NULL, tol = 1e-6, method = "EAP", \dots) } \arguments{ \item{object}{a fitted model object for which person parameters should be returned/estimated.} \item{personwise}{logical. Should the distributional parameters of the latent person ability distribution be computed (default) or the person-wise (individual) person parameters? See below for details.} \item{ref}{a vector of labels or position indices of item parameters or a contrast matrix which should be used as restriction/for normalization. This argument will be passed over to internal calls of \code{itempar}.} \item{vcov}{logical. Should a covariance matrix be returned/estimated for the person parameter estimates? See also details below.} \item{interval}{numeric vector of length two, specifying an interval for \code{\link[stats]{uniroot}} or \code{\link[mirt]{fscores}} to calculate the person parameter estimates.} \item{tol}{numeric tolerance passed to \code{\link[stats]{uniroot}} or \code{\link[mirt]{fscores}}.} \item{method}{type of estimation method being passed to \code{\link[mirt]{fscores}}.} \item{\dots}{further arguments which are passed to \code{\link[stats]{optim}} in case of \code{vcov = TRUE} or \code{\link[mirt]{fscores}}.} } \details{ \code{personpar} is both a class to represent person parameters of item response models as well as a generic function. The generic function can be used to return/estimate the person parameters of a given item response model. By default, the function \code{personpar()} reports the distribution parameters of the assumed person ability distribution. For models estimated by marginal maximum likelihood estimation (MML) this is the mean/variance of the underlying normal distribution, whereas for models estimated by conditional maximum likelihood estimation (CML) this is a discrete distribution with one estimation for each observed raw score in the data. Alternatively, when setting \code{personwise = TRUE}, the person parameter for each person/subject in the underlying data set can be extracted. In the CML case, this simply computes the raw score for each person and then extracts the corresponding person parameter. In the MML case, this necessitates (numerically) integrating out the individual person parameters (also known as factor scores or latent trait estimates) based on the underlying normal distribution. More specifically, the following algorithms are employed for obtaining the distributional person parameters: \itemize{ \item In the MML case -- i.e., for \code{plmodel}s and \code{gpcmodel}s -- the distributional parameters are already part of the model specification. In a single-group specification and in the reference group of a multi-group specification the mean/variance parameters are fixed to 0/1. In the multi-group case the remaining mean/variance parameters were already estimated along with all other model parameters and simply need to be extracted. Analogously, the corresponding variance-covariance matrix just needs to be extracted and has zero covariances in the cells corresponding to fixed parameters. \item In the CML case -- i.e., \code{raschmodel}s, \code{rsmodel}s, and \code{pcmodel}s -- the distributional parameters are estimated via \code{uniroot()} with the estimation equations given by Hoijtink & Boomsma (1995) as well as Andersen (1995). This approach is fast and estimates for all possible raw scores are available. If the covariance matrix of the estimated person parameters is requested (\code{vcov = TRUE}), an additional call of \code{optim} is employed to obtain the Hessian numerically. With this approach, person parameters are available only for observed raw scores. } As already explained above, obtaining the person-wise (individual) person paremeters (or ability estimates or factor scores) is straightforward in the CML case. In the MML case, \code{\link[mirt]{fscores}} is used, see Chalmers (2012) for further details. If \code{personwise = TRUE}, the associated variance-covariance matrix is not provided and simply a matrix with \code{NA}s is returned. (The same is done for \code{vcov = FALSE}.) For objects of class \code{personpar}, several methods to standard generic functions exist: \code{print}, \code{coef}, \code{vcov}. \code{coef} and \code{vcov} can be used to extract the person parameters and covariance matrix without additional attributes. Based on this Wald tests or confidence intervals can be easily computed, e.g., via \code{confint}. } \value{ A named vector with person parmeters of class \code{personpar} and additional attributes \code{"model"} (the model name), \code{"vcov"} (the covariance matrix of the estimates if \code{vcov = TRUE} or an \code{NA}-matrix otherwise) and \code{"type"} (the type of the parameters, depending on \code{personwise}). } \references{ Andersen EB (1995). Polytomous Rasch Models and Their Estimation. In Fischer GH, Molenaar IW (eds.). \emph{Rasch Models: Foundations, Recent Developments, and Applications}. Springer, New York. Chalmers RP (2012). mirt: A Multidimensional Item Response Theory Package for the R Environment. \emph{Journal of Statistical Software}, \bold{48}(6), 1--29. Hoijtink H, Boomsma A (1995). On Person Parameter Estimation in the Dichotomous Rasch Model. In Fischer GH, Molenaar IW (eds.). \emph{Rasch Models: Foundations, Recent Developments, and Applications}. Springer, New York. } \seealso{\code{\link{itempar}}, \code{\link{threshpar}}, \code{\link{discrpar}}, \code{\link{guesspar}}, \code{\link{upperpar}}} \examples{ o <- options(digits = 3) ## load verbal aggression data data("VerbalAggression", package = "psychotools") ## fit a Rasch model to dichotomized verbal aggression data and ram <- raschmodel(VerbalAggression$resp2) ## extract person parameters ## (= parameters of the underlying ability distribution) rap <- personpar(ram) rap ## extract variance-covariance matrix and standard errors vc <- vcov(rap) sqrt(diag(vc)) ## Wald confidence intervals confint(rap) ## now match each person to person parameter with the corresponding raw score personpar(ram, personwise = TRUE)[1:6] ## person parameters for RSM/PCM fitted to original polytomous data rsm <- rsmodel(VerbalAggression$resp) pcm <- pcmodel(VerbalAggression$resp) cbind(personpar(rsm, vcov = FALSE), personpar(pcm, vcov = FALSE)) if(requireNamespace("mirt")) { ## fit a 2PL accounting for gender impact and twoplm <- plmodel(VerbalAggression$resp2, impact = VerbalAggression$gender) ## extract the person parameters ## (= mean/variance parameters from the normal ability distribution) twoplp <- personpar(twoplm) twoplp ## extract the standard errors sqrt(diag(vcov(twoplp))) ## Wald confidence intervals confint(twoplp) ## now look at the individual person parameters ## (integrated out over the normal ability distribution) personpar(twoplm, personwise = TRUE)[1:6] } options(digits = o$digits) } \keyword{classes} psychotools/man/discrpar.Rd0000644000176200001440000000766413405674330015533 0ustar liggesusers\name{discrpar} \alias{discrpar} \alias{discrpar.raschmodel} \alias{discrpar.rsmodel} \alias{discrpar.pcmodel} \alias{discrpar.plmodel} \alias{discrpar.gpcmodel} \alias{coef.discrpar} \alias{print.discrpar} \alias{vcov.discrpar} \title{Extract Discrimination Parameters of Item Response Models} \description{ A class and generic function for representing and extracting the discrimination parameters of a given item response model. } \usage{ discrpar(object, \dots) \method{discrpar}{raschmodel}(object, ref = NULL, alias = TRUE, vcov = TRUE, \dots) \method{discrpar}{rsmodel}(object, ref = NULL, alias = TRUE, vcov = TRUE, \dots) \method{discrpar}{pcmodel}(object, ref = NULL, alias = TRUE, vcov = TRUE, \dots) \method{discrpar}{plmodel}(object, ref = NULL, alias = TRUE, vcov = TRUE, \dots) \method{discrpar}{gpcmodel}(object, ref = NULL, alias = TRUE, vcov = TRUE, \dots) } \arguments{ \item{object}{a fitted model object whose discrimination parameters should be extracted.} \item{ref}{a restriction to be used. Not used for models estimated via CML as the discrimination parameters are fixed to 1 in \code{raschmodel}s, \code{rsmodel}s and \code{pcmodel}s. For models estimated via MML (\code{plmodel}s and \code{gpcmodel}s), the parameters are by default identified via the distributional parameters of the person parameters (mean and variance of a normal distribution). Nevertheless, a restriction on the ratio scale can be applied.} \item{alias}{logical. If \code{TRUE} (the default), the aliased parameters are included in the return vector (and in the variance-covariance matrix if \code{vcov} = TRUE). If \code{FALSE}, these parameters are removed. For \code{raschmodel}s, \code{rsmodel}s and \code{pcmodel}s where all discrimination parameters are fixed to 1, this means that an empty numeric vector and an empty variance-covariance matrix is returned if \code{alias} is \code{FALSE}.} \item{vcov}{logical. If \code{TRUE} (the default), the variance-covariance matrix of the discrimination parameters is attached as attribute \code{vcov}.} \item{\dots}{further arguments which are currently not used.} } \details{ \code{discrpar} is both, a class to represent discrimination parameters of item response models as well as a generic function. The generic function can be used to extract the discrimination parameters of a given item response model. For objects of class \code{discrpar}, several methods to standard generic functions exist: \code{print}, \code{coef}, \code{vcov}. \code{coef} and \code{vcov} can be used to extract the discrimination parameters and their variance-covariance matrix without additional attributes. } \value{ A named vector with discrimination parameters of class \code{discrpar} and additional attributes \code{model} (the model name), \code{ref} (the items or parameters used as restriction/for normalization), \code{alias} (either \code{TRUE} or a named numeric vector with the aliased parameters not included in the return value), and \code{vcov} (the estimated and adjusted variance-covariance matrix). } \seealso{\code{\link{personpar}}, \code{\link{itempar}}, \code{\link{threshpar}}, \code{\link{guesspar}}, \code{\link{upperpar}}} \examples{ o <- options(digits = 4) ## load verbal aggression data data("VerbalAggression", package = "psychotools") ## fit Rasch model to verbal aggression data rmod <- raschmodel(VerbalAggression$resp2) ## extract the discrimination parameters dp1 <- discrpar(rmod) ## extract the standard errors sqrt(diag(vcov(dp1))) if(requireNamespace("mirt")) { ## fit 2PL to verbal aggression data twoplmod <- plmodel(VerbalAggression$resp2) ## extract the discrimination parameters dp2 <- discrpar(twoplmod) ## this time with the first discrimination parameter being the reference discrpar(twoplmod, ref = 1) ## extract the standard errors sqrt(diag(vcov(dp2))) } options(digits = o$digits) } \keyword{classes} psychotools/man/subset.paircomp.Rd0000644000176200001440000000210111633517437017024 0ustar liggesusers\name{subset.paircomp} \alias{subset.paircomp} \alias{reorder.paircomp} \title{Subsetting/Reordering Paired Comparison Data} \description{ Selection of subsets of objects to be compared and/or reordering of objects in \code{"paircomp"} data. } \usage{ \method{reorder}{paircomp}(x, labels, \dots) \method{subset}{paircomp}(x, subset, select, \dots) } \arguments{ \item{x}{an object of class \code{"paircomp"}.} \item{labels, select}{character or integer. Either a vector of (at least two) elements of \code{labels(x)} or an integer with their position. Partial string matching is enabled.} \item{subset}{currently not implemented. (Should be a specification of subsets of subjects.)} \item{\dots}{currently not used.} } \details{ The \code{subset} method currently just calls the \code{reorder} method. } \seealso{\code{\link{paircomp}}} \examples{ pc <- paircomp(rbind( c(1, 1, 1), # a > b, a > c, b > c c(1, 1, -1), # a > b, a > c, b < c c(1, -1, -1), # a > b, a < c, b < c c(1, 1, 1))) reorder(pc, c("c", "a")) } \keyword{classes} psychotools/man/plmodel.Rd0000644000176200001440000002306013405673502015344 0ustar liggesusers\name{plmodel} \alias{plmodel} \alias{print.plmodel} \alias{summary.plmodel} \alias{print.summary.plmodel} \alias{coef.plmodel} \alias{confint.plmodel} \alias{bread.plmodel} \alias{estfun.plmodel} \alias{logLik.plmodel} \alias{vcov.plmodel} \title{Parametric Logistic Model Fitting Function} \description{ \code{plmodel} is a basic fitting function for parametric logistic IRT models (2PL, 3PL, 3PLu, 4PL, Rasch/1PL), providing a wrapper around \code{\link[mirt]{mirt}} and \code{\link[mirt]{multipleGroup}} relying on marginal maximum likelihood (MML) estimation via the standard EM algorithm. } \usage{ plmodel(y, weights = NULL, impact = NULL, type = c("2PL", "3PL", "3PLu", "4PL", "1PL", "RM"), grouppars = FALSE, vcov = TRUE, start = NULL, method = "BFGS", maxit = 500, reltol = 1e-5, \dots) } \arguments{ \item{y}{item response object that can be coerced (via \code{\link[base]{as.matrix}}) to a numeric matrix with scores 0, 1. Typically, either already a matrix, data frame, or dedicated object of class \code{\link{itemresp}}.} \item{weights}{an optional vector of weights (interpreted as case weights).} \item{impact}{an optional \code{factor} allowing for grouping the subjects (rows). If specified, a multiple-group model is fitted to account for impact (see details below). By default, no impact is modelled, i.e., a single-group model is used.} \item{type}{character string, specifying the type of parametric logistic IRT model to be estimated (see details below).} \item{grouppars}{logical. Should the estimated distributional group parameters of a multiple group model be included in the model parameters?} \item{vcov}{logical or character specifying the type of variance-covariance matrix (if any) computed for the final model. The default \code{vcov = TRUE} corresponds to \code{vcov = "Oakes"}, see \code{\link[mirt]{mirt}} for further options. If set to \code{vcov = FALSE} (or \code{vcov = "none"}), \code{vcov()} will return a matrix of \code{NA}s only.} \item{start}{an optional vector or list of starting values (see examples below).} \item{method, maxit, reltol}{control parameters for the optimizer employed by \code{\link[mirt]{mirt}} for the EM algorithm.} \item{\dots}{further arguments passed to \code{\link[mirt]{mirt}} or \code{\link[mirt]{multipleGroup}}, respectively.} } \details{ \code{plmodel} provides a basic fitting function for parametric logistic IRT models (2PL, 3PL, 3PLu, 4PL, Rasch/1PL) providing a wrapper around \code{\link[mirt]{mirt}} and \code{\link[mirt]{multipleGroup}} relying on MML estimation via the standard EM algorithm (Bock & Aitkin, 1981). Models are estimated under the slope/intercept parametrization, see e.g. Chalmers (2012). The probability of person \eqn{i} \sQuote{solving} item \eqn{j} is modelled as: \deqn{P(X_{ij} = 1|\theta_{i},a_{j},d_{j},g_{j},u_{j}) = g_{j} + \frac{(u_{j} - g_{j})}{1 + \exp{(-(a_{j}\theta_{i} + d_{j}))}}} A reparametrization of the intercepts to the classical IRT parametrization, \eqn{b_{j} = -\frac{d_{j}}{a_{j}}}, is provided via the corresponding \code{\link{itempar}} method. If an optional \code{impact} variable is supplied, a multiple-group model of the following form is being fitted: Item parameters are fixed to be equal across the whole sample. For the first group of the \code{impact} variable the person parameters are fixed to follow the standard normal distribution. In the remaining \code{impact} groups, the distributional parameters (mean and variance of a normal distribution) of the person parameters are estimated freely. See e.g. Baker & Kim (2004, Chapter 11) or Debelak & Strobl (2018) for further details. To improve convergence of the model fitting algorithm, the first level of the \code{impact} variable should always correspond to the largest group. If this is not the case, levels are re-ordered internally. If \code{grouppars} is set to \code{TRUE} the freely estimated distributional group parameters (if any) are returned as part of the model parameters. By default, \code{type} is set to \code{"2PL"}. Therefore, all so-called guessing parameters are fixed at 0 and all upper asymptotes are fixed at 1. \code{"3PL"} results in all upper asymptotes being fixed at 1 and \code{"3PLu"} results in all all guessing parameters being fixed at 0. \code{"4PL"} results in a full estimated model as specified above. Finally, if \code{type} is set to \code{"1PL"} (or equivalently \code{"RM"}), an MML-estimated Rasch model is being fitted. This means that all slopes are restricted to be equal across all items, all guessing parameters are fixed at 0 and all upper asymptotes are fixed at 1. Note that internally, the so-called guessing parameters and upper asymptotes are estimated on the logit scale (see also \code{\link[mirt]{mirt}}). Therefore, most of the basic methods below include a \code{logit} argument, which can be set to \code{TRUE} or \code{FALSE} allowing for a retransformation of the estimates and their variance-covariance matrix (if requested) using the logistic function and the delta method if \code{logit = FALSE}. \code{plmodel} returns an object of class \code{"plmodel"} for which several basic methods are available, including \code{print}, \code{plot}, \code{summary}, \code{coef}, \code{vcov}, \code{logLik}, \code{estfun}, \code{\link{discrpar}}, \code{\link{itempar}}, \code{\link{threshpar}}, \code{\link{guesspar}}, \code{\link{upperpar}}, and \code{\link{personpar}}. } \value{ \code{plmodel} returns an S3 object of class \code{"plmodel"}, i.e., a list of the following components: \item{coefficients}{estimated model parameters in slope/intercept parametrization,} \item{vcov}{covariance matrix of the model parameters,} \item{data}{modified data, used for model-fitting, i.e., without observations with zero weight,} \item{items}{logical vector of length \code{ncol(y)}, indicating which items were used during estimation,} \item{n}{number of observations (with non-zero weights),} \item{n_org}{original number of observations in \code{y},} \item{weights}{the weights used (if any),} \item{na}{logical indicating whether the data contain \code{NA}s,} \item{impact}{either \code{NULL} or the supplied \code{impact} variable with the levels reordered in decreasing order (if this has not been the case prior to fitting the model),} \item{loglik}{log-likelihood of the fitted model,} \item{df}{number of estimated (more precisely, returned) model parameters,} \item{code}{convergence code from \code{mirt},} \item{iterations}{number of iterations used by \code{mirt},} \item{reltol}{convergence threshold passed to \code{mirt},} \item{grouppars}{the logical \code{grouppars} value,} \item{type}{the \code{type} of model restriction specified,} \item{mirt}{the \code{mirt} object fitted internally.} } \references{ Baker FB, Kim SH (2004). \emph{Item Response Theory: Parameter Estimation Techniques}. Chapman & Hall/CRC, Boca Raton. Bock RD, Aitkin M (1981). Marginal Maximum Likelihood Estimation of Item Parameters: Application of an EM Algorithm. \emph{Psychometrika}, \bold{46}(4), 443--459. Chalmers RP (2012). mirt: A Multidimensional Item Response Theory Package for the R Environment. \emph{Journal of Statistical Software}, \bold{48}(6), 1--29. \doi{10.18637/jss.v048.i06} Debelak R, Strobl C (2018). Investigating Measurement Invariance by Means of Parameter Instability Tests for 2PL and 3PL Models. \emph{Educational and Psychological Measurement}, forthcoming. \doi{10.1177/0013164418777784} } \seealso{\code{\link{raschmodel}}, \code{\link{gpcmodel}}, \code{\link{rsmodel}}, \code{\link{pcmodel}}, \code{\link{btmodel}}} \examples{ if(requireNamespace("mirt")) { o <- options(digits = 4) ## mathematics 101 exam results data("MathExam14W", package = "psychotools") ## 2PL twopl <- plmodel(y = MathExam14W$solved) summary(twopl) ## how to specify starting values as a vector of model parameters st <- coef(twopl) twopl <- plmodel(y = MathExam14W$solved, start = st) ## or a list containing a vector of slopes and a vector of intercepts set.seed(0) st <- list(a = rlnorm(13, 0, 0.0625), d = rnorm(13, 0, 1)) twopl <- plmodel(y = MathExam14W$solved, start = st) ## visualizations plot(twopl, type = "profile") plot(twopl, type = "regions") plot(twopl, type = "piplot") plot(twopl, type = "curves", xlim = c(-6, 6)) plot(twopl, type = "information", xlim = c(-6, 6)) ## visualizing the IRT parametrization plot(twopl, type = "curves", xlim = c(-6, 6), items = 1) abline(v = itempar(twopl)[1]) abline(h = 0.5, lty = 2) ## 2PL accounting for gender impact table(MathExam14W$gender) mtwopl <- plmodel(y = MathExam14W$solved, impact = MathExam14W$gender, grouppars = TRUE) summary(mtwopl) plot(mtwopl, type = "piplot") ## specifying starting values as a vector of model parameters, note that in ## this example impact is being modelled and therefore grouppars must be TRUE ## to get all model parameters st <- coef(mtwopl) mtwopl <- plmodel(y = MathExam14W$solved, impact = MathExam14W$gender, start = st) ## or a list containing a vector of slopes, a vector of intercepts and a vector ## of means and a vector of variances as the distributional group parameters set.seed(1) st <- list(a = rlnorm(13, 0, 0.0625), d = rnorm(13, 0, 1), m = 0, v = 1) mtwopl <- plmodel(y = MathExam14W$solved, impact = MathExam14W$gender, start = st) ## MML estimated Rasch model (1PL) rm <- plmodel(y = MathExam14W$solved, type = "1PL") summary(rm) options(digits = o$digits) } } \keyword{regression} psychotools/man/btmodel.Rd0000644000176200001440000000673613356511544015353 0ustar liggesusers\name{btmodel} \alias{btmodel} \alias{btReg.fit} \alias{print.btmodel} \alias{summary.btmodel} \alias{print.summary.btmodel} \alias{coef.btmodel} \alias{worth.btmodel} \alias{deviance.btmodel} \alias{logLik.btmodel} \alias{vcov.btmodel} \alias{estfun.btmodel} \title{Bradley-Terry Model Fitting Function} \description{ \code{btmodel} is a basic fitting function for simple Bradley-Terry models. } \usage{ btmodel(y, weights = NULL, type = c("loglin", "logit"), ref = NULL, undecided = NULL, position = NULL, start = NULL, vcov = TRUE, estfun = FALSE, \dots) } \arguments{ \item{y}{paircomp object with the response.} \item{weights}{an optional vector of weights (interpreted as case weights).} \item{type}{character. Should an auxiliary log-linear Poisson model or logistic binomial be employed for estimation? The latter is not available if undecided effects are estimated.} \item{ref}{character or numeric. Which object parameter should be the reference category, i.e., constrained to zero?} \item{undecided}{logical. Should an undecided parameter be estimated?} \item{position}{logical. Should a position effect be estimated?} \item{start}{numeric. Starting values when calling \code{\link[stats]{glm.fit}}.} \item{vcov}{logical. Should the estimated variance-covariance be included in the fitted model object?} \item{estfun}{logical. Should the empirical estimating functions (score/gradient contributions) be included in the fitted model object?} \item{\dots}{further arguments passed to functions.} } \details{ \code{btmodel} provides a basic fitting function for Bradley-Terry models, intended as a building block for fitting Bradley-Terry trees and Bradley-Terry mixtures in the \pkg{psychotree} package, respectively. While \code{btmodel} is intended for individual paired-comparison data, the \pkg{eba} package provides functions for aggregate data. \code{btmodel} returns an object of class \code{"btmodel"} for which several basic methods are available, including \code{print}, \code{plot}, \code{summary}, \code{coef}, \code{vcov}, \code{logLik}, \code{estfun} and \code{\link{worth}}. } \value{ \code{btmodel} returns an S3 object of class \code{"btmodel"}, i.e., a list with components as follows. \item{y}{paircomp object with the response} \item{coefficients}{estimated parameters on log-scale (without the first parameter which is always constrained to be 0),} \item{vcov}{covariance matrix of the parameters in the model,} \item{loglik}{log-likelihood of the fitted model,} \item{df}{number of estimated parameters,} \item{weights}{the weights used (if any),} \item{n}{number of observations (with non-zero weights),} \item{type}{character for model type (see above),} \item{ref}{character for reference category (see above),} \item{undecided}{logical for estimation of undecided parameter (see above),} \item{position}{logical for estimation of position effect (see above),} \item{labels}{character labels of the objects compared,} \item{estfun}{empirical estimating function (also known as scores or gradient contributions).} } \seealso{\code{\link{pcmodel}}, \code{\link{gpcmodel}}, \code{\link{rsmodel}}, \code{\link{raschmodel}}, \code{\link{plmodel}}, the \pkg{eba} package} \examples{ o <- options(digits = 4) ## data data("GermanParties2009", package = "psychotools") ## Bradley-Terry model bt <- btmodel(GermanParties2009$preference) summary(bt) plot(bt) options(digits = o$digits) } \keyword{regression} psychotools/man/Sim3PL.Rd0000644000176200001440000000555713405673352014775 0ustar liggesusers\name{Sim3PL} \alias{Sim3PL} \title{Simulated Data for fitting a 3PL and 3PLu} \description{ Simulated responses of 10000 persons to 10 dichotomous items under two different simulation conditions. } \usage{data("Sim3PL", package = "psychotools")} \format{ A data frame containing 10000 observations on 2 variables. \describe{ \item{resp}{Item response matrix with 10 items (see details below).} \item{resp2}{Item response matrix with 10 items (see details below).} } } \details{ Data were simulated under the 3PL (\code{resp}) and 3PLu (\code{resp2}) (see \code{\link{plmodel}}). For the 3PL scenario, the random number generator's seed was set to 277. For the 3PLu scenario, the random number generator's seed was set to 167. Person parameters \eqn{\theta_{i}} of 10000 persons were drawn from the standard normal distribution. Item difficulties \eqn{b_{j}} of 10 items (under the classical IRT parametrization) were drawn from the standard normal distribution. Item discrimination parameters \eqn{a_{j}} were drawn from a log-normal distribution with a mean of \eqn{0} and a variance of \eqn{0.0625} on the log scale. For the 3PL, guessing parameters \eqn{g_{j}} were drawn from a uniform distribution with a lower limit of \eqn{0.1} and an upper limit of \eqn{0.2}. For the 3PLu, upper asymptote parameters \eqn{u_{j}} were drawn from a uniform distribution with a lower limit of \eqn{0.8} and an upper limit of \eqn{0.9}. In both scenarios, a \eqn{10000} x \eqn{10} matrix based on realizations of a uniform distribution with a lower limit of \eqn{0} and an upper limit of \eqn{1} was generated and compared to a \eqn{10000} x \eqn{10} matrix based on the probability function under the respective model. If the probability of person \eqn{i} solving item \eqn{j} exceeded the corresponding realization of the uniform distribution, this cell of the matrix was set to \eqn{1}, e.g., person \eqn{i} solved item \eqn{j}. } \seealso{\code{\link{plmodel}}} \examples{ ## overview data("Sim3PL", package = "psychotools") str(Sim3PL) ## data generation M <- 10000 N <- 10 ## 3PL scenario set.seed(277) theta <- rnorm(M, 0, 1) a <- rlnorm(N, 0, 0.25) b <- rnorm(N, 0, 1) g <- runif(N, 0.1, 0.2) u <- rep(1, N) probs <- matrix(g, M, N, byrow = TRUE) + matrix(u - g, M, N, byrow = TRUE) * plogis(matrix(a, M, N, byrow = TRUE) * outer(theta, b, "-")) resp <- (probs > matrix(runif(M * N, 0, 1), M, N)) + 0 all.equal(resp, Sim3PL$resp, check.attributes = FALSE) ## 3PLu scenario set.seed(167) theta <- rnorm(M, 0, 1) a <- rlnorm(N, 0, 0.25) b <- rnorm(N, 0, 1) g <- rep(0, N) u <- runif(N, 0.8, 0.9) probs <- matrix(g, M, N, byrow = TRUE) + matrix(u - g, M, N, byrow = TRUE) * plogis(matrix(a, M, N, byrow = TRUE) * outer(theta, b, "-")) resp2 <- (probs > matrix(runif(M * N, 0, 1), M, N)) + 0 all.equal(resp2, Sim3PL$resp2, check.attributes = FALSE) } \keyword{datasets} psychotools/man/StereotypeThreat.Rd0000644000176200001440000001550113366335045017227 0ustar liggesusers\name{StereotypeThreat} \alias{StereotypeThreat} \title{Stereotype Threat in Dutch Differential Aptitude Test} \description{ Cross-section data from Differential Aptitude Test (DAT) among Dutch highschool students, along with experimental conditions pertaining to stereotype threat. } \usage{data("StereotypeThreat")} \format{ A data frame containing 295 observations on 11 variables. \describe{ \item{condition}{Factor indicating experimental condition: \code{"control"} or stereotype \code{"threat"}, for details see below.} \item{ethnicity}{Factor coding ethnicity: Dutch \code{"majority"} or \code{"minority"}.} \item{numerical}{Number of items solved in numerical ability subtest (out of 14 complicated mathematical items).} \item{abstract}{Number of items solved in abstract reasoning subtest (out of 18 items with a logical sequence of diagrams).} \item{verbal}{Number of items solved in verbal reasoning subtest (out of 16 verbal analogy items).} \item{gender}{Factor indicating gender.} \item{age}{Age in years.} \item{vintelligence}{Numerical coding of the value of one's own intelligence. Answer to: How important is your intelligence for you? Range is from very important (\code{5}) to unimportant (\code{1}).} \item{vgrades}{Numerical coding of the value of getting good grades. Answer to: How much do you value getting good school grades? Range is from a lot of value (\code{5}) to not so much value (\code{1}).} \item{vprejudice}{Numerical coding of the answer to: Do you think that people of your group are prejudiced against? Range is from certainly (\code{5}) to not at all (\code{1}).} \item{gpa}{Numerical grade point average on 10-point scale (with 10 being the best grade). It has 57 missing values as some schools were either unwilling to share the data or did not provide it timely enough.} } } \details{ The data are taken from Study 1 of Wicherts et al. (2005) and have been used to study stereotype threat on intelligence test performance among Dutch highschool students. On average, Dutch minority students attain lower educational levels compared to Dutch majority students and studies have shown that minority students are often viewed as less smart/educated. Conversely, minorities often feel discriminated against in scholastic domains. Wicherts et al. (2005) administered an intelligence test consisting of three subtests (for numerical ability, abstract reasoning, and verbal reasoning) and varied the amount of stereotype threat related to ethnic minorities by changing the presentation of the test. In the \code{"threat"} condition, the questions were declared to be part of an intelligence test and also an ethnicity questionnaire was conducted prior to the DAT. In the \code{"control"} condition, intelligence was not mentioned and no ethnicity questionnaire was conducted. The variables \code{numerical}, \code{abstract}, and \code{verbal} can be used to assess ability/intelligence. And the \code{vintelligence}, \code{vgrades}, \code{vprejudice}, and \code{gpa} variables capture identification with the scholastic domain. See Wicherts et al. (2005) for details. } \source{ Provided by Jelte M. Wicherts. } \references{ Wicherts JM, Conor VD, Hessen DJ (2005). Stereotype Threat and Group Differences in Test Performance: A Question of Measurement Invariance. \emph{Journal of Personality and Social Psychology}, \bold{89}(5), 696-716. } \examples{ ## Data: Load and include/order wrt group variable data("StereotypeThreat", package = "psychotools") StereotypeThreat <- transform(StereotypeThreat, group = interaction(ethnicity, condition)) StereotypeThreat <- StereotypeThreat[order(StereotypeThreat$group),] ## Exploratory analysis (Table 2, p. 703) tab2 <- with(StereotypeThreat, rbind( "#" = tapply(numerical, group, length), "Numerical" = tapply(numerical, group, mean), " " = tapply(numerical, group, sd), "Abstract " = tapply(abstract, group, mean), " " = tapply(abstract, group, sd), "Verbal " = tapply(verbal, group, mean), " " = tapply(verbal, group, sd))) round(tab2, digits = 2) ## Corresponding boxplots plot(numerical ~ group, data = StereotypeThreat) plot(abstract ~ group, data = StereotypeThreat) plot(verbal ~ group, data = StereotypeThreat) ## MANOVA (p. 703) m <- lm(cbind(numerical, abstract, verbal) ~ ethnicity * condition, data = StereotypeThreat) anova(m, update(m, . ~ . - ethnicity:condition)) ## corresponding univariate results printCoefmat(t(sapply(summary(m), function(x) x$coefficients["ethnicityminority:conditionthreat", ]))) ## MGCFA (Table 3, p. 704) ## can be replicated using package lavaan \dontrun{ ## convenience function for multi-group CFA on this data mgcfa <- function(model, ...) cfa(model, data = StereotypeThreat, group = "group", likelihood = "wishart", start = "simple", ...) ## list of all 9 models m <- vector("list", length = 9) names(m) <- c("m2", "m2a", "m3", "m3a", "m4", "m5", "m5a", "m5b", "m6") ## Step 2: Fix loadings across groups f <- 'ability =~ abstract + verbal + numerical' m$m2 <- mgcfa(f, group.equal = "loadings") ## Step 2a: Free numerical loading in group 4 (minority.threat) f <- 'ability =~ abstract + verbal + c(l1, l1, l1, l4) * numerical' m$m2a <- mgcfa(f, group.equal = "loadings") ## Step 3: Fix variances across groups m$m3 <- mgcfa(f, group.equal = c("loadings", "residuals")) ## Step 3a: Free numerical variance in group 4 f <- c(f, 'numerical ~~ c(e1, e1, e1, e4) * numerical') m$m3a <- mgcfa(f, group.equal = c("loadings", "residuals")) ## Step 4: Fix latent variances within conditions f <- c(f, 'ability ~~ c(vmaj, vmin, vmaj, vmin) * ability') m$m4 <- mgcfa(f, group.equal = c("loadings", "residuals")) ## Step 5: Fix certain means, free others f <- c(f, 'numerical ~ c(na1, na1, na1, na4) * 1') m$m5 <- mgcfa(f, group.equal = c("loadings", "residuals", "intercepts")) ## Step 5a: Free ability mean in group majority.control f <- c(f, 'abstract ~ c(ar1, ar2, ar2, ar2) * 1') m$m5a <- mgcfa(f, group.equal = c("loadings", "residuals", "intercepts")) ## Step 5b: Free also ability mean in group minority.control f <- c(f[1:4], 'abstract ~ c(ar1, ar2, ar3, ar3) * 1') m$m5b <- mgcfa(f, group.equal = c("loadings", "residuals", "intercepts")) ## Step 6: Different latent mean structure f <- c(f, 'ability ~ c(maj, min, maj, min) * 1 + c(0, NA, 0, NA) * 1') m$m6 <- mgcfa(f, group.equal = c("loadings", "residuals", "intercepts")) ## Extract measures of fit tab <- t(sapply(m, fitMeasures, c("chisq", "df", "pvalue", "rmsea", "cfi"))) tab <- rbind("1" = c(0, 0, 1, 0, 1), tab) tab <- cbind(tab, delta_chisq = c(NA, abs(diff(tab[, "chisq"]))), delta_df = c(NA, diff(tab[, "df"]))) tab <- cbind(tab, "pvalue2" = pchisq(tab[, "delta_chisq"], abs(tab[, "delta_df"]), lower.tail = FALSE)) tab <- tab[, c(2, 1, 3, 7, 6, 8, 4, 5)] round(tab, digits = 3) } } \keyword{datasets} psychotools/man/print.paircomp.Rd0000644000176200001440000000310311633517437016656 0ustar liggesusers\name{print.paircomp} \alias{print.paircomp} \alias{format.paircomp} \title{Formatting Paired Comparison Data} \description{ Fine control for formatting and printing objects of \code{"paircomp"} data. } \usage{ \method{format}{paircomp}(x, sep = ", ", brackets = TRUE, abbreviate = NULL, width = getOption("width") - 7, \dots) \method{print}{paircomp}(x, quote = FALSE, \dots) } \arguments{ \item{x}{an object of class \code{"paircomp"}.} \item{sep}{character. A character for separating comparisons within subjects.} \item{brackets}{logical or character. Either a logical (Should brackets be wrapped around all comparisons for a single subject?) or a character of length two with opening and ending symbol.} \item{abbreviate}{logical or integer. Should object labels be abbreviated? Alternative an integer with the desired abbreviation length. The default is some heuristic based on the length of the labels.} \item{width}{integer or logical. Maximal width of the string for a subject. If \code{FALSE} no maximal width is set.} \item{\dots}{arguments passed to other functions.} \item{quote}{logical. Should quotes be printed?} } \details{ The \code{print} method just calls \code{format} (passing on all further arguments) and then prints the resulting string. } \seealso{\code{\link{paircomp}}} \examples{ pc2 <- paircomp(rbind( c(4, 1, 0), c(1, 2, -1), c(1, -2, -1), c(0, 0, -3)), labels = c("New York", "Rio", "Tokyo")) print(pc2) print(pc2, abbreviate = FALSE) print(pc2, abbreviate = FALSE, width = 10) } \keyword{classes} psychotools/man/print.itemresp.Rd0000644000176200001440000000431212007325662016670 0ustar liggesusers\name{print.itemresp} \alias{print.itemresp} \alias{format.itemresp} \title{Formatting Item Response Data} \description{ Fine control for formatting and printing \code{"itemresp"} data objects. } \usage{ \method{format}{itemresp}(x, sep = c(",", ":"), brackets = TRUE, abbreviate = NULL, mscale = TRUE, labels = FALSE, width = getOption("width") - 7L, \dots) \method{print}{itemresp}(x, quote = FALSE, \dots) } \arguments{ \item{x}{an object of class \code{"itemresp"}.} \item{sep}{character. A character of length 2 (otherwise expanded/reduced) for separating responses and items, respectively.} \item{brackets}{logical or character. Either a logical (Should brackets be wrapped around all responses for a single subject?) or a character of length 2 with opening and ending symbol.} \item{abbreviate}{logical or integer. Should scale labels be abbreviated? Alternatively, an integer with the desired abbreviation length. The default is some heuristic based on the length of the labels.} \item{mscale}{logical. Should mscale values be used for printing? If \code{FALSE}, integers 0, 1, \dots are used.} \item{labels}{logical. Should item labels be displayed?} \item{width}{integer or logical. Maximal width of the string for a subject. If \code{FALSE} no maximal width is set.} \item{\dots}{arguments passed to other functions.} \item{quote}{logical. Should quotes be printed?} } \details{ The \code{print} method just calls \code{format} (passing on all further arguments) and then prints the resulting string. } \seealso{\code{\link{itemresp}}} \examples{ ## item responses from binary matrix x <- cbind(c(1, 0, 1, 0), c(1, 0, 0, 0), c(0, 1, 1, 1)) xi <- itemresp(x) ## change mscale mscale(xi) <- c("-", "+") xi ## flexible formatting ## no/other brackets print(xi, brackets = FALSE) print(xi, brackets = c(">>", "<<")) ## include item labels (with different separators) print(xi, labels = TRUE) print(xi, labels = TRUE, sep = c(" | ", ": ")) ## handling longer mscale categories mscale(xi) <- c("disagree", "agree") print(xi) print(xi, mscale = FALSE) print(xi, abbreviate = FALSE) print(xi, abbreviate = FALSE, width = 23) print(xi, abbreviate = 2) } \keyword{classes} psychotools/man/guesspar.Rd0000644000176200001440000000735313405674313015551 0ustar liggesusers\name{guesspar} \alias{guesspar} \alias{guesspar.raschmodel} \alias{guesspar.rsmodel} \alias{guesspar.pcmodel} \alias{guesspar.plmodel} \alias{guesspar.gpcmodel} \alias{coef.guesspar} \alias{print.guesspar} \alias{vcov.guesspar} \title{Extract Guessing Parameters of Item Response Models} \description{ A class and generic function for representing and extracting the so-called guessing parameters of a given item response model. } \usage{ guesspar(object, \dots) \method{guesspar}{raschmodel}(object, alias = TRUE, vcov = TRUE, \dots) \method{guesspar}{rsmodel}(object, alias = TRUE, vcov = TRUE, \dots) \method{guesspar}{pcmodel}(object, alias = TRUE, vcov = TRUE, \dots) \method{guesspar}{plmodel}(object, alias = TRUE, logit = FALSE, vcov = TRUE, \dots) \method{guesspar}{gpcmodel}(object, alias = TRUE, vcov = TRUE, \dots) } \arguments{ \item{object}{a fitted model object whose guessing parameters should be extracted.} \item{alias}{logical. If \code{TRUE} (the default), the aliased parameters are included in the return vector (and in the variance-covariance matrix if \code{vcov} = TRUE). If \code{FALSE}, these parameters are removed. For \code{raschmodel}s, \code{rsmodel}s, \code{pcmodel}s and \code{gpcmodel}s, where all guessing parameters are fixed to 0, this means that an empty numeric vector and an empty variance-covariace matrix is returned if \code{alias} is \code{FALSE}.} \item{logit}{logical. If a \code{plmodel} of \code{type} \code{"3PL"} or \code{"4PL"} model has been fit, the guessing parameters were estimated on the logit scale. If \code{logit = FALSE}, these estimates and the variance-covariance (if requested) are retransformed using the logistic function and the delta method.} \item{vcov}{logical. If \code{TRUE} (the default), the variance-covariance matrix of the guessing parameters is attached as attribute \code{vcov}.} \item{\dots}{further arguments which are currently not used.} } \details{ \code{guesspar} is both, a class to represent guessing parameters of item response models as well as a generic function. The generic function can be used to extract the guessing parameters of a given item response model. For objects of class \code{guesspar}, several methods to standard generic functions exist: \code{print}, \code{coef}, \code{vcov}. \code{coef} and \code{vcov} can be used to extract the guessing parameters and their variance-covariance matrix without additional attributes. } \value{ A named vector with guessing parameters of class \code{guesspar} and additional attributes \code{model} (the model name), \code{alias} (either \code{TRUE} or a named numeric vector with the aliased parameters not included in the return value), \code{logit} (indicating whether the estimates are on the logit scale or not), and \code{vcov} (the estimated and adjusted variance-covariance matrix). } \seealso{\code{\link{personpar}}, \code{\link{itempar}}, \code{\link{threshpar}}, \code{\link{discrpar}}, \code{\link{upperpar}}} \examples{ if(requireNamespace("mirt")) { o <- options(digits = 3) ## load simulated data data("Sim3PL", package = "psychotools") ## fit 2PL to data simulated under the 3PL twoplmod <- plmodel(Sim3PL$resp) ## extract the guessing parameters (all fixed at 0) gp1 <- guesspar(twoplmod) ## fit 3PL to data simulated under the 3PL threeplmod <- plmodel(Sim3PL$resp, type = "3PL") ## extract the guessing parameters gp2 <- guesspar(threeplmod) ## extract the standard errors sqrt(diag(vcov(gp2))) ## extract the guessing parameters on the logit scale gp2_logit <- guesspar(threeplmod, logit = TRUE) ## along with the delta transformed standard errors sqrt(diag(vcov(gp2_logit))) options(digits = o$digits) } } \keyword{classes} psychotools/man/summary.itemresp.Rd0000644000176200001440000000533112401442503017223 0ustar liggesusers\name{summary.itemresp} \alias{summary.itemresp} \alias{plot.itemresp} \title{Summarizing and Visualizing Item Response Data} \description{ Summarizing and visualizing \code{"itemresp"} data objects. } \usage{ \method{summary}{itemresp}(object, items = NULL, abbreviate = FALSE, mscale = TRUE, simplify = TRUE, sep = " ", \dots) \method{plot}{itemresp}(x, xlab = "", ylab = "", items = NULL, abbreviate = FALSE, mscale = TRUE, sep = "\n", off = 2, axes = TRUE, names = TRUE, srt = 45, adj = c(1.1, 1.1), \dots) } \arguments{ \item{object, x}{an object of class \code{"itemresp"}.} \item{items}{character or integer for subsetting the items to be summarized/visualized. By default, all items are used.} \item{abbreviate}{logical or integer. Should scale labels be abbreviated? Alternatively, an integer with the desired abbreviation length. The default is some heuristic based on the length of the labels.} \item{mscale}{logical. Should mscale values be used for printing/plotting? If \code{FALSE}, integers 0, 1, \dots are used.} \item{simplify}{logical. Should the summary table be collapsed into a matrix or returned as a list?} \item{sep}{character. A character for separating item labels from their corresponding scale labels (if any).} \item{xlab, ylab, off, axes, \dots}{arguments passed to \code{\link[graphics]{spineplot}}.} \item{names}{logical or character. If \code{TRUE}, the names of the items are displayed on the x-axis. If \code{FALSE}, numbers of items are shown. Alternatively a character vector of the same length as the number of items can be supplied.} \item{srt, adj}{numeric. Angle (\code{srt}) and adjustment (\code{adj}) in case names (rather than numbers) are used as x-axis labels. These are passed to \code{\link[graphics]{text}}.} } \details{ The \code{plot} method essentially just calls \code{summary} (passing on most further arguments) and then visualizes the result as a \code{spineplot}. } \seealso{\code{\link{itemresp}}, \code{\link[graphics]{spineplot}}} \examples{ ## summary/visualization for verbal aggression data data("VerbalAggression", package = "psychotools") r <- itemresp(VerbalAggression$resp[, 1:6]) mscale(r) <- c("no", "perhaps", "yes") summary(r) plot(r) ## modify formatting of mscale summary(r, abbreviate = 1) summary(r, mscale = FALSE) ## illustration for varying mscale across items ## merge with additional random binary response b <- itemresp(rep(c(-1, 1), length.out = length(r)), mscale = c(-1, 1), labels = "Dummy") rb <- merge(r[, 1:2], b) head(rb, 2) ## summary has NAs for non-existent response categories summary(rb) summary(rb, mscale = FALSE) plot(rb, srt = 25) plot(rb, mscale = FALSE) } \keyword{classes} psychotools/man/subset.itemresp.Rd0000644000176200001440000000365512022326334017044 0ustar liggesusers\name{subset.itemresp} \alias{subset.itemresp} \alias{merge.itemresp} \alias{c.itemresp} \alias{[.itemresp} \title{Subsetting Item Response Data} \description{ Subsetting and combining \code{"itemresp"} data objects. } \usage{ \method{subset}{itemresp}(x, items = NULL, subjects = NULL, \dots) } \arguments{ \item{x}{an object of class \code{"itemresp"}.} \item{items}{character, integer, or logical for subsetting the items.} \item{subjects}{character, integer, or logical for subsetting the subjects.} \item{\dots}{currently not used.} } \details{ The \code{subset} method selects subsets of items and/or subjects in item response data. Alternatively, the \code{[} method can be used with the row index corresponding to subjects and the column index corresponding to items. The \code{c} method can be used to combine item response data from different subjects for the same items The \code{merge} method can be used to combine item response data from the same subjects for different items. } \seealso{\code{\link{itemresp}}} \examples{ ## binary responses to three items, coded as matrix x <- cbind(c(1, 0, 1, 0), c(1, 0, 0, 0), c(0, 1, 1, 1)) xi <- itemresp(x) ## subsetting/indexing xi[2] xi[-(3:4)] xi[c(TRUE, TRUE, FALSE, FALSE)] subset(xi, items = 1:2) # or xi[, 1:2] subset(xi, items = -2, subjects = 2:3) ## combine two itemresp vectors for different subjects but the same items xi12 <- xi[1:2] xi34 <- xi[3:4] c(xi12, xi34) ## combine two itemresp vectors for the same subjects but different items ## polytomous responses in a data frame d <- data.frame(q1 = c(-2, 1, -1, 0), q2 = factor(c(1, 3, 1, 3), levels = 1:3, labels = c("disagree", "neutral", "agree"))) di <-itemresp(d) merge(xi, di) ## if subjects have names/IDs, these are used for merging names(xi) <- c("John", "Joan", "Jen", "Jim") names(di) <- c("Joan", "Jen", "Jim", "Jo") merge(xi, di) merge(xi, di, all = TRUE) } \keyword{classes} psychotools/man/SoundQuality.Rd0000644000176200001440000000576113462031540016352 0ustar liggesusers\name{SoundQuality} \alias{SoundQuality} \title{Quality of Multichannel Reproduced Sound} \description{ Paired comparison judgments of 40 selected listeners with respect to eight audio reproduction modes and four types of music. } \usage{data("SoundQuality")} \format{ A data frame containing 783 observations on 6 variables. \describe{ \item{id}{Factor. Listener ID.} \item{time}{Factor. Listening experiment before or after elicitation and scaling of more specific auditory attributes.} \item{progmat}{Factor. The program material: Beethoven, Rachmaninov, Steely Dan, Sting.} \item{repet}{The repetition within each time point.} \item{session}{The experimental session coding the presentation order of the program material.} \item{preference}{Paired comparison of class \code{\link{paircomp}}. Preferences for all 28 paired comparisons from 8 audio reproduction modes: Mono, Phantom Mono, Stereo, Wide-Angle Stereo, 4-channel Matrix, 5-channel Upmix 1, 5-channel Upmix 2, and 5-channel Original.} } } \details{ The data were collected within a series of experiments conducted at the Sound Quality Research Unit (SQRU), Department of Acoustics, Aalborg University, Denmark, between September 2004 and March 2005. The results of scaling listener preference and spatial and timbral auditory attributes are reported in Choisel and Wickelmaier (2007). Details about the loudspeaker setup and calibration are given in Choisel and Wickelmaier (2006). The attribute elicitation procedure is described in Wickelmaier and Ellermeier (2007) and in Choisel and Wickelmaier (2006). The selection of listeners for the experiments is described in Wickelmaier and Choisel (2005). An extended version of this data set, including judgments on spatial and timbral auditory attributes and including listener variables, is available via \code{data("soundquality", package = "eba")}. } \references{ Choisel S, Wickelmaier F (2006). Extraction of Auditory Features and Elicitation of Attributes for the Assessment of Multichannel Reproduced Sound. \emph{Journal of the Audio Engineering Society}, \bold{54}(9), 815--826. Choisel S, Wickelmaier F (2007). Evaluation of Multichannel Reproduced Sound: Scaling Auditory Attributes Underlying Listener Preference. \emph{Journal of the Acoustical Society of America}, \bold{121}(1), 388--400. \doi{10.1121/1.2385043} Wickelmaier F, Choisel S (2005). Selecting Participants for Listening Tests of Multichannel Reproduced Sound. Presented at the AES 118th Convention, May 28--31, Barcelona, Spain, convention paper 6483. Wickelmaier F, Ellermeier W (2007). Deriving Auditory Features from Triadic Comparisons. \emph{Perception & Psychophysics}, \bold{69}(2), 287--297. \doi{10.3758/BF03193750} } \seealso{\code{\link{paircomp}}} \examples{ data("SoundQuality", package = "psychotools") summary(SoundQuality$preference) ftable(xtabs(~ time + repet + progmat, data = SoundQuality)) } \keyword{datasets} psychotools/man/SourceMonitoring.Rd0000644000176200001440000000476112745627325017235 0ustar liggesusers\name{SourceMonitoring} \alias{SourceMonitoring} \title{Performance in a Source-Monitoring Experiment} \description{ Response frequencies of 128 participants who took part in a source-monitoring experiment with two sources. } \usage{data("SourceMonitoring")} \format{ A data frame containing 128 observations on four components. \describe{ \item{sources}{Factor. Sources A and B.} \item{age}{Integer. Age of the respondents in years.} \item{gender}{Factor coding gender.} \item{y}{Matrix containing the response frequencies. The column names indicate the nine response categories: \tabular{rl}{ \code{a.a} \tab Number of source A items judged to be of source A.\cr \code{a.b} \tab Number of source A items judged to be of source B.\cr \code{a.n} \tab Number of source A items judged to be new.\cr \code{b.a} \tab Number of source B items judged to be of source A.\cr \code{b.b} \tab Number of source B items judged to be of source B.\cr \code{b.n} \tab Number of source B items judged to be new.\cr \code{n.a} \tab Number of new items judged to be of source A.\cr \code{n.b} \tab Number of new items judged to be of source B.\cr \code{n.n} \tab Number of new items judged to be new. } } } } \details{ In a source-monitoring experiment with two sources, participants study items from two different sources, A and B. The final memory test consists of A and B items along with new distractor items, N. Participants are required to classify each item as A, B, or N. In an experiment at the Department of Psychology, University of Tuebingen, two source conditions were used in the study phase: In the first one, subjects had to read items either quietly (think) or aloud (say). In the second, they wrote them down (write) or read them aloud (say). The data were analyzed using the multinomial processing tree model of source monitoring (Batchelder & Riefer, 1990). } \source{ Wickelmaier F, Zeileis A (2013). A First Implementation of Recursive Partitioning for Multinomial Processing Tree Models. Presented at the Psychoco 2013 International Workshop on Psychometric Computing, February 14--15, Zurich, Switzerland. } \references{ Batchelder WH, Riefer DM (1990). Multinomial Processing Tree Models of Source Monitoring. \emph{Psychological Review}, \bold{97}, 548--564. } \examples{ data("SourceMonitoring", package = "psychotools") xtabs(~ gender + I(age >= 30) + sources, SourceMonitoring) } \keyword{datasets} psychotools/man/ConspiracistBeliefs2016.Rd0000644000176200001440000000776013356511544020167 0ustar liggesusers\name{ConspiracistBeliefs2016} \alias{ConspiracistBeliefs2016} \title{Generic Conspiracist Beliefs Scale (2016 Data)} \description{ Responses of 2449 persons to 15 five-point likert-rated items (0 = disagree to 4 = agree) measuring belief in conspiracy theories as well as responses on 2 covariates. } \usage{data("ConspiracistBeliefs2016", package = "psychotools")} \format{ A data frame containing 2449 observations on 3 variables. \describe{ \item{resp}{Item response matrix with 15 items (see details below).} \item{area}{Factor coding the area one lived in as a child (\code{"rural"}, \code{"suburban"}, \code{"urban"}).} \item{gender}{Factor coding gender (\code{"male"}, \code{"female"}, \code{"other"}).} } } \details{ The Open Source Psychometrics Project published this dataset collected online in 2016. Persons responded to the Generic Conspiracist Beliefs (GCB) Scale (Brotherton, French & Pickering, 2013) as well as other additional questions primarily for personal amusement. At the end of the test but before the results were displayed, users were asked if they would allow their responses to be saved for research. Only users who agreed are part of this dataset. Individuals with age lower than 13 years were not recorded. Moreover, two persons stating their age to be 5555 years or higher as well as 44 persons with missing data in \code{area} or \code{gender} were excluded from this dataset. The 15 items of the GCB Scale are: \tabular{rl}{ Q1:\tab The government is involved in the murder of innocent citizens and/or well-known public figures, and keeps this a secret.\cr Q2:\tab The power held by heads of state is second to that of small unknown groups who really control world politics.\cr Q3:\tab Secret organizations communicate with extraterrestrials, but keep this fact from the public.\cr Q4:\tab The spread of certain viruses and/or diseases is the result of the deliberate, concealed efforts of some organization.\cr Q5:\tab Groups of scientists manipulate, fabricate, or suppress evidence in order to deceive the public.\cr Q6:\tab The government permits or perpetrates acts of terrorism on its own soil, disguising its involvement.\cr Q7:\tab A small, secret group of people is responsible for making all major world decisions, such as going to war.\cr Q8:\tab Evidence of alien contact is being concealed from the public.\cr Q9:\tab Technology with mind-control capacities is used on people without their knowledge.\cr Q10:\tab New and advanced technology which would harm current industry is being suppressed.\cr Q11:\tab The government uses people as patsies to hide its involvement in criminal activity.\cr Q12:\tab Certain significant events have been the result of the activity of a small group who secretly manipulate world events.\cr Q13:\tab Some UFO sightings and rumors are planned or staged in order to distract the public from real alien contact.\cr Q14:\tab Experiments involving new drugs or technologies are routinely carried out on the public without their knowledge or consent.\cr Q15:\tab A lot of important information is deliberately concealed from the public out of self-interest. } Additional information can be found online (see below) via inspecting the codebook contained in \file{GCBS.zip}. } \source{\url{https://openpsychometrics.org/_rawdata/}.} \references{ Brotherton R, French CC, Pickering AD (2013). Measuring Belief in Conspiracy Theories: The Generic Conspiracist Beliefs Scale. \emph{Frontiers in Psychology}, \bold{4}, 279. Open Source Psychometrics Project (2016). Data From: The Generic Conspiracist Beliefs Scale [Dataset]. Retrieved from \url{https://openpsychometrics.org/_rawdata/}. } \seealso{\code{\link{gpcmodel}}} \examples{ ## overview data("ConspiracistBeliefs2016", package = "psychotools") str(ConspiracistBeliefs2016) ## response plot(itemresp(ConspiracistBeliefs2016$resp)) ## covariates summary(ConspiracistBeliefs2016[, -1]) } \keyword{datasets} psychotools/man/profileplot.Rd0000644000176200001440000001153713613777174016270 0ustar liggesusers\name{profileplot} \alias{profileplot} \title{Profile Plots for IRT Models} \description{ Base graphics plotting function for profile plot visualization of IRT models. } \usage{ profileplot(object, what = c("items", "thresholds", "discriminations", "guessings", "uppers"), parg = list(type = NULL, ref = NULL, alias = TRUE, logit = FALSE), index = TRUE, names = TRUE, main = NULL, abbreviate = FALSE, ref = TRUE, col = "lightgray", border = "black", pch = NULL, cex = 1, refcol = "lightgray", linecol = "black", lty = 2, ylim = NULL, xlab = NULL, ylab = NULL, add = FALSE, srt = 45, adj = c(1.1, 1.1), axes = TRUE, \dots) } \arguments{ \item{object}{a fitted model object of class \code{"raschmodel"}, \code{"rsmodel"}, \code{"pcmodel"}, \code{"plmodel"} or \code{"gpcmodel"}.} \item{what}{character, specifying the type of parameters to be plotted.} \item{parg}{list of arguments passed over to internal calls of \code{\link{itempar}}, \code{\link{threshpar}}, \code{\link{discrpar}}, \code{\link{guesspar}}, or \code{\link{upperpar}}.} \item{index}{logical, should different indexes for different items be used?} \item{names}{logical or character. If \code{TRUE}, the names of the items are displayed on the x-axis. If \code{FALSE}, numbers of items are shown. Alternatively a character vector of the same length as the number of items can be supplied.} \item{main}{character, specifying the overall title of the plot.} \item{abbreviate}{logical or numeric, specifying whether object names are to be abbreviated. If numeric this controls the length of the abbreviation.} \item{ref}{logical, whether to draw a horizontal line for the reference level. Only takes effect if argument \code{what} is \code{"items"} or \code{"discriminations".}} \item{col, border, pch, cex}{graphical appearance of plotting symbols. Can be of the same length as the number of items, i.e., a different graphical appearance is used for each item. If \code{what = "thresholds"}, \code{col} and \code{pch} can be matrices with a number of columns equal to the number of threshold parameters per item resulting in different symbols and colors used for different threshold parameter profiles.} \item{refcol}{character, specifying the line color for the reference line (if \code{ref} is set to \code{TRUE}).} \item{linecol}{character or numeric, specifying the line color to be used for the profiles.} \item{lty}{numeric, specifying the line type for the profiles.} \item{ylim}{numeric, specifying the y axis limits.} \item{xlab, ylab}{character, specifying the x and y axis labels.} \item{add}{logical. If \code{TRUE}, new plotted profiles are added to an existing plot.} \item{srt, adj}{numeric. Angle (\code{srt}) and adjustment (\code{adj}) in case names (rather than numbers) are used as x-axis labels. These are passed to \code{\link[graphics]{text}}.} \item{axes}{logical. Should axes be drawn?} \item{\dots}{further arguments passed over to \code{\link{plot}}.} } \details{ The profile plot visualization illustrates profiles of specific estimated parameters under a certain IRT model. } \seealso{\code{\link{curveplot}}, \code{\link{regionplot}}, \code{\link{infoplot}}, \code{\link{piplot}}} \examples{ ## load verbal aggression data data("VerbalAggression", package = "psychotools") ## fit Rasch, rating scale and partial credit model to verbal aggression data rmmod <- raschmodel(VerbalAggression$resp2) rsmod <- rsmodel(VerbalAggression$resp) pcmod <- pcmodel(VerbalAggression$resp) ## profile plots of the item parameters of the three fitted IRT models plot(rmmod, type = "profile", what = "items", col = 4) plot(rsmod, type = "profile", what = "items", col = 2, add = TRUE) plot(pcmod, type = "profile", what = "items", col = 3, add = TRUE) legend(x = "topleft", legend = c("RM", "RSM", "PCM"), col = 1, bg = c(4, 2, 3), pch = 21, bty = "n") ## profile plots of the threshold parameters of type "mode" plot(rmmod, type = "profile", what = "thresholds", parg = list(type = "mode")) plot(rsmod, type = "profile", what = "thresholds", parg = list(type = "mode")) plot(pcmod, type = "profile", what = "thresholds", parg = list(type = "mode")) ## profile plot of the discrimination parameters of the dichotomous RM plot(rmmod, type = "profile", what = "discrimination") \donttest{ if(requireNamespace("mirt")) { ## fit 2PL and generalized partial credit model to verbal aggression data twoplmod <- plmodel(VerbalAggression$resp2) gpcmod <- gpcmodel(VerbalAggression$resp) ## profile plot of the discrimination parameters of a dichotomous 2PL plot(twoplmod, type = "profile", what = "discrimination") ## profile plot of the item parameters of the 2PL and GPCM plot(twoplmod, type = "profile", what = "items", col = 4) plot(gpcmod, type = "profile", what = "items", col = 2, add = TRUE) } } } \keyword{aplot} psychotools/man/labels.Rd0000644000176200001440000000076111633517133015153 0ustar liggesusers\name{labels<-} \alias{labels<-} \title{Set Labels} \description{ A generic function for setting labels for an object. } \usage{ labels(object) <- value } \arguments{ \item{object}{an object.} \item{value}{an object.} } \examples{ ## method for "paircomp" data pc <- paircomp(rbind( c(1, 1, 1), # a > b, a > c, b > c c(1, 1, -1), # a > b, a > c, b < c c(1, -1, -1), # a > b, a < c, b < c c(1, 1, 1))) labels(pc) labels(pc) <- c("ah", "be", "ce") pc } \keyword{classes} psychotools/man/PairClustering.Rd0000644000176200001440000000340312762564314016647 0ustar liggesusers\name{PairClustering} \alias{PairClustering} \title{Pair Clustering Data in Klauer (2006)} \description{ Response frequencies of 63 participants who took part in a pair-clustering experiment. } \usage{data("PairClustering")} \format{ A data frame containing 126 observations on 8 variables. \describe{ \item{ID}{Participant ID.} \item{trial}{Trial number, 1 or 2.} \item{E1}{Number of pairs recalled adjacently.} \item{E2}{Number of pairs recalled non-adjacently.} \item{E3}{Number of single pair members recalled.} \item{E4}{Number of non-recalled pairs.} \item{F1}{Number of recalled singleton words.} \item{F2}{Number of non-recalled singleton words.} } } \details{ Klauer (2006) reports a pair-clustering experiment with 63 participants, who were presented with ten pairs of related words and five unrelated singleton words. In a later memory test, they freely recalled the presented words. This procedure was repeated for two study and test trials. For pairs, responses were classified into four categories: both words in a pair are recalled adjacently (E1) or non-adjacently (E2), one word in a pair is recalled (E3), neither word in a pair is recalled (E4); for singletons, into two categories: word recalled (F1), word not recalled (F2). } \source{ Stahl C, Klauer KC (2007). HMMTree: A Computer Program for Latent-Class Hierarchical Multinomial Processing Tree Models. \emph{Behavior Research Methods}, \bold{39}, 267--273. } \references{ Klauer KC (2006). Hierarchical Multinomial Processing Tree Models: A Latent-Class Approach. \emph{Psychometrika}, \bold{71}, 1--31. } \examples{ data("PairClustering", package = "psychotools") aggregate(cbind(E1, E2, E3, E4, F1, F2) ~ trial, PairClustering, sum) } \keyword{datasets} psychotools/man/piplot.Rd0000644000176200001440000001015613613777056015233 0ustar liggesusers\name{piplot} \alias{piplot} \title{Person-Item Plots for IRT Models} \description{ Base graphics plotting function for person-item plot visualization of IRT models. } \usage{ piplot(object, pcol = NULL, histogram = TRUE, ref = NULL, items = NULL, xlim = NULL, names = NULL, labels = TRUE, main = "Person-Item Plot", xlab = "Latent trait", abbreviate = FALSE, cex.axis = 0.8, cex.text = 0.5, cex.points = 1.5, grid = TRUE, \dots) } \arguments{ \item{object}{a fitted model object of class \code{"raschmodel"}, \code{"rsmodel"}, \code{"pcmodel"}, \code{"plmodel"} or \code{"gpcmodel"}.} \item{pcol}{optional character (vector), specifying the color(s) used for the person parameter plot.} \item{histogram}{logical. For models estimated via MML (\code{plmodel}s and \code{gpcmodel}s), should a histogram of the person-wise (individual) person parameters be drawn additionally to the normal distribution density of the person parameters?} \item{ref}{argument passed over to internal calls of \code{\link{threshpar}} and \code{\link{itempar}}.} \item{items}{character or numeric, specifying the items which should be visualized in the person-item plot.} \item{xlim}{numeric, specifying the x axis limits.} \item{names}{character, specifying labels for the items.} \item{labels}{logical, whether to draw the number of the threshold as text below the threshold.} \item{main}{character, specifying the overall title of the plot.} \item{xlab}{character, specifying the x axis labels.} \item{abbreviate}{logical or numeric, specifying whether object names are to be abbreviated. If numeric, this controls the length of the abbreviation.} \item{cex.axis}{numeric, the magnification to be used for the axis notation relative to the current setting of \code{cex}.} \item{cex.text}{numeric, the magnification to be used for the symbols relative to the current setting of \code{cex}.} \item{cex.points}{numeric, the magnification to be used for the points relative to the current setting of \code{cex}.} \item{grid}{logical or color specification of horizontal grid lines. If set to \code{FALSE} or \code{"transparent"} grid lines can be suppressed.} \item{\dots}{further arguments passed to internal calls of \code{\link{lines}}, \code{\link{points}} and \code{\link{text}}.} } \details{ The person-item plot visualization illustrates the distribution of the person parameters against the absolute item threshold parameters under a certain data set and IRT model. For models estimated via MML (\code{plmodel}s and \code{gpcmodel}s), the normal distribution density of the person parameters is drawn. If \code{histogram} is set to \code{TRUE} (the default), a histogram of the person-wise (individual) person parameters is drawn additionally. If a multiple group model has been fitted by supplying an \code{impact} variable, multiple person parameter plots are drawn, each corresponding to a specific level of this variable. } \seealso{\code{\link{curveplot}}, \code{\link{regionplot}}, \code{\link{profileplot}}, \code{\link{infoplot}}} \examples{ ## load verbal agression data data("VerbalAggression", package = "psychotools") ## fit partial credit model to verbal aggression data pcmod <- pcmodel(VerbalAggression$resp) ## create a person-item plot visualization of the fitted PCM plot(pcmod, type = "piplot") ## just visualize the first six items and the person parameter plot plot(pcmod, type = "piplot", items = 1:6, pcol = "lightblue") \donttest{ if(requireNamespace("mirt")) { ## fit generalized partial credit model to verbal aggression data gpcmod <- gpcmodel(VerbalAggression$resp) ## create a person-item plot visualization of the fitted GPCM plot(gpcmod, type = "piplot") ## turn off the histogram and grid plot(gpcmod, type = "piplot", histogram = FALSE, grid = FALSE) ## fit GPCM to verbal aggression data accounting for gender impact mgpcmod <- gpcmodel(VerbalAggression$resp, impact = VerbalAggression$gender) ## create a person-item plot visualization of the fitted GPCM plot(mgpcmod, type = "piplot", pcol = c("darkgreen", "darkorange")) } } } \keyword{aplot} psychotools/man/covariates.Rd0000644000176200001440000000126111633517130016042 0ustar liggesusers\name{covariates} \alias{covariates} \alias{covariates<-} \title{Extract/Set Covariates} \description{ A generic function for extracting/setting covariates for an object. } \usage{ covariates(object, \dots) covariates(object) <- value } \arguments{ \item{object}{an object.} \item{\dots}{arguments passed to methods.} \item{value}{an object.} } \examples{ ## method for "paircomp" data pc <- paircomp(rbind( c(1, 1, 1), # a > b, a > c, b > c c(1, 1, -1), # a > b, a > c, b < c c(1, -1, -1), # a > b, a < c, b < c c(1, 1, 1))) covariates(pc) covariates(pc) <- data.frame(foo = factor(c(1, 2, 2), labels = c("foo", "bar"))) covariates(pc) } \keyword{classes} psychotools/man/gpcmodel.Rd0000644000176200001440000002155513405673530015512 0ustar liggesusers\name{gpcmodel} \alias{gpcmodel} \alias{print.gpcmodel} \alias{summary.gpcmodel} \alias{print.summary.gpcmodel} \alias{coef.gpcmodel} \alias{bread.gpcmodel} \alias{estfun.gpcmodel} \alias{logLik.gpcmodel} \alias{vcov.gpcmodel} \title{Generalized Partial Credit Model Fitting Function} \description{ \code{gpcmodel} is a basic fitting function for generalized partial credit models providing a wrapper around \code{\link[mirt]{mirt}} and \code{\link[mirt]{multipleGroup}} relying on marginal maximum likelihood (MML) estimation via the standard EM algorithm. } \usage{ gpcmodel(y, weights = NULL, impact = NULL, type = c("GPCM", "PCM"), grouppars = FALSE, vcov = TRUE, nullcats = "downcode", start = NULL, method = "BFGS", maxit = 500, reltol = 1e-5, ...) } \arguments{ \item{y}{item response object that can be coerced (via \code{\link[base]{as.matrix}}) to a numeric matrix with scores 0, 1, \dots Typically, either already a matrix, data frame, or dedicated object of class \code{\link{itemresp}}.} \item{weights}{an optional vector of weights (interpreted as case weights)}. \item{impact}{an optional \code{factor} allowing for grouping the subjects (rows). If specified, a multiple-group model is fitted to account for impact (see details below). By default, no impact is modelled, i.e., a single-group model is used.} \item{type}{character string, specifying the type of model to be estimated. In addition to the default GPCM (generalized partial credit model) it is also possible to estimate a standard PCM (partial credit model) by marginal maximum likelihood (MML).} \item{grouppars}{logical. Should the estimated distributional group parameters of a multiple group model be included in the model parameters?} \item{vcov}{logical or character specifying the type of variance-covariance matrix (if any) computed for the final model. The default \code{vcov = TRUE} corresponds to \code{vcov = "Oakes"}, see \code{\link[mirt]{mirt}} for further options. If set to \code{vcov = FALSE} (or \code{vcov = "none"}), \code{vcov()} will return a matrix of \code{NA}s only.} \item{nullcats}{character string, specifying how items with null categories (i.e., categories not observed) should be treated. Currently only \code{"downcode"} is available, i.e., all categories above a null category are shifted down to close the observed gap(s).} \item{start}{an optional vector or list of starting values (see examples below).} \item{method, maxit, reltol}{control parameters for the optimizer employed by \code{\link[mirt]{mirt}} for the EM algorithm.} \item{\dots}{further arguments passed to \code{\link[mirt]{mirt}} or \code{\link[mirt]{multipleGroup}}, respectively.} } \details{ \code{gpcmodel} provides a basic fitting function for generalized partial credit models (GPCMs) providing a wrapper around \code{\link[mirt]{mirt}} (and \code{\link[mirt]{multipleGroup}}, respectively) relying on MML estimation via the standard EM algorithm (Bock & Aitkin, 1981). Models are estimated under the slope/intercept parametrization, see e.g. Chalmers (2012). The probability of person \eqn{i} falling into category \eqn{x_{ij}} of item \eqn{j} out of all categories \eqn{p_{j}} is modelled as: \deqn{P(X_{ij} = x_{ij}|\theta_{i},a_{j},\boldsymbol{d_{j}}) = \frac{\exp{(x_{ij}a_{j}\theta_{i} + d_{jx_{ij}})}}{\displaystyle\sum_{k = 0} ^ {p_{j}}\exp{(ka_{j}\theta_{i} + d_{jk})}}} Note that all \eqn{d_{j0}} are fixed at 0. A reparametrization of the intercepts to the classical IRT parametrization, see e.g. Muraki (1992), is provided via \code{\link{threshpar}}. If an optional \code{impact} variable is supplied, a multiple-group model of the following form is being fitted: Item parameters are fixed to be equal across the whole sample. For the first group of the \code{impact} variable the person parameters are fixed to follow the standard normal distribution. In the remaining \code{impact} groups, the distributional parameters (mean and variance of a normal distribution) of the person parameters are estimated freely. See e.g. Baker & Kim (2004, Chapter 11) or Debelak & Strobl (2018) for further details. To improve convergence of the model fitting algorithm, the first level of the \code{impact} variable should always correspond to the largest group. If this is not the case, levels are re-ordered internally. If \code{grouppars} is set to \code{TRUE} the freely estimated distributional group parameters (if any) are returned as part of the model parameters. Instead of the default GPCM, a standard partial credit model (PCM) can also be estimated via MML by setting \code{type = "PCM"}. In this case all slopes are restricted to be equal across all items. \code{gpcmodel} returns an object of class \code{"gpcmodel"} for which several basic methods are available, including \code{print}, \code{plot}, \code{summary}, \code{coef}, \code{vcov}, \code{logLik}, \code{estfun}, \code{\link{discrpar}}, \code{\link{itempar}}, \code{\link{threshpar}}, and \code{\link{personpar}}. } \value{ \code{gpcmodel} returns an S3 object of class \code{"gpcmodel"}, i.e., a list of the following components: \item{coefficients}{estimated model parameters in slope/intercept parametrization,} \item{vcov}{covariance matrix of the model parameters,} \item{data}{modified data, used for model-fitting, i.e., centralized so that the first category is zero for all items, treated null categories as specified via argument \code{"nullcats"} and without observations with zero weight,} \item{items}{logical vector of length \code{ncol(y)}, indicating which items were used during estimation,} \item{categories}{list of length \code{ncol(y)}, containing integer vectors starting from one to the number of categories minus one per item,} \item{n}{number of observations (with non-zero weights),} \item{n_org}{original number of observations in \code{y},} \item{weights}{the weights used (if any),} \item{na}{logical indicating whether the data contain \code{NA}s,} \item{nullcats}{currently always \code{NULL} as eventual items with null categories are handled via \code{"downcode"},} \item{impact}{either \code{NULL} or the supplied \code{impact} variable with the levels reordered in decreasing order (if this has not been the case prior to fitting the model),} \item{loglik}{log-likelihood of the fitted model,} \item{df}{number of estimated (more precisely, returned) model parameters,} \item{code}{convergence code from \code{mirt},} \item{iterations}{number of iterations used by \code{mirt},} \item{reltol}{convergence threshold passed to \code{mirt},} \item{grouppars}{the logical \code{grouppars} value,} \item{type}{the \code{type} of model restriction specified,} \item{mirt}{the \code{mirt} object fitted internally.} } \references{ Baker FB, Kim SH (2004). \emph{Item Response Theory: Parameter Estimation Techniques}. Chapman & Hall/CRC, Boca Raton. Bock RD, Aitkin M (1981). Marginal Maximum Likelihood Estimation of Item Parameters: Application of an EM Algorithm. \emph{Psychometrika}, \bold{46}(4), 443--459. Chalmers RP (2012). mirt: A Multidimensional Item Response Theory Package for the R Environment. \emph{Journal of Statistical Software}, \bold{48}(6), 1--29. \doi{10.18637/jss.v048.i06} Debelak R, Strobl C (2018). Investigating Measurement Invariance by Means of Parameter Instability Tests for 2PL and 3PL Models. \emph{Educational and Psychological Measurement}, forthcoming. \doi{10.1177/0013164418777784} Muraki E (1992). A Generalized Partial Credit Model: Application of an EM Algorithm. \emph{Applied Psychological Measurement}, \bold{16}(2), 159--176. } \seealso{\code{\link{pcmodel}}, \code{\link{rsmodel}}, \code{\link{plmodel}}, \code{\link{raschmodel}}, \code{\link{btmodel}}} \examples{ if(requireNamespace("mirt")) { o <- options(digits = 4) ## mathematics 101 exam results data("MathExam14W", package = "psychotools") ## generalized partial credit model gpcm <- gpcmodel(y = MathExam14W$credit) summary(gpcm) ## how to specify starting values as a vector of model parameters st <- coef(gpcm) gpcm <- gpcmodel(y = MathExam14W$credit, start = st) ## or a list containing a vector of slopes and a list of intercept vectors ## itemwise set.seed(0) st <- list(a = rlnorm(13, 0, 0.0625), d = replicate(13, rnorm(2, 0, 1), FALSE)) gpcm <- gpcmodel(y = MathExam14W$credit, start = st) ## visualizations plot(gpcm, type = "profile") plot(gpcm, type = "regions") plot(gpcm, type = "piplot") plot(gpcm, type = "curves", xlim = c(-6, 6)) plot(gpcm, type = "information", xlim = c(-6, 6)) ## visualizing the IRT parametrization plot(gpcm, type = "curves", xlim = c(-6, 6), items = 1) abline(v = threshpar(gpcm)[[1]]) abline(v = itempar(gpcm)[1], lty = 2) options(digits = o$digits) } } \keyword{regression} psychotools/man/plot.btmodel.Rd0000644000176200001440000000271113277203716016316 0ustar liggesusers\name{plot.btmodel} \alias{plot.btmodel} \title{Visualizing Bradley-Terry Models} \description{ Base graphics plotting function for Bradley-Terry models. } \usage{ \S3method{plot}{btmodel}(x, worth = TRUE, index = TRUE, names = TRUE, ref = TRUE, abbreviate = FALSE, type = NULL, lty = NULL, xlab = "Objects", ylab = NULL, \dots) } \arguments{ \item{x}{an object of class \code{"btmodel"}.} \item{worth}{logical. Should worth parameters (or alternatively coefficients on log-scale) be displayed?} \item{index}{logical. Should different indexes for different items be used?} \item{names}{logical. Should the names for the objects be displayed?} \item{ref}{logical. Should a horizontal line for the reference level be drawn? Alternatively, \code{ref} can also be numeric or character to employ a reference level different from that stored in \code{x}.} \item{abbreviate}{logical or numeric. Should object names be abbreviated? If numeric this controls the length of the abbreviation.} \item{type}{plot type. Default is \code{"b"} if \code{index} is \code{TRUE}.} \item{lty}{line type.} \item{xlab, ylab}{x and y axis labels.} \item{\dots}{further arguments passed to \code{\link{plot}}.} } \seealso{\code{\link{btmodel}}} \examples{ ## data data("GermanParties2009", package = "psychotools") ## Bradley-Terry model bt <- btmodel(GermanParties2009$preference) plot(bt) plot(bt, worth = FALSE) plot(bt, index = FALSE) } \keyword{hplot} psychotools/man/threshpar.Rd0000644000176200001440000001664713406033765015727 0ustar liggesusers\name{threshpar} \alias{threshpar} \alias{threshpar.raschmodel} \alias{threshpar.rsmodel} \alias{threshpar.pcmodel} \alias{threshpar.plmodel} \alias{threshpar.gpcmodel} \alias{coef.threshpar} \alias{print.threshpar} \title{Extract Threshold Parameters of Item Response Models} \description{ A class and generic function for representing and extracting the item threshold parameters of a given item response model. } \usage{ threshpar(object, \dots) \method{threshpar}{raschmodel}(object, type = c("mode", "median", "mean"), ref = NULL, alias = TRUE, relative = FALSE, cumulative = FALSE, vcov = TRUE, \dots) \method{threshpar}{rsmodel}(object, type = c("mode", "median", "mean"), ref = NULL, alias = TRUE, relative = FALSE, cumulative = FALSE, vcov = TRUE, \dots) \method{threshpar}{pcmodel}(object, type = c("mode", "median", "mean"), ref = NULL, alias = TRUE, relative = FALSE, cumulative = FALSE, vcov = TRUE, \dots) \method{threshpar}{plmodel}(object, type = c("mode", "median", "mean"), ref = NULL, alias = TRUE, relative = FALSE, cumulative = FALSE, vcov = TRUE, \dots) \method{threshpar}{gpcmodel}(object, type = c("mode", "median", "mean"), ref = NULL, alias = TRUE, relative = FALSE, cumulative = FALSE, vcov = TRUE, \dots) } \arguments{ \item{object}{a fitted model object whose threshold parameters should be extracted.} \item{type}{character of length one which determines the type of threshold parameters to return (see details below).} \item{ref}{a vector of labels or position indices of (relative) threshold parameters or a contrast matrix which should be used as restriction/for normalization. For partial credit models, argument \code{ref} can also be a list of contrasts. If \code{NULL} (the default), for all models except models etimated via MML, the relative threshold parameters are centered around their item-specific means and the absolute threshold parameters are centered around their global mean. For models estimated via MML (\code{plmodel}s and \code{gpcmodel}s), the parameters are by default identified via the distributional parameters of the person parameters (mean and variance of a normal distribution). Nevertheless, a restriction on the interval scale can be applied.} \item{alias}{logical. If \code{TRUE} (the default), the aliased parameter is included in the return vector (and in the variance-covariance matrix if \code{vcov} = TRUE). If \code{FALSE}, it is removed. If the restriction given in \code{ref} depends on several parameters, the first parameter of the restriction specified is (arbitrarily) chosen to be removed if \code{alias} is \code{FALSE}.} \item{relative}{logical. If set to \code{FALSE} (default), absolute item threshold parameters are returned. If set to \code{TRUE}, relative item threshold parameters with the contrast specified in argument \code{ref} are returned.} \item{cumulative}{logical. If set to \code{TRUE}, cumulative threshold parameters are returned. These correspond to the cumulative sum over the absolute or relative item threshold parameters (after the restriction given in argument \code{ref} has been applied).} \item{vcov}{logical. If \code{TRUE} (the default), the (transformed) variance-covariance matrix of the (relative) threshold parameters is attached as attribute \code{vcov}. If \code{FALSE}, a \code{NA}-matrix is attached.} \item{\dots}{further arguments which are currently not used.} } \details{ \code{threshpar} is both, a class to represent threshold parameters of item response models as well as a generic function. The generic function can be used to extract the threshold parameters of a given item response model. For objects of class \code{threshpar}, methods to standard generic functions \code{print} and \code{coef} can be used to print and extract the threshold parameters. Depending on argument \code{type}, different item threshold parameters are returned. For \code{type = "mode"}, the returned item threshold parameters correspond to the location on the theta axis where the probability of category \eqn{k} equals the probability of category \eqn{k-1}. For Rasch and partial credit models, item threshold parameters of this type correspond directly to the estimated absolute item threshold parameters of these models. For \code{type = "median"}, the returned item threshold parameters correspond to the location on the theta axis where the probability of choosing category \eqn{k} or higher, i.e., \eqn{P(X_{ij} >= k)}, equals 0.5. For \code{type = "mean"}, the returned absolute item threshold parameters correspond to the location on the theta axis where the expected category response is in the middle between two categories, i.e. 0.5, 1.5, \dots{}. An illustration of these threshold parameters can be found on page 104 in Masters & Wright (1995). } \value{ A named list with item threshold parameters of class \code{threshpar} and additional attributes \code{model} (the model name), \code{type} (the type of item threshold parameters returned, see details above), \code{ref} (the items or parameters used as restriction/for normalization), \code{relative} (whether relative or absolute item threshold parameters are returned), \code{cumulative} (whether the cumulative item threshold parameters are returned), \code{alias} (either \code{FALSE} or a named character vector or list with the removed aliased parameters), and \code{vcov} (the estimated and adjusted variance-covariance matrix). } \references{ Masters GN, Wright BD (1997). The Partial Credit Model. In Van der Linden WJ, Hambleton RK (eds.). \emph{Handbook of Modern Item Response Theory}. Springer, New York. } \seealso{\code{\link{personpar}}, \code{\link{itempar}}, \code{\link{discrpar}}, \code{\link{guesspar}}, \code{\link{upperpar}}} \examples{ o <- options(digits = 4) ## load verbal aggression data data("VerbalAggression", package = "psychotools") ## fit a rasch model to dichotomized verbal aggression data raschmod <- raschmodel(VerbalAggression$resp2) ## extract threshold parameters with sum zero restriction tr <- threshpar(raschmod) tr ## compare to item parameters (again with sum zero restriction) ip <- itempar(raschmod) ip all.equal(coef(tr), coef(ip)) ## rating scale model example rsmod <- rsmodel(VerbalAggression$resp) trmod <- threshpar(rsmod, type = "mode") trmed <- threshpar(rsmod, type = "median") trmn <- threshpar(rsmod, type = "mean") ## compare different types of threshold parameters cbind("Mode" = coef(trmod, type = "vector"), "Median" = coef(trmod, type = "vector"), "Mean" = coef(trmn, type = "vector")) if(requireNamespace("mirt")) { ## fit a partial credit model and a generalized partial credit model pcmod <- pcmodel(VerbalAggression$resp) gpcmod <- gpcmodel(VerbalAggression$resp) ## extract the threshold parameters with different default restrictions and ## therefore incompareable scales tp <- threshpar(pcmod) tg <- threshpar(gpcmod) plot(unlist(tp), unlist(tg), xlab = "PCM", ylab = "GPCM") abline(a = 0, b = 1) ## extract the threshold parameters with the first as the reference leading ## to a compareable scale visualizing the differences due to different ## discrimination parameters tp <- threshpar(pcmod, ref = 1) tg <- threshpar(gpcmod, ref = 1) plot(unlist(tp), unlist(tg), xlab = "PCM", ylab = "GPCM") abline(a = 0, b = 1) options(digits = o$digits) } } \keyword{classes} psychotools/man/plot.paircomp.Rd0000644000176200001440000000404113754575634016513 0ustar liggesusers\name{plot.paircomp} \alias{plot.paircomp} \title{Plotting Paired Comparison Data} \description{ Plotting the frequency table from \code{"paircomp"} data. } \usage{ \method{plot}{paircomp}(x, off = 0.05, xlab = "Proportion of comparisons", ylab = "", tol.xlab = 0.05, abbreviate = TRUE, hue = NULL, chroma = 40, luminance = 80, xlim = c(0, 1), ylim = NULL, xaxs = "i", yaxs = "i", \dots) } \arguments{ \item{x}{an object of class \code{"paircomp"}.} \item{off}{numeric. Offset between segments on the y-axis.} \item{xlab, ylab}{character. Axis labels.} \item{tol.xlab}{numeric. convenience tolerance parameter for x-axis annotation. If the distance between two labels drops under this threshold, they are plotted equidistantly.} \item{abbreviate}{logical or integer. Should object labels be abbreviated? Alternative an integer with the desired abbreviation length. The default is some heuristic based on the length of the labels.} \item{hue}{numeric. A vector of hues in [0, 360], recycled to the number of objects compared in \code{x}. A sequential palette is computed for each hue, see below.} \item{chroma}{numeric. Maximum chroma in the palette.} \item{luminance}{numeric. Minimum (and maximum) luminance in the palette. If omitted, the maximum is set to 95.} \item{xlim, ylim, xaxs, yaxs, \dots}{graphical arguments passed to \code{\link{plot}}.} } \details{ The \code{plot} method creates a frequency table (using \code{summary}) and visualizes this using a sort of spine plot with HCL-based diverging palettes. See Zeileis, Hornik, Murrell (2009) for the underlying ideas. } \references{ Zeileis A, Hornik K, Murrell P (2009), Escaping RGBland: Selecting Colors for Statistical Graphics. \emph{Computational Statistics & Data Analysis}, \bold{53}, 3259-3270. \doi{10.1016/j.csda.2008.11.033} } \seealso{\code{\link{paircomp}}} \examples{ data("GermanParties2009", package = "psychotools") par(mar = c(5, 6, 3, 6)) plot(GermanParties2009$preference, abbreviate = FALSE) } \keyword{classes} psychotools/DESCRIPTION0000644000176200001440000000425514124606442014357 0ustar liggesusersPackage: psychotools Title: Psychometric Modeling Infrastructure Version: 0.7-0 Date: 2021-09-28 Authors@R: c(person(given = "Achim", family = "Zeileis", role = c("aut", "cre"), email = "Achim.Zeileis@R-project.org", comment = c(ORCID = "0000-0003-0918-3766")), person(given = "Carolin", family = "Strobl", role = "aut", email = "Carolin.Strobl@psychologie.uzh.ch"), person(given = "Florian", family = "Wickelmaier", role = "aut"), person(given = "Basil", family = "Komboz", role = "aut"), person(given = "Julia", family = "Kopf", role = "aut"), person(given = "Lennart", family = "Schneider", role = "aut", comment = c(ORCID = "0000-0003-4152-5308")), person(given = "Rudolf", family = "Debelak", role = "aut", comment = c(ORCID = "0000-0001-8900-2106"))) Depends: R (>= 3.0.0) Imports: graphics, grDevices, stats, utils Suggests: Formula, likert, mirt, multcomp, sandwich Description: Infrastructure for psychometric modeling such as data classes (for item response data and paired comparisons), basic model fitting functions (for Bradley-Terry, Rasch, parametric logistic IRT, generalized partial credit, rating scale, multinomial processing tree models), extractor functions for different types of parameters (item, person, threshold, discrimination, guessing, upper asymptotes), unified inference and visualizations, and various datasets for illustration. Intended as a common lightweight and efficient toolbox for psychometric modeling and a common building block for fitting psychometric mixture models in package "psychomix" and trees based on psychometric models in package "psychotree". License: GPL-2 | GPL-3 NeedsCompilation: yes Packaged: 2021-09-28 11:49:29 UTC; zeileis Author: Achim Zeileis [aut, cre] (), Carolin Strobl [aut], Florian Wickelmaier [aut], Basil Komboz [aut], Julia Kopf [aut], Lennart Schneider [aut] (), Rudolf Debelak [aut] () Maintainer: Achim Zeileis Repository: CRAN Date/Publication: 2021-09-28 12:40:02 UTC psychotools/build/0000755000176200001440000000000014124600510013730 5ustar liggesuserspsychotools/build/vignette.rds0000644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67}\fZj|px.C^V.k j!:] Փl:ߌƷxe[wʖIhjZAJf{O+zT~\sC<^=zb>ol\m/RB>rfTN_\6{'χnuj7oY z(X(Z'`y{*yxA2]-~Gw}>vMsšV7c%$d*rd&)Itz۳UOB'Nh;,<>rr )S>~:x}B+[9-EJ{#lhU6Uj>Fe7ӵEK^|Ez X9kM:*z)wXjflx Ob!&DGA~N #sho{7Q["R瀳gexԣμTm-]Q~ VD,J̻SE Gͻ\"$Cz)] ni|3g~V`{0fMd' K؊uLpT_IͬITݬ{aʽ-5tcq40ҖD+iF[vW|3-M]Q9Bv&t*E0xt% χK1Ѫ`Ð[_5{QIWMR?B,;, Ȕ,*) O/ޮP_2KAn;4o6s,/ujF՟~緮- !T6.Aˌ;N1tr즮 S715ˮlnۺip>?5Pp3mGgg%]sT H{WJfTh{.RC1اJu!&(`l6b훕l LA`*!IwZj˦=/aeGsiw 7i9̀{Z*@"MyRIDgDpBe#vUf7Ñ`N5n zVQ ܒuGI0p\1:F$L#nV.UˌJF!V۟e#cS#yjMTf!_߁j˕Z>vj~fK gRqu}}~Jruzed }o̭iVvݚ3=4佝_mW{Lox+S.Y wS H~pjںvV{8r1J%F.ZUw[%1WʵH#Ϸ]qL)X#o8.Tb{hӼYQk}]@3oE\1tӉ>ڊgwhUb ?V=zNDPux6m- $fҡ3z4^|!J!ģ؞FT .>ߒ=Dǁ J,={T3QD꺀{Sut]3+Fc@(Ii7Q@juyyxt@cw(f՘黪D6vxc7MUIг,ϲ^CgE])o_@ƞ5ڬ^])qwah1`j"{J(TRjL7:1JA1<4) wA>`kEZ/*¥Bꏄ\Dw;dd,!I=2@$y!Aeݦ 7z2-Kq7iUO~Ww]t6?^wUun?9`BRqיּpsychotools/tests/0000755000176200001440000000000013277172617014017 5ustar liggesuserspsychotools/tests/Examples/0000755000176200001440000000000013537561627015577 5ustar liggesuserspsychotools/tests/Examples/psychotools-Ex.Rout.save0000644000176200001440000031077714122307111022337 0ustar liggesusers R version 4.1.1 (2021-08-10) -- "Kick Things" Copyright (C) 2021 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > pkgname <- "psychotools" > source(file.path(R.home("share"), "R", "examples-header.R")) > options(warn = 1) > library('psychotools') > > base::assign(".oldSearch", base::search(), pos = 'CheckExEnv') > base::assign(".old_wd", base::getwd(), pos = 'CheckExEnv') > cleanEx() > nameEx("ConspiracistBeliefs2016") > ### * ConspiracistBeliefs2016 > > flush(stderr()); flush(stdout()) > > ### Name: ConspiracistBeliefs2016 > ### Title: Generic Conspiracist Beliefs Scale (2016 Data) > ### Aliases: ConspiracistBeliefs2016 > ### Keywords: datasets > > ### ** Examples > > ## overview > data("ConspiracistBeliefs2016", package = "psychotools") > str(ConspiracistBeliefs2016) 'data.frame': 2449 obs. of 3 variables: $ resp : num [1:2449, 1:15] 4 1 4 4 0 3 4 0 0 3 ... ..- attr(*, "dimnames")=List of 2 .. ..$ : NULL .. ..$ : chr [1:15] "q1" "q2" "q3" "q4" ... $ area : Factor w/ 3 levels "rural","suburban",..: 2 2 1 2 1 2 1 3 3 2 ... $ gender: Factor w/ 3 levels "male","female",..: 2 2 1 1 1 1 1 1 1 3 ... > > ## response > plot(itemresp(ConspiracistBeliefs2016$resp)) > ## covariates > summary(ConspiracistBeliefs2016[, -1]) area gender rural : 475 male :1204 suburban:1124 female:1117 urban : 850 other : 128 > > > > cleanEx() > nameEx("FirstNames") > ### * FirstNames > > flush(stderr()); flush(stdout()) > > ### Name: FirstNames > ### Title: Popularity of First Names > ### Aliases: FirstNames > ### Keywords: datasets > > ### ** Examples > > data("FirstNames", package = "psychotools") > summary(FirstNames$preference) > < Tim : Lucas 87 105 Tim : Michael 103 89 Lucas : Michael 112 80 Tim : Robin 125 67 Lucas : Robin 129 63 Michael : Robin 106 86 Tim : Benedikt 140 52 Lucas : Benedikt 146 46 Michael : Benedikt 129 63 Robin : Benedikt 127 65 Tim : Julius 109 83 Lucas : Julius 120 72 Michael : Julius 103 89 Robin : Julius 95 97 Benedikt : Julius 73 119 > covariates(FirstNames$preference) vowel Tim front Lucas back Michael front Robin back Benedikt front Julius back > > > > cleanEx() > nameEx("GermanParties2009") > ### * GermanParties2009 > > flush(stderr()); flush(stdout()) > > ### Name: GermanParties2009 > ### Title: Choice among German Political Parties > ### Aliases: GermanParties2009 > ### Keywords: datasets > > ### ** Examples > > data("GermanParties2009", package = "psychotools") > summary(GermanParties2009$preference) > < none : Linke 119 73 none : Gruene 25 167 Linke : Gruene 23 169 none : SPD 38 154 Linke : SPD 34 158 Gruene : SPD 124 68 none : CDU/CSU 69 123 Linke : CDU/CSU 76 116 Gruene : CDU/CSU 128 64 SPD : CDU/CSU 125 67 none : FDP 83 109 Linke : FDP 70 122 Gruene : FDP 137 55 SPD : FDP 134 58 CDU/CSU : FDP 106 86 > > > > cleanEx() > nameEx("MathExam14W") > ### * MathExam14W > > flush(stderr()); flush(stdout()) > > ### Name: MathExam14W > ### Title: Mathematics 101 Exam Results > ### Aliases: MathExam14W > ### Keywords: datasets > > ### ** Examples > > ## load data and exclude extreme scorers > data("MathExam14W", package = "psychotools") > MathExam14W <- transform(MathExam14W, + points = 2 * nsolved - 0.5 * rowSums(credits == 1) + ) > me <- subset(MathExam14W, nsolved > 0 & nsolved < 13) > > > ## item response data: > ## solved (correct/other) or credits (correct/incorrect/not attempted) > par(mfrow = c(1, 2)) > plot(me$solved) > plot(me$credits) > > ## PCA > pr <- prcomp(me$solved, scale = TRUE) > names(pr$sdev) <- 1:10 > plot(pr, main = "", xlab = "Number of components") > biplot(pr, col = c("transparent", "black"), main = "", + xlim = c(-0.065, 0.005), ylim = c(-0.04, 0.065)) > > > ## points achieved (and 50% threshold) > par(mfrow = c(1, 1)) > hist(MathExam14W$points, breaks = -4:13 * 2 + 0.5, + col = "lightgray", main = "", xlab = "Points") > abline(v = 12.5, lwd = 2, col = 2) > > > ## Rasch and partial credit model > ram <- raschmodel(me$solved) > pcm <- pcmodel(me$credits) > > ## various types of graphics displays > plot(ram, type = "profile") > plot(pcm, type = "profile", add = TRUE, col = "blue") > plot(ram, type = "piplot") > plot(pcm, type = "piplot") > plot(ram, type = "region") > plot(pcm, type = "region") > plot(ram, type = "curves") > plot(pcm, type = "curves") > > > > > > graphics::par(get("par.postscript", pos = 'CheckExEnv')) > cleanEx() > nameEx("MemoryDeficits") > ### * MemoryDeficits > > flush(stderr()); flush(stdout()) > > ### Name: MemoryDeficits > ### Title: Memory Deficits in Psychiatric Patients > ### Aliases: MemoryDeficits > ### Keywords: datasets > > ### ** Examples > > data("MemoryDeficits", package = "psychotools") > aggregate(cbind(E1, E2, E3, E4) ~ trial + group, MemoryDeficits, sum) trial group E1 E2 E3 E4 1 1 Schizo 31 15 154 380 2 2 Schizo 79 45 163 293 3 3 Schizo 127 63 160 230 4 4 Schizo 148 74 149 209 5 5 Schizo 176 73 152 179 6 6 Schizo 198 67 138 177 7 1 SchizoCtl 49 31 149 271 8 2 SchizoCtl 116 66 151 167 9 3 SchizoCtl 190 66 136 108 10 4 SchizoCtl 243 68 108 81 11 5 SchizoCtl 269 77 81 73 12 6 SchizoCtl 301 76 71 52 13 1 OrganicAlc 20 9 91 300 14 2 OrganicAlc 34 18 102 266 15 3 OrganicAlc 43 30 102 245 16 4 OrganicAlc 57 25 114 224 17 5 OrganicAlc 58 35 98 229 18 6 OrganicAlc 65 29 100 226 19 1 AlcCtl 45 24 97 254 20 2 AlcCtl 106 41 107 166 21 3 AlcCtl 171 40 110 99 22 4 AlcCtl 202 50 79 89 23 5 AlcCtl 217 64 69 70 24 6 AlcCtl 243 64 65 48 > > > > cleanEx() > nameEx("PairClustering") > ### * PairClustering > > flush(stderr()); flush(stdout()) > > ### Name: PairClustering > ### Title: Pair Clustering Data in Klauer (2006) > ### Aliases: PairClustering > ### Keywords: datasets > > ### ** Examples > > data("PairClustering", package = "psychotools") > aggregate(cbind(E1, E2, E3, E4, F1, F2) ~ trial, PairClustering, sum) trial E1 E2 E3 E4 F1 F2 1 1 80 10 122 418 65 250 2 2 171 32 122 305 111 204 > > > > cleanEx() > nameEx("Sim3PL") > ### * Sim3PL > > flush(stderr()); flush(stdout()) > > ### Name: Sim3PL > ### Title: Simulated Data for fitting a 3PL and 3PLu > ### Aliases: Sim3PL > ### Keywords: datasets > > ### ** Examples > > ## overview > data("Sim3PL", package = "psychotools") > str(Sim3PL) 'data.frame': 10000 obs. of 2 variables: $ resp : num [1:10000, 1:10] 1 1 1 1 0 1 0 1 0 0 ... ..- attr(*, "dimnames")=List of 2 .. ..$ : NULL .. ..$ : chr [1:10] "I01" "I02" "I03" "I04" ... $ resp2: num [1:10000, 1:10] 1 0 0 0 0 0 1 0 0 1 ... ..- attr(*, "dimnames")=List of 2 .. ..$ : NULL .. ..$ : chr [1:10] "I01" "I02" "I03" "I04" ... > > ## data generation > M <- 10000 > N <- 10 > > ## 3PL scenario > set.seed(277) > theta <- rnorm(M, 0, 1) > a <- rlnorm(N, 0, 0.25) > b <- rnorm(N, 0, 1) > g <- runif(N, 0.1, 0.2) > u <- rep(1, N) > probs <- matrix(g, M, N, byrow = TRUE) + matrix(u - g, M, N, byrow = TRUE) * + plogis(matrix(a, M, N, byrow = TRUE) * outer(theta, b, "-")) > resp <- (probs > matrix(runif(M * N, 0, 1), M, N)) + 0 > all.equal(resp, Sim3PL$resp, check.attributes = FALSE) [1] TRUE > > ## 3PLu scenario > set.seed(167) > theta <- rnorm(M, 0, 1) > a <- rlnorm(N, 0, 0.25) > b <- rnorm(N, 0, 1) > g <- rep(0, N) > u <- runif(N, 0.8, 0.9) > probs <- matrix(g, M, N, byrow = TRUE) + matrix(u - g, M, N, byrow = TRUE) * + plogis(matrix(a, M, N, byrow = TRUE) * outer(theta, b, "-")) > resp2 <- (probs > matrix(runif(M * N, 0, 1), M, N)) + 0 > all.equal(resp2, Sim3PL$resp2, check.attributes = FALSE) [1] TRUE > > > > cleanEx() > nameEx("SoundQuality") > ### * SoundQuality > > flush(stderr()); flush(stdout()) > > ### Name: SoundQuality > ### Title: Quality of Multichannel Reproduced Sound > ### Aliases: SoundQuality > ### Keywords: datasets > > ### ** Examples > > data("SoundQuality", package = "psychotools") > summary(SoundQuality$preference) > < Mono : PhantomMono 268 515 Mono : Stereo 46 737 PhantomMono : Stereo 85 698 Mono : WideStereo 94 689 PhantomMono : WideStereo 126 657 Stereo : WideStereo 468 315 Mono : Matrix 65 718 PhantomMono : Matrix 99 684 Stereo : Matrix 391 392 WideStereo : Matrix 358 425 Mono : Upmix1 65 718 PhantomMono : Upmix1 104 679 Stereo : Upmix1 443 340 WideStereo : Upmix1 394 389 Matrix : Upmix1 411 372 Mono : Upmix2 81 702 PhantomMono : Upmix2 142 641 Stereo : Upmix2 504 279 WideStereo : Upmix2 436 347 Matrix : Upmix2 458 325 Upmix1 : Upmix2 432 351 Mono : Original 61 722 PhantomMono : Original 101 682 Stereo : Original 399 384 WideStereo : Original 369 414 Matrix : Original 381 402 Upmix1 : Original 373 410 Upmix2 : Original 333 450 > ftable(xtabs(~ time + repet + progmat, data = SoundQuality)) progmat Beethoven Rachmaninov SteelyDan Sting time repet before 1 39 39 40 39 2 39 39 40 39 3 39 39 40 39 after 1 39 39 39 39 2 39 39 39 39 3 0 0 0 0 > > > > cleanEx() > nameEx("SourceMonitoring") > ### * SourceMonitoring > > flush(stderr()); flush(stdout()) > > ### Name: SourceMonitoring > ### Title: Performance in a Source-Monitoring Experiment > ### Aliases: SourceMonitoring > ### Keywords: datasets > > ### ** Examples > > data("SourceMonitoring", package = "psychotools") > xtabs(~ gender + I(age >= 30) + sources, SourceMonitoring) , , sources = think-say I(age >= 30) gender FALSE TRUE female 16 16 male 16 16 , , sources = write-say I(age >= 30) gender FALSE TRUE female 16 16 male 16 16 > > > > cleanEx() > nameEx("StereotypeThreat") > ### * StereotypeThreat > > flush(stderr()); flush(stdout()) > > ### Name: StereotypeThreat > ### Title: Stereotype Threat in Dutch Differential Aptitude Test > ### Aliases: StereotypeThreat > ### Keywords: datasets > > ### ** Examples > > ## Data: Load and include/order wrt group variable > data("StereotypeThreat", package = "psychotools") > StereotypeThreat <- transform(StereotypeThreat, group = interaction(ethnicity, condition)) > StereotypeThreat <- StereotypeThreat[order(StereotypeThreat$group),] > > ## Exploratory analysis (Table 2, p. 703) > tab2 <- with(StereotypeThreat, rbind( + "#" = tapply(numerical, group, length), + "Numerical" = tapply(numerical, group, mean), + " " = tapply(numerical, group, sd), + "Abstract " = tapply(abstract, group, mean), + " " = tapply(abstract, group, sd), + "Verbal " = tapply(verbal, group, mean), + " " = tapply(verbal, group, sd))) > round(tab2, digits = 2) majority.control minority.control majority.threat minority.threat # 79.00 65.00 78.00 73.00 Numerical 5.35 4.88 5.49 4.67 2.54 2.47 2.31 2.52 Abstract 10.42 6.80 9.24 7.34 2.96 3.33 3.34 2.83 Verbal 7.27 5.37 6.65 5.56 3.01 2.82 3.47 2.70 > > ## Corresponding boxplots > plot(numerical ~ group, data = StereotypeThreat) > plot(abstract ~ group, data = StereotypeThreat) > plot(verbal ~ group, data = StereotypeThreat) > > ## MANOVA (p. 703) > m <- lm(cbind(numerical, abstract, verbal) ~ ethnicity * condition, data = StereotypeThreat) > anova(m, update(m, . ~ . - ethnicity:condition)) Analysis of Variance Table Model 1: cbind(numerical, abstract, verbal) ~ ethnicity * condition Model 2: cbind(numerical, abstract, verbal) ~ ethnicity + condition Res.Df Df Gen.var. Pillai approx F num Df den Df Pr(>F) 1 291 7.5292 2 292 1 7.5714 0.026692 2.6419 3 289 0.04961 * --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > ## corresponding univariate results > printCoefmat(t(sapply(summary(m), + function(x) x$coefficients["ethnicityminority:conditionthreat", ]))) Estimate Std. Error t value Pr(>|t|) Response numerical -0.33844 0.57424 -0.5894 0.55607 Response abstract 1.71660 0.72798 2.3580 0.01903 * Response verbal 0.80439 0.70783 1.1364 0.25672 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > > ## MGCFA (Table 3, p. 704) > ## can be replicated using package lavaan > ## Not run: > ##D ## convenience function for multi-group CFA on this data > ##D mgcfa <- function(model, ...) cfa(model, data = StereotypeThreat, > ##D group = "group", likelihood = "wishart", start = "simple", ...) > ##D > ##D ## list of all 9 models > ##D m <- vector("list", length = 9) > ##D names(m) <- c("m2", "m2a", "m3", "m3a", "m4", "m5", "m5a", "m5b", "m6") > ##D > ##D ## Step 2: Fix loadings across groups > ##D f <- 'ability =~ abstract + verbal + numerical' > ##D m$m2 <- mgcfa(f, group.equal = "loadings") > ##D > ##D ## Step 2a: Free numerical loading in group 4 (minority.threat) > ##D f <- 'ability =~ abstract + verbal + c(l1, l1, l1, l4) * numerical' > ##D m$m2a <- mgcfa(f, group.equal = "loadings") > ##D > ##D ## Step 3: Fix variances across groups > ##D m$m3 <- mgcfa(f, group.equal = c("loadings", "residuals")) > ##D > ##D ## Step 3a: Free numerical variance in group 4 > ##D f <- c(f, 'numerical ~~ c(e1, e1, e1, e4) * numerical') > ##D m$m3a <- mgcfa(f, group.equal = c("loadings", "residuals")) > ##D > ##D ## Step 4: Fix latent variances within conditions > ##D f <- c(f, 'ability ~~ c(vmaj, vmin, vmaj, vmin) * ability') > ##D m$m4 <- mgcfa(f, group.equal = c("loadings", "residuals")) > ##D > ##D ## Step 5: Fix certain means, free others > ##D f <- c(f, 'numerical ~ c(na1, na1, na1, na4) * 1') > ##D m$m5 <- mgcfa(f, group.equal = c("loadings", "residuals", "intercepts")) > ##D > ##D ## Step 5a: Free ability mean in group majority.control > ##D f <- c(f, 'abstract ~ c(ar1, ar2, ar2, ar2) * 1') > ##D m$m5a <- mgcfa(f, group.equal = c("loadings", "residuals", "intercepts")) > ##D > ##D ## Step 5b: Free also ability mean in group minority.control > ##D f <- c(f[1:4], 'abstract ~ c(ar1, ar2, ar3, ar3) * 1') > ##D m$m5b <- mgcfa(f, group.equal = c("loadings", "residuals", "intercepts")) > ##D > ##D ## Step 6: Different latent mean structure > ##D f <- c(f, 'ability ~ c(maj, min, maj, min) * 1 + c(0, NA, 0, NA) * 1') > ##D m$m6 <- mgcfa(f, group.equal = c("loadings", "residuals", "intercepts")) > ##D > ##D ## Extract measures of fit > ##D tab <- t(sapply(m, fitMeasures, c("chisq", "df", "pvalue", "rmsea", "cfi"))) > ##D tab <- rbind("1" = c(0, 0, 1, 0, 1), tab) > ##D tab <- cbind(tab, > ##D delta_chisq = c(NA, abs(diff(tab[, "chisq"]))), > ##D delta_df = c(NA, diff(tab[, "df"]))) > ##D tab <- cbind(tab, "pvalue2" = pchisq(tab[, "delta_chisq"], > ##D abs(tab[, "delta_df"]), lower.tail = FALSE)) > ##D tab <- tab[, c(2, 1, 3, 7, 6, 8, 4, 5)] > ##D round(tab, digits = 3) > ## End(Not run) > > > > cleanEx() > nameEx("VerbalAggression") > ### * VerbalAggression > > flush(stderr()); flush(stdout()) > > ### Name: VerbalAggression > ### Title: Situation-Response Questionnaire on Verbal Aggression > ### Aliases: VerbalAggression > ### Keywords: datasets > > ### ** Examples > > data("VerbalAggression", package = "psychotools") > > ## Rasch model for the self-to-blame situations > m <- raschmodel(VerbalAggression$resp2[, 1:12]) > plot(m) > > ## IGNORE_RDIFF_BEGIN > summary(m) Rasch model Difficulty parameters: Estimate Std. Error z value Pr(>|z|) S1DoCurse -1.556e-08 2.042e-01 0.000 1.00000 S1WantScold 6.857e-01 1.995e-01 3.436 0.00059 *** S1DoScold 8.727e-01 1.994e-01 4.376 1.21e-05 *** S1WantShout 1.208e+00 2.003e-01 6.032 1.62e-09 *** S1DoShout 2.294e+00 2.131e-01 10.766 < 2e-16 *** S2WantCurse -5.393e-01 2.135e-01 -2.527 0.01152 * S2DoCurse 3.614e-01 2.009e-01 1.799 0.07200 . S2WantScold 5.345e-01 2.000e-01 2.673 0.00753 ** S2DoScold 1.359e+00 2.012e-01 6.755 1.42e-11 *** S2WantShout 1.283e+00 2.007e-01 6.395 1.61e-10 *** S2DoShout 3.067e+00 2.343e-01 13.088 < 2e-16 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Log-likelihood: -1255 (df = 11) Number of iterations in BFGS optimization: 19 > ## IGNORE_RDIFF_END > > > > cleanEx() > nameEx("YouthGratitude") > ### * YouthGratitude > > flush(stderr()); flush(stdout()) > > ### Name: YouthGratitude > ### Title: Measuring Gratitude in Youth > ### Aliases: YouthGratitude > ### Keywords: datasets > > ### ** Examples > > data("YouthGratitude", package = "psychotools") > summary(YouthGratitude) id age agegroup gq6_1 gq6_2 Min. : 1.0 Min. :10.00 10-11:217 Min. :1.000 Min. :1.000 1st Qu.: 244.8 1st Qu.:13.00 12-13:194 1st Qu.:6.000 1st Qu.:5.000 Median : 498.5 Median :15.00 14 :211 Median :6.000 Median :6.000 Mean : 511.5 Mean :14.47 15 :249 Mean :6.111 Mean :5.856 3rd Qu.: 778.2 3rd Qu.:16.00 16 :260 3rd Qu.:7.000 3rd Qu.:7.000 Max. :1098.0 Max. :19.00 17-19:274 Max. :7.000 Max. :7.000 NA's :1 gq6_3 gq6_4 gq6_5 gq6_6 gac_1 Min. :1.00 Min. :1.000 Min. :1.000 Min. :1.000 Min. :1.000 1st Qu.:5.00 1st Qu.:5.000 1st Qu.:5.000 1st Qu.:3.000 1st Qu.:3.000 Median :6.00 Median :6.000 Median :6.000 Median :4.000 Median :4.000 Mean :5.72 Mean :5.551 Mean :5.918 Mean :4.453 Mean :3.817 3rd Qu.:7.00 3rd Qu.:6.000 3rd Qu.:7.000 3rd Qu.:6.000 3rd Qu.:5.000 Max. :7.00 Max. :7.000 Max. :7.000 Max. :7.000 Max. :5.000 gac_2 gac_3 losd_1 losd_2 Min. :1.000 Min. :1.000 Min. :1.000 Min. :1.000 1st Qu.:3.000 1st Qu.:3.000 1st Qu.:6.000 1st Qu.:4.000 Median :4.000 Median :4.000 Median :7.000 Median :6.000 Mean :3.886 Mean :3.966 Mean :7.133 Mean :5.734 3rd Qu.:5.000 3rd Qu.:5.000 3rd Qu.:9.000 3rd Qu.:8.000 Max. :5.000 Max. :5.000 Max. :9.000 Max. :9.000 losd_3 losd_4 losd_5 losd_6 Min. :1.000 Min. :1.000 Min. :1.000 Min. :1.000 1st Qu.:3.000 1st Qu.:3.000 1st Qu.:4.000 1st Qu.:4.000 Median :5.000 Median :5.000 Median :6.000 Median :5.000 Mean :5.289 Mean :5.345 Mean :5.846 Mean :5.389 3rd Qu.:8.000 3rd Qu.:8.000 3rd Qu.:9.000 3rd Qu.:7.000 Max. :9.000 Max. :9.000 Max. :9.000 Max. :9.000 sa_1 sa_2 sa_3 sa_4 Min. :1.000 Min. :1.000 Min. :1.000 Min. :1.000 1st Qu.:3.000 1st Qu.:2.000 1st Qu.:4.000 1st Qu.:5.000 Median :5.000 Median :5.000 Median :5.000 Median :6.000 Mean :5.035 Mean :4.696 Mean :5.444 Mean :5.723 3rd Qu.:7.000 3rd Qu.:6.000 3rd Qu.:7.000 3rd Qu.:7.607 Max. :9.000 Max. :9.000 Max. :9.000 Max. :9.000 sa_5 sa_6 ao_1 ao_2 Min. :1.000 Min. :1.000 Min. :1.000 Min. :1.000 1st Qu.:6.000 1st Qu.:7.000 1st Qu.:6.000 1st Qu.:6.000 Median :7.000 Median :9.000 Median :7.000 Median :7.000 Mean :7.052 Mean :7.669 Mean :6.772 Mean :6.739 3rd Qu.:9.000 3rd Qu.:9.000 3rd Qu.:9.000 3rd Qu.:8.000 Max. :9.000 Max. :9.000 Max. :9.000 Max. :9.000 ao_3 ao_4 Min. :1.000 Min. : 1.000 1st Qu.:5.000 1st Qu.: 6.000 Median :7.000 Median : 7.000 Mean :6.404 Mean : 7.278 3rd Qu.:8.000 3rd Qu.: 9.000 Max. :9.000 Max. :34.203 > > ## modeling can be carried out using package lavaan > ## Not run: > ##D ## remove cases with 'imputed' values (not in 1, ..., 9) > ##D yg <- YouthGratitude[apply(YouthGratitude[, 4:28], 1, function(x) all(x ##D > ##D > ##D ## GQ-6 > ##D gq6_congeneric <- cfa( > ##D 'f1 =~ gq6_1 + gq6_2 + gq6_3 + gq6_4 + gq6_5', > ##D data = yg, group = "agegroup", meanstructure = TRUE) > ##D gq6_tauequivalent <- cfa( > ##D 'f1 =~ gq6_1 + gq6_2 + gq6_3 + gq6_4 + gq6_5', > ##D data = yg, group = "agegroup", meanstructure = TRUE, > ##D group.equal = "loadings") > ##D gq6_parallel <- cfa( > ##D 'f1 =~ gq6_1 + gq6_2 + gq6_3 + gq6_4 + gq6_5', > ##D data = yg, group = "agegroup", meanstructure = TRUE, > ##D group.equal = c("loadings", "residuals", "lv.variances")) > ##D anova(gq6_congeneric, gq6_tauequivalent, gq6_parallel) > ##D t(sapply( > ##D list(gq6_congeneric, gq6_tauequivalent, gq6_parallel), > ##D function(m) fitMeasures(m)[c("chisq", "df", "cfi", "srmr")] > ##D )) > ##D > ##D ## GAC > ##D gac_congeneric <- cfa( > ##D 'f1 =~ gac_1 + gac_2 + gac_3', > ##D data = yg, group = "agegroup", meanstructure = TRUE) > ##D gac_tauequivalent <- cfa( > ##D 'f1 =~ gac_1 + gac_2 + gac_3', > ##D data = yg, group = "agegroup", meanstructure = TRUE, > ##D group.equal = "loadings") > ##D gac_parallel <- cfa( > ##D 'f1 =~ gac_1 + gac_2 + gac_3', > ##D data = yg, group = "agegroup", meanstructure = TRUE, > ##D group.equal = c("loadings", "residuals", "lv.variances")) > ##D anova(gac_congeneric, gac_tauequivalent, gac_parallel) > ##D t(sapply( > ##D list(gac_congeneric, gac_tauequivalent, gac_parallel), > ##D function(m) fitMeasures(m)[c("chisq", "df", "cfi", "srmr")] > ##D )) > ##D > ##D ## GRAT > ##D grat_congeneric <- cfa( > ##D 'f1 =~ losd_2 + losd_3 + losd_4 + losd_5 + losd_6 > ##D f2 =~ sa_1 + sa_2 + sa_3 + sa_4 + sa_5 + sa_6 > ##D f3 =~ ao_1 + ao_2 + ao_3 + ao_4', > ##D data = yg, group = "agegroup", meanstructure = TRUE) > ##D grat_tauequivalent <- cfa( > ##D 'f1 =~ losd_2 + losd_3 + losd_4 + losd_5 + losd_6 > ##D f2 =~ sa_1 + sa_2 + sa_3 + sa_4 + sa_5 + sa_6 > ##D f3 =~ ao_1 + ao_2 + ao_3 + ao_4', > ##D data = yg, group = "agegroup", meanstructure = TRUE, > ##D group.equal = "loadings") > ##D grat_parallel <- cfa( > ##D 'f1 =~ losd_2 + losd_3 + losd_4 + losd_5 + losd_6 > ##D f2 =~ sa_1 + sa_2 + sa_3 + sa_4 + sa_5 + sa_6 > ##D f3 =~ ao_1 + ao_2 + ao_3 + ao_4', > ##D data = yg, group = "agegroup", meanstructure = TRUE, > ##D group.equal = c("loadings", "residuals", "lv.variances")) > ##D anova(grat_congeneric, grat_tauequivalent, grat_parallel) > ##D t(sapply( > ##D list(grat_congeneric, grat_tauequivalent, grat_parallel), > ##D function(m) fitMeasures(m)[c("chisq", "df", "cfi", "srmr")] > ##D )) > ## End(Not run) > > > > cleanEx() > nameEx("anchor") > ### * anchor > > flush(stderr()); flush(stdout()) > > ### Name: anchor > ### Title: Anchor Methods for the Detection of Uniform DIF the Rasch Model > ### Aliases: anchor anchor.default anchor.formula print.anchor > ### print.summary.anchor summary.anchor > ### Keywords: regression > > ### ** Examples > > ## Verbal aggression data > data("VerbalAggression", package = "psychotools") > > ## Gini anchor (Strobl et al. 2021) for gender DIF in the self-to-blame situations > anchor(resp2[, 1:12] ~ gender , data = VerbalAggression) Anchor selection with Gini criterion and constant length 1 Anchor item: `resp2[, 1:12]`S1WantCurse > > ## alternatively: based on fitted raschmodel objects > raschmodels <- with(VerbalAggression, lapply(levels(gender), function(i) + raschmodel(resp2[gender == i, 1:12]))) > anchor(raschmodels[[1]], raschmodels[[2]]) Anchor selection with Gini criterion and constant length 1 Anchor item: S1WantCurse > > if(requireNamespace("multcomp")) { + + ## four anchor items from constant anchor class using MPT-selection (Kopf et al. 2015b) + anchor(object = raschmodels[[1]], object2 = raschmodels[[2]], + class = "constant", select = "MPT", length = 4) + + ## iterative forward anchor class using MTT-selection (Kopf et al. 2015b) + set.seed(1) + fanchor <- anchor(object = raschmodels[[1]], object2 = raschmodels[[2]], + class = "forward", select = "MTT", range = c(0.05, 1)) + fanchor + + ## the same using the formula interface + set.seed(1) + fanchor2 <- anchor(resp2[, 1:12] ~ gender , data = VerbalAggression, + class = "forward", select = "MTT", range = c(0.05, 1)) + + ## criteria really the same? + all.equal(fanchor$criteria, fanchor2$criteria, check.attributes = FALSE) + } Loading required namespace: multcomp [1] TRUE > > > > cleanEx() > nameEx("anchortest") > ### * anchortest > > flush(stderr()); flush(stdout()) > > ### Name: anchortest > ### Title: Anchor methods for the detection of uniform DIF in the Rasch > ### model > ### Aliases: anchortest anchortest.default anchortest.formula > ### print.anchortest print.summary.anchortest summary.anchortest > ### Keywords: regression > > ### ** Examples > > if(requireNamespace("multcomp")) { + + o <- options(digits = 4) + + ## Verbal aggression data + data("VerbalAggression", package = "psychotools") + + ## Rasch model for the self-to-blame situations; gender DIF test + raschmodels <- with(VerbalAggression, lapply(levels(gender), function(i) + raschmodel(resp2[gender == i, 1:12]))) + + ## single anchor from Gini selection (default) + gini1 <- anchortest(object = raschmodels[[1]], object2 = raschmodels[[2]]) + gini1 + summary(gini1) + + ## four anchor items from constant anchor class using MPT selection + const1 <- anchortest(object = raschmodels[[1]], object2 = raschmodels[[2]], + class = "constant", select = "MPT", length = 4) + const1 + summary(const1) + + ## iterative forward anchor class using MTT selection + set.seed(1) + forw1 <- anchortest(object = raschmodels[[1]], object2 = raschmodels[[2]], + class = "forward", select = "MTT", test = TRUE, + adjust = "none", range = c(0.05,1)) + forw1 + + ## DIF test with fixed given anchor (arbitrarily selected to be items 1 and 2) + anchortest(object = raschmodels[[1]], object2 = raschmodels[[2]], select = 1:2) + + options(digits = o$digits) + } > > > > cleanEx() > nameEx("as.list.itemresp") > ### * as.list.itemresp > > flush(stderr()); flush(stdout()) > > ### Name: as.list.itemresp > ### Title: Coercing Item Response Data > ### Aliases: is.itemresp as.list.itemresp as.character.itemresp > ### as.data.frame.itemresp as.double.itemresp as.integer.itemresp > ### as.matrix.itemresp > ### Keywords: classes > > ### ** Examples > > ## item responses from binary matrix > x <- cbind(c(1, 0, 1, 0), c(1, 0, 0, 0), c(0, 1, 1, 1)) > xi <- itemresp(x) > ## change mscale > mscale(xi) <- c("-", "+") > xi [1] {+,+,-} {-,-,+} {+,-,+} {-,-,+} > > ## coercion to list of factors with levels taken from mscale > as.list(xi) $item1 [1] + - + - Levels: - + $item2 [1] + - - - Levels: - + $item3 [1] - + + + Levels: - + > ## same but levels taken as integers 0, 1 > as.list(xi, mscale = FALSE) $item1 [1] 1 0 1 0 Levels: 0 1 $item2 [1] 1 0 0 0 Levels: 0 1 $item3 [1] 0 1 1 1 Levels: 0 1 > ## only for first two items > as.list(xi, items = 1:2) $item1 [1] + - + - Levels: - + $item2 [1] + - - - Levels: - + > ## result as data.frame > as.list(xi, df = TRUE) item1 item2 item3 1 + + - 2 - - + 3 + - + 4 - - + > > ## data frame with single itemresp column > as.data.frame(xi) xi 1 {+,+,-} 2 {-,-,+} 3 {+,-,+} 4 {-,-,+} > > ## integer matrix > as.matrix(xi) item1 item2 item3 [1,] 1 1 0 [2,] 0 0 1 [3,] 1 0 1 [4,] 0 0 1 > > ## character vector > as.character(xi) [1] "{+,+,-}" "{-,-,+}" "{+,-,+}" "{-,-,+}" > > ## check class of xi > is.itemresp(xi) [1] TRUE > > > > cleanEx() > nameEx("btmodel") > ### * btmodel > > flush(stderr()); flush(stdout()) > > ### Name: btmodel > ### Title: Bradley-Terry Model Fitting Function > ### Aliases: btmodel btReg.fit print.btmodel summary.btmodel > ### print.summary.btmodel coef.btmodel worth.btmodel deviance.btmodel > ### logLik.btmodel vcov.btmodel estfun.btmodel > ### Keywords: regression > > ### ** Examples > > o <- options(digits = 4) > > ## data > data("GermanParties2009", package = "psychotools") > > ## Bradley-Terry model > bt <- btmodel(GermanParties2009$preference) > summary(bt) Bradley-Terry regression model Parameters: Estimate Std. Error z value Pr(>|z|) none -0.3756 0.0890 -4.22 2.5e-05 *** Linke -0.6161 0.0910 -6.77 1.3e-11 *** Gruene 1.1858 0.0951 12.47 < 2e-16 *** SPD 0.8131 0.0907 8.97 < 2e-16 *** CDU/CSU 0.1756 0.0875 2.01 0.045 * --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Log-likelihood: -1720 (df = 5) > plot(bt) > > options(digits = o$digits) > > > > cleanEx() > nameEx("covariates") > ### * covariates > > flush(stderr()); flush(stdout()) > > ### Name: covariates > ### Title: Extract/Set Covariates > ### Aliases: covariates covariates<- > ### Keywords: classes > > ### ** Examples > > ## method for "paircomp" data > pc <- paircomp(rbind( + c(1, 1, 1), # a > b, a > c, b > c + c(1, 1, -1), # a > b, a > c, b < c + c(1, -1, -1), # a > b, a < c, b < c + c(1, 1, 1))) > covariates(pc) NULL > covariates(pc) <- data.frame(foo = factor(c(1, 2, 2), labels = c("foo", "bar"))) > covariates(pc) foo a foo b bar c bar > > > > cleanEx() > nameEx("curveplot") > ### * curveplot > > flush(stderr()); flush(stdout()) > > ### Name: curveplot > ### Title: Response Curve Plots for IRT Models > ### Aliases: curveplot > ### Keywords: aplot > > ### ** Examples > > ## load verbal aggression data > data("VerbalAggression", package = "psychotools") > > ## fit Rasch, rating scale and partial credit model to verbal aggression data > rmmod <- raschmodel(VerbalAggression$resp2) > rsmod <- rsmodel(VerbalAggression$resp) > pcmod <- pcmodel(VerbalAggression$resp) > > ## curve plots of the dichotomous RM > plot(rmmod, type = "curves") > > ## curve plots under the RSM for the first six items of the data set > plot(rsmod, type = "curves", items = 1:6) > > ## curve plots under the PCM for the first six items of the data set with > ## custom labels > plot(pcmod, type = "curves", items = 1:6, names = paste("Item", 1:6)) > > ## compare the predicted probabilities under the RSM and the PCM for a single > ## item > plot(rsmod, type = "curves", item = 1) > plot(pcmod, type = "curves", item = 1, lty = 2, add = TRUE) > legend(x = "topleft", y = 1.0, legend = c("RSM", "PCM"), lty = 1:2, bty = "n") > > > > > cleanEx() > nameEx("discrpar") > ### * discrpar > > flush(stderr()); flush(stdout()) > > ### Name: discrpar > ### Title: Extract Discrimination Parameters of Item Response Models > ### Aliases: discrpar discrpar.raschmodel discrpar.rsmodel discrpar.pcmodel > ### discrpar.plmodel discrpar.gpcmodel coef.discrpar print.discrpar > ### vcov.discrpar > ### Keywords: classes > > ### ** Examples > > o <- options(digits = 4) > > ## load verbal aggression data > data("VerbalAggression", package = "psychotools") > > ## fit Rasch model to verbal aggression data > rmod <- raschmodel(VerbalAggression$resp2) > > ## extract the discrimination parameters > dp1 <- discrpar(rmod) > > ## extract the standard errors > sqrt(diag(vcov(dp1))) S1WantCurse S1DoCurse S1WantScold S1DoScold S1WantShout S1DoShout 0 0 0 0 0 0 S2WantCurse S2DoCurse S2WantScold S2DoScold S2WantShout S2DoShout 0 0 0 0 0 0 S3WantCurse S3DoCurse S3WantScold S3DoScold S3WantShout S3DoShout 0 0 0 0 0 0 S4WantCurse S4DoCurse S4WantScold S4DoScold S4WantShout S4DoShout 0 0 0 0 0 0 > > if(requireNamespace("mirt")) { + ## fit 2PL to verbal aggression data + twoplmod <- plmodel(VerbalAggression$resp2) + + ## extract the discrimination parameters + dp2 <- discrpar(twoplmod) + + ## this time with the first discrimination parameter being the reference + discrpar(twoplmod, ref = 1) + + ## extract the standard errors + sqrt(diag(vcov(dp2))) + } Loading required namespace: mirt S1WantCurse S1DoCurse S1WantScold S1DoScold S1WantShout S1DoShout 0.2275 0.2688 0.2364 0.3494 0.2107 0.2226 S2WantCurse S2DoCurse S2WantScold S2DoScold S2WantShout S2DoShout 0.2580 0.2343 0.2455 0.2963 0.2017 0.2610 S3WantCurse S3DoCurse S3WantScold S3DoScold S3WantShout S3DoShout 0.1666 0.1837 0.2201 0.2244 0.1798 0.2483 S4WantCurse S4DoCurse S4WantScold S4DoScold S4WantShout S4DoShout 0.1990 0.2202 0.2408 0.2238 0.1774 0.2194 > > options(digits = o$digits) > > > > cleanEx() > nameEx("elementary_symmetric_functions") > ### * elementary_symmetric_functions > > flush(stderr()); flush(stdout()) > > ### Name: elementary_symmetric_functions > ### Title: Calculation of the Elementary Symmetric Functions and Their > ### Derivatives > ### Aliases: elementary_symmetric_functions > ### Keywords: misc > > ### ** Examples > > > ## calculate zero and first order elementary symmetric functions > ## for 10 polytomous items with three categories each. > pi <- split(rnorm(20), rep(1:10, each = 2)) > x <- elementary_symmetric_functions(pi) > > ## use difference algorithm instead and compare results > y <- elementary_symmetric_functions(pi, diff = TRUE) > all.equal(x, y) [1] TRUE > > > > cleanEx() > nameEx("gpcmodel") > ### * gpcmodel > > flush(stderr()); flush(stdout()) > > ### Name: gpcmodel > ### Title: Generalized Partial Credit Model Fitting Function > ### Aliases: gpcmodel print.gpcmodel summary.gpcmodel > ### print.summary.gpcmodel coef.gpcmodel bread.gpcmodel estfun.gpcmodel > ### logLik.gpcmodel vcov.gpcmodel > ### Keywords: regression > > ### ** Examples > > if(requireNamespace("mirt")) { + + o <- options(digits = 4) + + ## mathematics 101 exam results + data("MathExam14W", package = "psychotools") + + ## generalized partial credit model + gpcm <- gpcmodel(y = MathExam14W$credit) + summary(gpcm) + + ## how to specify starting values as a vector of model parameters + st <- coef(gpcm) + gpcm <- gpcmodel(y = MathExam14W$credit, start = st) + ## or a list containing a vector of slopes and a list of intercept vectors + ## itemwise + set.seed(0) + st <- list(a = rlnorm(13, 0, 0.0625), d = replicate(13, rnorm(2, 0, 1), FALSE)) + gpcm <- gpcmodel(y = MathExam14W$credit, start = st) + + ## visualizations + plot(gpcm, type = "profile") + plot(gpcm, type = "regions") + plot(gpcm, type = "piplot") + plot(gpcm, type = "curves", xlim = c(-6, 6)) + plot(gpcm, type = "information", xlim = c(-6, 6)) + ## visualizing the IRT parametrization + plot(gpcm, type = "curves", xlim = c(-6, 6), items = 1) + abline(v = threshpar(gpcm)[[1]]) + abline(v = itempar(gpcm)[1], lty = 2) + + options(digits = o$digits) + } > > > > cleanEx() > nameEx("guesspar") > ### * guesspar > > flush(stderr()); flush(stdout()) > > ### Name: guesspar > ### Title: Extract Guessing Parameters of Item Response Models > ### Aliases: guesspar guesspar.raschmodel guesspar.rsmodel guesspar.pcmodel > ### guesspar.plmodel guesspar.gpcmodel coef.guesspar print.guesspar > ### vcov.guesspar > ### Keywords: classes > > ### ** Examples > > if(requireNamespace("mirt")) { + + o <- options(digits = 3) + + ## load simulated data + data("Sim3PL", package = "psychotools") + + ## fit 2PL to data simulated under the 3PL + twoplmod <- plmodel(Sim3PL$resp) + + ## extract the guessing parameters (all fixed at 0) + gp1 <- guesspar(twoplmod) + + ## fit 3PL to data simulated under the 3PL + threeplmod <- plmodel(Sim3PL$resp, type = "3PL") + + ## extract the guessing parameters + gp2 <- guesspar(threeplmod) + + ## extract the standard errors + sqrt(diag(vcov(gp2))) + + ## extract the guessing parameters on the logit scale + gp2_logit <- guesspar(threeplmod, logit = TRUE) + + ## along with the delta transformed standard errors + sqrt(diag(vcov(gp2_logit))) + + options(digits = o$digits) + } > > > > cleanEx() > nameEx("infoplot") > ### * infoplot > > flush(stderr()); flush(stdout()) > > ### Name: infoplot > ### Title: Information Plots for IRT Models > ### Aliases: infoplot > ### Keywords: aplot > > ### ** Examples > > ## load verbal aggression data > data("VerbalAggression", package = "psychotools") > > ## fit Rasch and partial credit model to verbal aggression data > rmmod <- raschmodel(VerbalAggression$resp2) > pcmod <- pcmodel(VerbalAggression$resp) > > ## category information plots for all items under the dichotomous RM > plot(rmmod, type = "information", what = "categories") > > ## category information plots for all items under the PCM > plot(pcmod, type = "information", what = "categories") > > ## overlayed item information plots for the first six items of the > ## data set under the PCM > plot(pcmod, type = "information", what = "items", items = 1:6) > > ## a comparison of the item information for the first six items under the > ## dichotomous RM and the PCM > plot(pcmod, type = "information", what = "items", items = 1:6, + xlim = c(-5, 5)) > plot(rmmod, type = "information", what = "items", items = 1:6, + lty = 2, add = TRUE) > legend(x = "topright", legend = c("PCM", "RM"), lty = 1:2, bty = "n") > > ## a comparison of the test information based on all items of the > ## data set under the dichotomous RM and the PCM > plot(pcmod, type = "information", what = "test", items = 1:6, xlim = c(-5, 5)) > plot(rmmod, type = "information", what = "test", items = 1:6, lty = 2, + add = TRUE) > legend(x = "topright", legend = c("PCM", "RM"), lty = 1:2, bty = "n") > > if(requireNamespace("mirt")) { + ## fit 2PL to verbal aggression data + twoplmod <- plmodel(VerbalAggression$resp2) + + ## category information plots for all items under the dichotomous 2PL + plot(twoplmod, type = "information", what = "categories") + } > > > > cleanEx() > nameEx("itempar") > ### * itempar > > flush(stderr()); flush(stdout()) > > ### Name: itempar > ### Title: Extract Item Parameters of Item Response Models > ### Aliases: itempar itempar.btmodel itempar.raschmodel itempar.rsmodel > ### itempar.pcmodel itempar.plmodel itempar.gpcmodel itempar.raschtree > ### itempar.bttree coef.itempar print.itempar vcov.itempar > ### Keywords: classes > > ### ** Examples > > o <- options(digits = 4) > > ## load verbal aggression data > data("VerbalAggression", package = "psychotools") > > ## fit a Rasch model to dichotomized verbal aggression data > raschmod <- raschmodel(VerbalAggression$resp2) > > ## extract item parameters with sum zero or use last two items as anchor > ip1 <- itempar(raschmod) > ip2a <- itempar(raschmod, ref = 23:24) # with position indices > ip2b <- itempar(raschmod, ref = c("S4WantShout", "S4DoShout")) # with item label > > ip1 Item response item parameters (RM): S1WantCurse S1DoCurse S1WantScold S1DoScold S1WantShout S1DoShout -1.3834 -1.3834 -0.7307 -0.5566 -0.2491 0.6981 S2WantCurse S2DoCurse S2WantScold S2DoScold S2WantShout S2DoShout -1.9093 -1.0367 -0.8727 -0.1131 -0.1810 1.3120 S3WantCurse S3DoCurse S3WantScold S3DoScold S3WantShout S3DoShout -0.6955 0.0403 0.5136 1.3348 1.3577 2.8709 S4WantCurse S4DoCurse S4WantScold S4DoScold S4WantShout S4DoShout -1.2450 -0.8727 0.1779 0.2126 0.8711 1.8402 > ip2a Item response item parameters (RM): S1WantCurse S1DoCurse S1WantScold S1DoScold S1WantShout S1DoShout -2.73904 -2.73905 -2.08637 -1.91227 -1.60471 -0.65752 S2WantCurse S2DoCurse S2WantScold S2DoScold S2WantShout S2DoShout -3.26495 -2.39238 -2.22840 -1.46881 -1.53669 -0.04366 S3WantCurse S3DoCurse S3WantScold S3DoScold S3WantShout S3DoShout -2.05119 -1.31534 -0.84209 -0.02087 0.00205 1.51526 S4WantCurse S4DoCurse S4WantScold S4DoScold S4WantShout S4DoShout -2.60068 -2.22840 -1.17772 -1.14302 -0.48456 0.48456 > > all.equal(ip2a, ip2b) [1] TRUE > > ## extract vcov > vc1 <- vcov(ip1) > vc2 <- vcov(ip2a) > > ## adjusted standard errors, > ## smaller with more items used as anchors > sqrt(diag(vc1)) S1WantCurse S1DoCurse S1WantScold S1DoScold S1WantShout S1DoShout 0.1400 0.1400 0.1306 0.1294 0.1283 0.1349 S2WantCurse S2DoCurse S2WantScold S2DoScold S2WantShout S2DoShout 0.1535 0.1341 0.1321 0.1284 0.1283 0.1479 S3WantCurse S3DoCurse S3WantScold S3DoScold S3WantShout S3DoShout 0.1303 0.1287 0.1324 0.1485 0.1492 0.2219 S4WantCurse S4DoCurse S4WantScold S4DoScold S4WantShout S4DoShout 0.1374 0.1321 0.1294 0.1296 0.1378 0.1654 > sqrt(diag(vc2)) S1WantCurse S1DoCurse S1WantScold S1DoScold S1WantShout S1DoShout 0.1822 0.1822 0.1739 0.1727 0.1715 0.1758 S2WantCurse S2DoCurse S2WantScold S2DoScold S2WantShout S2DoShout 0.1940 0.1770 0.1752 0.1714 0.1714 0.1861 S3WantCurse S3DoCurse S3WantScold S3DoScold S3WantShout S3DoShout 0.1736 0.1715 0.1740 0.1866 0.1872 0.2524 S4WantCurse S4DoCurse S4WantScold S4DoScold S4WantShout S4DoShout 0.1799 0.1752 0.1719 0.1720 0.1098 0.1098 > > ## Wald confidence intervals > confint(ip1) 2.5 % 97.5 % S1WantCurse -1.65779 -1.108969 S1DoCurse -1.65780 -1.108975 S1WantScold -0.98677 -0.474645 S1DoScold -0.81017 -0.303037 S1WantShout -0.50057 0.002469 S1DoShout 0.43369 0.962584 S2WantCurse -2.21010 -1.608490 S2DoCurse -1.29956 -0.773879 S2WantScold -1.13156 -0.613916 S2DoScold -0.36472 0.138425 S2WantShout -0.43251 0.070440 S2DoShout 1.02215 1.601865 S3WantCurse -0.95101 -0.440049 S3DoCurse -0.21201 0.292654 S3WantScold 0.25401 0.773120 S3DoScold 1.04370 1.625879 S3WantShout 1.06536 1.650059 S3DoShout 2.43599 3.305848 S4WantCurse -1.51430 -0.975743 S4DoCurse -1.13156 -0.613916 S4WantScold -0.07573 0.431608 S4DoScold -0.04146 0.466738 S4WantShout 0.60095 1.141248 S4DoShout 1.51595 2.164496 > confint(ip2a) 2.5 % 97.5 % S1WantCurse -3.0961 -2.3819 S1DoCurse -3.0962 -2.3819 S1WantScold -2.4272 -1.7455 S1DoScold -2.2507 -1.5738 S1WantShout -1.9408 -1.2686 S1DoShout -1.0022 -0.3129 S2WantCurse -3.6451 -2.8848 S2DoCurse -2.7393 -2.0454 S2WantScold -2.5717 -1.8850 S2DoScold -1.8047 -1.1329 S2WantShout -1.8726 -1.2007 S2DoShout -0.4084 0.3211 S3WantCurse -2.3915 -1.7109 S3DoCurse -1.6515 -0.9792 S3WantScold -1.1831 -0.5011 S3DoScold -0.3866 0.3449 S3WantShout -0.3648 0.3689 S3DoShout 1.0206 2.0099 S4WantCurse -2.9533 -2.2481 S4DoCurse -2.5717 -1.8850 S4WantScold -1.5146 -0.8408 S4DoScold -1.4802 -0.8058 S4WantShout -0.6998 -0.2694 S4DoShout 0.2694 0.6998 > > options(digits = o$digits) > > > > cleanEx() > nameEx("itemresp") > ### * itemresp > > flush(stderr()); flush(stdout()) > > ### Name: itemresp > ### Title: Data Structure for Item Response Data > ### Aliases: itemresp is.na.itemresp labels.itemresp labels<-.itemresp > ### length.itemresp levels.itemresp mscale.itemresp mscale<-.itemresp > ### names.itemresp names<-.itemresp rep.itemresp str.itemresp > ### xtfrm.itemresp > ### Keywords: classes > > ### ** Examples > > ## binary responses to three items, coded as matrix > x <- cbind(c(1, 0, 1, 0), c(1, 0, 0, 0), c(0, 1, 1, 1)) > ## transformed to itemresp object > xi <- itemresp(x) > > ## printing (see also ?print.itemresp) > print(xi) [1] {1,1,0} {0,0,1} {1,0,1} {0,0,1} > print(xi, labels = TRUE) [1] {item1:1,item2:1,item3:0} {item1:0,item2:0,item3:1} [3] {item1:1,item2:0,item3:1} {item1:0,item2:0,item3:1} > > ## subsetting/indexing (see also ?subset.itemresp) > xi[2] [1] {0,0,1} > xi[c(TRUE, TRUE, FALSE, FALSE)] [1] {1,1,0} {0,0,1} > subset(xi, items = 1:2) [1] {1,1} {0,0} {1,0} {0,0} > dim(xi) [1] 4 3 > length(xi) [1] 4 > > ## summary/visualization (see also ?summary.itemresp) > summary(xi) 0 1 item1 2 2 item2 3 1 item3 1 3 > plot(xi) > > ## query/set measurement scale labels > ## extract mscale (tries to collapse to vector) > mscale(xi) [1] 0 1 > ## extract as list > mscale(xi, simplify = FALSE) $item1 [1] 0 1 $item2 [1] 0 1 $item3 [1] 0 1 > ## replacement by list > mscale(xi) <- list(item1 = c("no", "yes"), + item2 = c("nay", "yae"), item3 = c("-", "+")) > xi [1] {yes,yae,-} {no,nay,+} {yes,nay,+} {no,nay,+} > mscale(xi) $item1 [1] "no" "yes" $item2 [1] "nay" "yae" $item3 [1] "-" "+" > ## replacement with partially named list plus default > mscale(xi) <- list(item1 = c("n", "y"), 0:1) > mscale(xi) $item1 [1] "n" "y" $item2 [1] "0" "1" $item3 [1] "0" "1" > ## replacement by vector (if number of categories constant) > mscale(xi) <- c("-", "+") > mscale(xi, simplify = FALSE) $item1 [1] "-" "+" $item2 [1] "-" "+" $item3 [1] "-" "+" > > ## query/set item labels and subject names > labels(xi) [1] "item1" "item2" "item3" > labels(xi) <- c("i1", "i2", "i3") > names(xi) NULL > names(xi) <- c("John", "Joan", "Jen", "Jim") > print(xi, labels = TRUE) John Joan Jen Jim {i1:+,i2:+,i3:-} {i1:-,i2:-,i3:+} {i1:+,i2:-,i3:+} {i1:-,i2:-,i3:+} > > ## coercion (see also ?as.list.itemresp) > ## to integer matrix > as.matrix(xi) i1 i2 i3 John 1 1 0 Joan 0 0 1 Jen 1 0 1 Jim 0 0 1 > ## to data frame with single itemresp column > as.data.frame(xi) xi John {+,+,-} Joan {-,-,+} Jen {+,-,+} Jim {-,-,+} > ## to list of factors > as.list(xi) $i1 John Joan Jen Jim + - + - Levels: - + $i2 John Joan Jen Jim + - - - Levels: - + $i3 John Joan Jen Jim - + + + Levels: - + > ## to data frame with factors > as.list(xi, df = TRUE) i1 i2 i3 John + + - Joan - - + Jen + - + Jim - - + > > > ## polytomous responses with missing values and unequal number of > ## categories in a data frame > d <- data.frame( + q1 = c(-2, 1, -1, 0, NA, 1, NA), + q2 = c(3, 5, 2, 5, NA, 2, 3), + q3 = factor(c(1, 2, 1, 2, NA, 3, 2), levels = 1:3, + labels = c("disagree", "neutral", "agree"))) > di <- itemresp(d) > di 1 2 3 4 5 6 {-2,3,dsgr} {1,5,ntrl} {-1,2,dsgr} {0,5,ntrl} {NA,NA,NA} {1,2,agre} 7 {NA,3,ntrl} > > ## auto-completion of mscale: full range (-2, ..., 2) for q1, starting > ## from smallest observed (negative) value (-2) to the same (positive) > ## value (2), full (positive) range for q2, starting from smallest > ## observed value (2) to largest observed value (5), missing category of > ## 4 is detected, for q3 given factor levels are used > mscale(di) $q1 [1] "-2" "-1" "0" "1" "2" $q2 [1] "2" "3" "4" "5" $q3 [1] "disagree" "neutral" "agree" > > ## set mscale for q2 and add category 1, q1 and q3 are auto-completed: > di <- itemresp(d, mscale = list(q2 = 1:5)) > > ## is.na.itemresp - only true for observation 5 (all missing) > is.na(di) 1 2 3 4 5 6 7 FALSE FALSE FALSE FALSE TRUE FALSE FALSE > > ## illustration for larger data set > data("VerbalAggression", package = "psychotools") > r <- itemresp(VerbalAggression$resp[, 1:12]) > str(r) Item response data from 316 subjects for 12 items. S1WantCurse: 0, 1, 2 S1DoCurse: 0, 1, 2 S1WantScold: 0, 1, 2 S1DoScold: 0, 1, 2 S1WantShout: 0, 1, 2 S1DoShout: 0, 1, 2 S2WantCurse: 0, 1, 2 S2DoCurse: 0, 1, 2 S2WantScold: 0, 1, 2 S2DoScold: 0, 1, 2 S2WantShout: 0, 1, 2 S2DoShout: 0, 1, 2 > head(r) [1] {0,1,0,0,0,1,0,1,0,0,0,0} {0,0,0,0,0,0,0,0,0,0,0,0} [3] {1,0,1,1,1,1,1,0,0,0,1,1} {1,1,1,1,1,1,1,2,1,1,1,1} [5] {1,1,0,1,1,0,1,1,0,0,0,0} {2,2,2,0,0,0,2,2,0,0,0,0} > plot(r) > summary(r) 0 1 2 S1WantCurse 91 95 130 S1DoCurse 91 108 117 S1WantScold 126 86 104 S1DoScold 136 97 83 S1WantShout 154 99 63 S1DoShout 208 68 40 S2WantCurse 67 112 137 S2DoCurse 109 97 110 S2WantScold 118 93 105 S2DoScold 162 92 62 S2WantShout 158 84 74 S2DoShout 238 53 25 > prop.table(summary(r), 1) 0 1 2 S1WantCurse 0.2879747 0.3006329 0.41139241 S1DoCurse 0.2879747 0.3417722 0.37025316 S1WantScold 0.3987342 0.2721519 0.32911392 S1DoScold 0.4303797 0.3069620 0.26265823 S1WantShout 0.4873418 0.3132911 0.19936709 S1DoShout 0.6582278 0.2151899 0.12658228 S2WantCurse 0.2120253 0.3544304 0.43354430 S2DoCurse 0.3449367 0.3069620 0.34810127 S2WantScold 0.3734177 0.2943038 0.33227848 S2DoScold 0.5126582 0.2911392 0.19620253 S2WantShout 0.5000000 0.2658228 0.23417722 S2DoShout 0.7531646 0.1677215 0.07911392 > > ## dichotomize response > r2 <- r > mscale(r2) <- c(0, 1, 1) > plot(r2) > > ## transform to "likert" package > if(require("likert")) { + lik <- likert(as.data.frame(as.list(r))) + lik + plot(lik) + } Loading required package: likert Loading required package: ggplot2 Loading required package: xtable > > > > cleanEx() detaching ‘package:likert’, ‘package:xtable’, ‘package:ggplot2’ > nameEx("labels") > ### * labels > > flush(stderr()); flush(stdout()) > > ### Name: labels<- > ### Title: Set Labels > ### Aliases: labels<- > ### Keywords: classes > > ### ** Examples > > ## method for "paircomp" data > pc <- paircomp(rbind( + c(1, 1, 1), # a > b, a > c, b > c + c(1, 1, -1), # a > b, a > c, b < c + c(1, -1, -1), # a > b, a < c, b < c + c(1, 1, 1))) > labels(pc) [1] "a" "b" "c" > labels(pc) <- c("ah", "be", "ce") > pc [1] {ah > be, ah > ce, be > ce} {ah > be, ah > ce, be < ce} [3] {ah > be, ah < ce, be < ce} {ah > be, ah > ce, be > ce} > > > > cleanEx() > nameEx("mptmodel") > ### * mptmodel > > flush(stderr()); flush(stdout()) > > ### Name: mptmodel > ### Title: Multinomial Processing Tree (MPT) Model Fitting Function > ### Aliases: mptmodel coef.mptmodel confint.mptmodel deviance.mptmodel > ### estfun.mptmodel logLik.mptmodel predict.mptmodel print.mptmodel > ### summary.mptmodel print.summary.mptmodel vcov.mptmodel mptspec > ### print.mptspec update.mptspec > ### Keywords: regression > > ### ** Examples > > o <- options(digits = 4) > > ## data > data("SourceMonitoring", package = "psychotools") > > ## source-monitoring MPT model > mpt1 <- mptmodel(SourceMonitoring$y, spec = mptspec("SourceMon")) > summary(mpt1) Coefficients: Estimate Logit Estim. Std. Error z value Pr(>|z|) D1 0.614 0.4651 0.0556 8.37 <2e-16 *** d1 0.379 -0.4927 0.1828 -2.70 0.007 ** g 0.535 0.1392 0.0779 1.79 0.074 . b 0.172 -1.5687 0.0427 -36.72 <2e-16 *** D2 0.675 0.7292 0.0568 12.84 <2e-16 *** d2 0.425 -0.3031 0.1428 -2.12 0.034 * --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Likelihood ratio G2: 0 on 0 df, p-value: 1 AIC: 12478 Number of trees: 3 > plot(mpt1) > > options(digits = o$digits) > > > > cleanEx() > nameEx("mscale") > ### * mscale > > flush(stderr()); flush(stdout()) > > ### Name: mscale > ### Title: Extract/Replace Measurement Scale > ### Aliases: mscale mscale<- > ### Keywords: classes > > ### ** Examples > > ## methods for "paircomp" data > pc <- paircomp(rbind( + c(2, 1, 0), + c(1, 1, -1), + c(1, -2, -1), + c(0, 0, 0))) > pc [1] {a >> b, a > c, b = c} {a > b, a > c, b < c} {a > b, a << c, b < c} [4] {a = b, a = c, b = c} > > ## extract > mscale(pc) [1] -2 -1 0 1 2 > > ## replace (collapse to >/=/< scale) > mscale(pc) <- sign(mscale(pc)) > pc [1] {a > b, a > c, b = c} {a > b, a > c, b < c} {a > b, a < c, b < c} [4] {a = b, a = c, b = c} > > > ## similar for "itemresp" data > ir <- itemresp(cbind( + c(-1, 0, 1, 1, 0), + c(0, 1, 2, 1, 2), + c(1, 2, 1, 1, 3))) > ir [1] {-1,0,1} {0,1,2} {1,2,1} {1,1,1} {0,2,3} > > ## extract > mscale(ir) $item1 [1] -1 0 1 $item2 [1] 0 1 2 $item3 [1] 1 2 3 > > ## replace (single scale for all items) > mscale(ir) <- 1:3 > ir [1] {1,1,1} {2,2,2} {3,3,1} {3,2,1} {2,3,3} > > > > cleanEx() > nameEx("paircomp") > ### * paircomp > > flush(stderr()); flush(stdout()) > > ### Name: paircomp > ### Title: Data Structure for Paired Comparisons > ### Aliases: paircomp length.paircomp c.paircomp [.paircomp rep.paircomp > ### xtfrm.paircomp as.character.paircomp as.data.frame.paircomp > ### as.double.paircomp as.integer.paircomp as.matrix.paircomp > ### covariates.paircomp covariates<-.paircomp labels.paircomp > ### labels<-.paircomp names.paircomp names<-.paircomp mscale.paircomp > ### mscale<-.paircomp str.paircomp summary.paircomp is.na.paircomp > ### Keywords: classes > > ### ** Examples > > ## a simple paired comparison > pc <- paircomp(rbind( + c(1, 1, 1), # a > b, a > c, b > c + c(1, 1, -1), # a > b, a > c, b < c + c(1, -1, -1), # a > b, a < c, b < c + c(1, 1, 1))) > > ## basic methods > pc [1] {a > b, a > c, b > c} {a > b, a > c, b < c} {a > b, a < c, b < c} [4] {a > b, a > c, b > c} > str(pc) Paired comparisons from 4 subjects for 3 objects: a, b, c. > summary(pc) > < a : b 4 0 a : c 3 1 b : c 2 2 > pc[2:3] [1] {a > b, a > c, b < c} {a > b, a < c, b < c} > c(pc[2], pc[c(1, 4)]) [1] {a > b, a > c, b < c} {a > b, a > c, b > c} {a > b, a > c, b > c} > > ## methods to extract/set attributes > labels(pc) [1] "a" "b" "c" > labels(pc) <- c("ah", "be", "ce") > pc [1] {ah > be, ah > ce, be > ce} {ah > be, ah > ce, be < ce} [3] {ah > be, ah < ce, be < ce} {ah > be, ah > ce, be > ce} > mscale(pc) [1] -1 1 > covariates(pc) NULL > covariates(pc) <- data.frame(foo = factor(c(1, 2, 2), labels = c("foo", "bar"))) > covariates(pc) foo ah foo be bar ce bar > names(pc) NULL > names(pc) <- LETTERS[1:4] > pc A B {ah > be, ah > ce, be > ce} {ah > be, ah > ce, be < ce} C D {ah > be, ah < ce, be < ce} {ah > be, ah > ce, be > ce} > > ## reorder() and subset() both select a subset of > ## objects and/or reorders the objects > reorder(pc, c("ce", "ah")) A B C D {ce < ah} {ce < ah} {ce > ah} {ce < ah} > > > ## include paircomp object in a data.frame > ## (i.e., with subject covariates) > dat <- data.frame( + x = rnorm(4), + y = factor(c(1, 2, 1, 1), labels = c("hansi", "beppi"))) > dat$pc <- pc > dat x y pc 1 -0.6264538 hansi {ah > be, ah > ce, be > ce} 2 0.1836433 beppi {ah > be, ah > ce, be < ce} 3 -0.8356286 hansi {ah > be, ah < ce, be < ce} 4 1.5952808 hansi {ah > be, ah > ce, be > ce} > > > ## formatting with long(er) labels and extended scale > pc2 <- paircomp(rbind( + c(4, 1, 0), + c(1, 2, -1), + c(1, -2, -1), + c(0, 0, -3)), + labels = c("Nordrhein-Westfalen", "Schleswig-Holstein", "Baden-Wuerttemberg")) > ## default: abbreviate > print(pc2) [1] {Nr-W 4> Sc-H, Nr-W > Bd-W, Sc-H = Bd-W} [2] {Nr-W > Sc-H, Nr-W 2> Bd-W, Sc-H < Bd-W} [3] {Nr-W > Sc-H, Nr-W 2< Bd-W, Sc-H < Bd-W} [4] {Nr-W = Sc-H, Nr-W = Bd-W, Sc-H 3< Bd-W} > print(pc2, abbreviate = FALSE) [1] {Nordrhein-Westfalen 4> Schleswig-Holstein, Nordrhein-Westfalen > Bad...} [2] {Nordrhein-Westfalen > Schleswig-Holstein, Nordrhein-Westfalen 2> Bad...} [3] {Nordrhein-Westfalen > Schleswig-Holstein, Nordrhein-Westfalen 2< Bad...} [4] {Nordrhein-Westfalen = Schleswig-Holstein, Nordrhein-Westfalen = Bade...} > print(pc2, abbreviate = FALSE, width = FALSE) [1] {Nordrhein-Westfalen 4> Schleswig-Holstein, Nordrhein-Westfalen > Baden-Wuerttemberg, Schleswig-Holstein = Baden-Wuerttemberg} [2] {Nordrhein-Westfalen > Schleswig-Holstein, Nordrhein-Westfalen 2> Baden-Wuerttemberg, Schleswig-Holstein < Baden-Wuerttemberg} [3] {Nordrhein-Westfalen > Schleswig-Holstein, Nordrhein-Westfalen 2< Baden-Wuerttemberg, Schleswig-Holstein < Baden-Wuerttemberg} [4] {Nordrhein-Westfalen = Schleswig-Holstein, Nordrhein-Westfalen = Baden-Wuerttemberg, Schleswig-Holstein 3< Baden-Wuerttemberg} > > > ## paired comparisons with object covariates > pc3 <- paircomp(rbind( + c(2, 1, 0), + c(1, 1, -1), + c(1, -2, -1), + c(0, 0, 0)), + labels = c("New York", "Rio", "Tokyo"), + covariates = data.frame(hemisphere = factor(c(1, 2, 1), labels = c("North", "South")))) > covariates(pc3) hemisphere New York North Rio South Tokyo North > > > > cleanEx() > nameEx("pcmodel") > ### * pcmodel > > flush(stderr()); flush(stdout()) > > ### Name: pcmodel > ### Title: Partial Credit Model Fitting Function > ### Aliases: pcmodel PCModel.fit print.pcmodel summary.pcmodel > ### print.summary.pcmodel coef.pcmodel bread.pcmodel estfun.pcmodel > ### logLik.pcmodel vcov.pcmodel > ### Keywords: regression > > ### ** Examples > > o <- options(digits = 4) > > ## Verbal aggression data > data("VerbalAggression", package = "psychotools") > > ## Partial credit model for the other-to-blame situations > pcm <- pcmodel(VerbalAggression$resp[, 1:12]) > summary(pcm) Partial credit model Item category parameters: Estimate Std. Error z value Pr(>|z|) S1WantCurse-C2 0.4315 0.2545 1.70 0.09006 . S1DoCurse-C1 -0.1066 0.2186 -0.49 0.62581 S1DoCurse-C2 0.5954 0.3587 1.66 0.09695 . S1WantScold-C1 0.5637 0.2162 2.61 0.00912 ** S1WantScold-C2 1.2544 0.3576 3.51 0.00045 *** S1DoScold-C1 0.5814 0.2118 2.74 0.00605 ** S1DoScold-C2 1.7075 0.3623 4.71 2.4e-06 *** S1WantShout-C1 0.7668 0.2096 3.66 0.00025 *** S1WantShout-C2 2.3031 0.3696 6.23 4.6e-10 *** S1DoShout-C1 1.6244 0.2179 7.46 9.0e-14 *** S1DoShout-C2 3.4790 0.3889 8.94 < 2e-16 *** S2WantCurse-C1 -0.5627 0.2286 -2.46 0.01382 * S2WantCurse-C2 -0.0786 0.3620 -0.22 0.82821 S2DoCurse-C1 0.2441 0.2162 1.13 0.25897 S2DoCurse-C2 0.9515 0.3577 2.66 0.00781 ** S2WantScold-C1 0.3977 0.2155 1.85 0.06491 . S2WantScold-C2 1.1403 0.3579 3.19 0.00144 ** S2DoScold-C1 0.9122 0.2108 4.33 1.5e-05 *** S2DoScold-C2 2.4113 0.3702 6.51 7.3e-11 *** S2WantShout-C1 0.9453 0.2134 4.43 9.4e-06 *** S2WantShout-C2 2.1175 0.3650 5.80 6.6e-09 *** S2DoShout-C1 2.1247 0.2273 9.35 < 2e-16 *** S2DoShout-C2 4.4099 0.4200 10.50 < 2e-16 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Log-likelihood: -2470 (df = 23) Number of iterations in BFGS optimization: 32 > > ## visualizations > plot(pcm, type = "profile") > plot(pcm, type = "regions") > plot(pcm, type = "piplot") > plot(pcm, type = "curves") > plot(pcm, type = "information") > > ## Get data of situation 1 ('A bus fails to > ## stop for me') and induce a null category in item 2. > pcd <- VerbalAggression$resp[, 1:6, drop = FALSE] > pcd[pcd[, 2] == 1, 2] <- NA > > ## fit pcm to these data, comparing downcoding and keeping strategy > pcm_va_keep <- pcmodel(pcd, nullcats = "keep") Warning in pcmodel(pcd, nullcats = "keep") : There are items with null categories (2). > pcm_va_down <- pcmodel(pcd, nullcats = "downcode") Warning in pcmodel(pcd, nullcats = "downcode") : There are items with null categories (2). > > plot(x = coef(pcm_va_keep), y = coef(pcm_va_down), + xlab = "Threshold Parameters (Keeping)", + ylab = "Threshold Parameters (Downcoding)", + main = "Comparison of two null category strategies (I2 with null category)", + pch = rep(as.character(1:6), each = 2)[-3]) > abline(b = 1, a = 0) > > options(digits = o$digits) > > > > cleanEx() > nameEx("personpar") > ### * personpar > > flush(stderr()); flush(stdout()) > > ### Name: personpar > ### Title: Extract Person Parameters of Item Response Models > ### Aliases: personpar personpar.raschmodel personpar.rsmodel > ### personpar.pcmodel personpar.plmodel personpar.gpcmodel coef.personpar > ### print.personpar vcov.personpar > ### Keywords: classes > > ### ** Examples > > o <- options(digits = 3) > > ## load verbal aggression data > data("VerbalAggression", package = "psychotools") > > ## fit a Rasch model to dichotomized verbal aggression data and > ram <- raschmodel(VerbalAggression$resp2) > > ## extract person parameters > ## (= parameters of the underlying ability distribution) > rap <- personpar(ram) > rap Item response person parameters (RM): 1 2 3 4 5 6 7 8 9 10 -3.6185 -2.8441 -2.3552 -1.9815 -1.6694 -1.3947 -1.1444 -0.9104 -0.6872 -0.4708 11 12 13 14 15 16 17 18 19 20 -0.2581 -0.0464 0.1670 0.3845 0.6090 0.8438 1.0931 1.3629 1.6616 2.0035 21 22 23 2.4140 2.9489 3.7813 > > ## extract variance-covariance matrix and standard errors > vc <- vcov(rap) > sqrt(diag(vc)) 1 2 3 4 5 6 7 8 9 10 11 0.5197 0.2413 0.2444 0.1369 0.1495 0.1540 0.1191 0.1042 0.1047 0.1061 0.1188 12 13 14 15 16 17 18 19 20 21 22 0.1057 0.1197 0.0939 0.0998 0.1228 0.1694 0.1534 0.1781 0.2485 0.2258 0.3560 23 0.6179 > > ## Wald confidence intervals > confint(rap) 2.5 % 97.5 % 1 -4.6370 -2.5999 2 -3.3170 -2.3712 3 -2.8342 -1.8763 4 -2.2499 -1.7132 5 -1.9624 -1.3764 6 -1.6965 -1.0929 7 -1.3778 -0.9110 8 -1.1145 -0.7062 9 -0.8924 -0.4820 10 -0.6789 -0.2628 11 -0.4910 -0.0252 12 -0.2535 0.1607 13 -0.0677 0.4016 14 0.2004 0.5686 15 0.4134 0.8046 16 0.6031 1.0845 17 0.7610 1.4252 18 1.0621 1.6636 19 1.3125 2.0108 20 1.5165 2.4904 21 1.9714 2.8566 22 2.2511 3.6467 23 2.5703 4.9924 > > ## now match each person to person parameter with the corresponding raw score > personpar(ram, personwise = TRUE)[1:6] 1 2 3 4 5 6 -0.687 -3.618 -0.471 0.385 -0.471 -0.258 > > ## person parameters for RSM/PCM fitted to original polytomous data > rsm <- rsmodel(VerbalAggression$resp) > pcm <- pcmodel(VerbalAggression$resp) > cbind(personpar(rsm, vcov = FALSE), personpar(pcm, vcov = FALSE)) [,1] [,2] 1 -3.7657 -3.7851 2 -3.0721 -3.0866 3 -2.6623 -2.6730 4 -2.3672 -2.3749 5 -2.1338 -2.1392 6 -1.9390 -1.9424 7 -1.7701 -1.7721 8 -1.6200 -1.6208 9 -1.4837 -1.4837 10 -1.3583 -1.3574 11 -1.2412 -1.2398 12 -1.1309 -1.1291 13 -1.0260 -1.0239 14 -0.9256 -0.9232 15 -0.8287 -0.8262 16 -0.7348 -0.7322 17 -0.6433 -0.6407 18 -0.5537 -0.5511 19 -0.4657 -0.4631 20 -0.3787 -0.3762 21 -0.2926 -0.2902 22 -0.2069 -0.2047 23 -0.1215 -0.1195 24 -0.0360 -0.0343 25 0.0499 0.0513 26 0.1363 0.1374 27 0.2237 0.2244 28 0.3122 0.3125 29 0.4023 0.4021 30 0.4942 0.4934 31 0.5883 0.5870 32 0.6851 0.6833 33 0.7850 0.7826 34 0.8887 0.8857 35 0.9968 0.9933 36 1.1103 1.1063 37 1.2300 1.2257 38 1.3575 1.3530 39 1.4945 1.4900 40 1.6432 1.6391 41 1.8071 1.8038 42 1.9907 1.9889 43 2.2013 2.2021 44 2.4512 2.4556 45 2.7629 2.7727 46 3.1880 3.2054 47 3.8932 3.9209 > > if(requireNamespace("mirt")) { + ## fit a 2PL accounting for gender impact and + twoplm <- plmodel(VerbalAggression$resp2, impact = VerbalAggression$gender) + + ## extract the person parameters + ## (= mean/variance parameters from the normal ability distribution) + twoplp <- personpar(twoplm) + twoplp + + ## extract the standard errors + sqrt(diag(vcov(twoplp))) + + ## Wald confidence intervals + confint(twoplp) + + ## now look at the individual person parameters + ## (integrated out over the normal ability distribution) + personpar(twoplm, personwise = TRUE)[1:6] + } 1 2 3 4 5 6 -0.351 -1.695 -0.134 0.472 -0.172 -0.125 > > options(digits = o$digits) > > > > cleanEx() > nameEx("piplot") > ### * piplot > > flush(stderr()); flush(stdout()) > > ### Name: piplot > ### Title: Person-Item Plots for IRT Models > ### Aliases: piplot > ### Keywords: aplot > > ### ** Examples > > ## load verbal agression data > data("VerbalAggression", package = "psychotools") > > ## fit partial credit model to verbal aggression data > pcmod <- pcmodel(VerbalAggression$resp) > > ## create a person-item plot visualization of the fitted PCM > plot(pcmod, type = "piplot") > > ## just visualize the first six items and the person parameter plot > plot(pcmod, type = "piplot", items = 1:6, pcol = "lightblue") > > > > > cleanEx() > nameEx("plmodel") > ### * plmodel > > flush(stderr()); flush(stdout()) > > ### Name: plmodel > ### Title: Parametric Logistic Model Fitting Function > ### Aliases: plmodel print.plmodel summary.plmodel print.summary.plmodel > ### coef.plmodel confint.plmodel bread.plmodel estfun.plmodel > ### logLik.plmodel vcov.plmodel > ### Keywords: regression > > ### ** Examples > > if(requireNamespace("mirt")) { + + o <- options(digits = 4) + + ## mathematics 101 exam results + data("MathExam14W", package = "psychotools") + + ## 2PL + twopl <- plmodel(y = MathExam14W$solved) + summary(twopl) + + ## how to specify starting values as a vector of model parameters + st <- coef(twopl) + twopl <- plmodel(y = MathExam14W$solved, start = st) + ## or a list containing a vector of slopes and a vector of intercepts + set.seed(0) + st <- list(a = rlnorm(13, 0, 0.0625), d = rnorm(13, 0, 1)) + twopl <- plmodel(y = MathExam14W$solved, start = st) + + ## visualizations + plot(twopl, type = "profile") + plot(twopl, type = "regions") + plot(twopl, type = "piplot") + plot(twopl, type = "curves", xlim = c(-6, 6)) + plot(twopl, type = "information", xlim = c(-6, 6)) + ## visualizing the IRT parametrization + plot(twopl, type = "curves", xlim = c(-6, 6), items = 1) + abline(v = itempar(twopl)[1]) + abline(h = 0.5, lty = 2) + + ## 2PL accounting for gender impact + table(MathExam14W$gender) + mtwopl <- plmodel(y = MathExam14W$solved, impact = MathExam14W$gender, + grouppars = TRUE) + summary(mtwopl) + plot(mtwopl, type = "piplot") + ## specifying starting values as a vector of model parameters, note that in + ## this example impact is being modelled and therefore grouppars must be TRUE + ## to get all model parameters + st <- coef(mtwopl) + mtwopl <- plmodel(y = MathExam14W$solved, impact = MathExam14W$gender, + start = st) + ## or a list containing a vector of slopes, a vector of intercepts and a vector + ## of means and a vector of variances as the distributional group parameters + set.seed(1) + st <- list(a = rlnorm(13, 0, 0.0625), d = rnorm(13, 0, 1), m = 0, v = 1) + mtwopl <- plmodel(y = MathExam14W$solved, impact = MathExam14W$gender, + start = st) + + ## MML estimated Rasch model (1PL) + rm <- plmodel(y = MathExam14W$solved, type = "1PL") + summary(rm) + + options(digits = o$digits) + } > > > > cleanEx() > nameEx("plot.btmodel") > ### * plot.btmodel > > flush(stderr()); flush(stdout()) > > ### Name: plot.btmodel > ### Title: Visualizing Bradley-Terry Models > ### Aliases: plot.btmodel > ### Keywords: hplot > > ### ** Examples > > ## data > data("GermanParties2009", package = "psychotools") > > ## Bradley-Terry model > bt <- btmodel(GermanParties2009$preference) > plot(bt) > plot(bt, worth = FALSE) > plot(bt, index = FALSE) > > > > cleanEx() > nameEx("plot.paircomp") > ### * plot.paircomp > > flush(stderr()); flush(stdout()) > > ### Name: plot.paircomp > ### Title: Plotting Paired Comparison Data > ### Aliases: plot.paircomp > ### Keywords: classes > > ### ** Examples > > data("GermanParties2009", package = "psychotools") > par(mar = c(5, 6, 3, 6)) > plot(GermanParties2009$preference, abbreviate = FALSE) > > > > graphics::par(get("par.postscript", pos = 'CheckExEnv')) > cleanEx() > nameEx("predict.pcmodel") > ### * predict.pcmodel > > flush(stderr()); flush(stdout()) > > ### Name: predict.pcmodel > ### Title: Predict Methods for Item Response Models > ### Aliases: predict.pcmodel predict.rsmodel predict.raschmodel > ### predict.gpcmodel predict.plmodel > ### Keywords: regression > > ### ** Examples > > o <- options(digits = 4) > > ## load verbal aggression data > data("VerbalAggression", package = "psychotools") > > ## fit a partial credit model to first ten items > pcmod <- pcmodel(VerbalAggression$resp[, 1:10]) > > ## predicted response probabilities for each subject and category (the default) > head(predict(pcmod), 3) S1WantCurse-C0 S1WantCurse-C1 S1WantCurse-C2 S1DoCurse-C0 S1DoCurse-C1 [1,] 0.6513 0.2742 0.07457 0.6387 0.2991 [2,] 0.3956 0.3749 0.22950 0.3927 0.4139 [3,] 0.1367 0.3345 0.52886 0.1427 0.3885 S1DoCurse-C2 S1WantScold-C0 S1WantScold-C1 S1WantScold-C2 S1DoScold-C0 [1,] 0.06211 0.7757 0.1853 0.03895 0.7895 [2,] 0.19342 0.5580 0.3001 0.14194 0.5917 [3,] 0.46885 0.2448 0.3399 0.41531 0.2904 S1DoScold-C1 S1DoScold-C2 S1WantShout-C0 S1WantShout-C1 S1WantShout-C2 [1,] 0.1853 0.02522 0.8247 0.1607 0.01453 [2,] 0.3125 0.09576 0.6545 0.2871 0.05843 [3,] 0.3961 0.31349 0.3665 0.4153 0.21827 S1DoShout-C0 S1DoShout-C1 S1DoShout-C2 S2WantCurse-C0 S2WantCurse-C1 [1,] 0.9191 0.07589 0.00500 0.51720 0.3838 [2,] 0.8241 0.15315 0.02271 0.27473 0.4589 [3,] 0.6010 0.28848 0.11050 0.08487 0.3662 S2WantCurse-C2 S2DoCurse-C0 S2DoCurse-C1 S2DoCurse-C2 S2WantScold-C0 [1,] 0.09899 0.7157 0.2356 0.04868 0.7471 [2,] 0.26638 0.4795 0.3553 0.16521 0.5208 [3,] 0.54898 0.1918 0.3672 0.44097 0.2201 S2WantScold-C1 S2WantScold-C2 S2DoScold-C0 S2DoScold-C1 S2DoScold-C2 [1,] 0.2108 0.04206 0.8444 0.1423 0.01335 [2,] 0.3307 0.14852 0.6852 0.2599 0.05490 [3,] 0.3611 0.41879 0.3978 0.3897 0.21259 > > ## predicted mode (most probable category) for certain subjects whose person > ## parameters are given via argument "newdata" > predict(pcmod, type = "mode", + newdata = c("Sarah" = 1.2, "Michael" = 0.1, "Arnd" = -0.8)) S1WantCurse S1DoCurse S1WantScold S1DoScold S1WantShout S1DoShout Sarah 2 2 2 2 2 2 Michael 2 2 2 1 1 0 Arnd 0 1 0 0 0 0 S2WantCurse S2DoCurse S2WantScold S2DoScold Sarah 2 2 2 2 Michael 2 2 2 0 Arnd 1 0 0 0 > > ## rounded expected category value for the same subjects > predict(pcmod, type = "mean", + newdata = c("Sarah" = 1.2, "Michael" = 0.1, "Arnd" = -0.8)) S1WantCurse S1DoCurse S1WantScold S1DoScold S1WantShout S1DoShout Sarah 2 2 2 2 1 1 Michael 1 1 1 1 1 0 Arnd 1 1 1 0 0 0 S2WantCurse S2DoCurse S2WantScold S2DoScold Sarah 2 2 2 1 Michael 1 1 1 1 Arnd 1 1 1 0 > > ## in the Rasch model mode, mean and median are the same > raschmod <- raschmodel(VerbalAggression$resp2[, 1:10]) > med <- predict(raschmod, type = "median") > mn <- predict(raschmod, type = "mean") > mod <- predict(raschmod, type = "mode") > > head(med, 3) S1WantCurse S1DoCurse S1WantScold S1DoScold S1WantShout S1DoShout [1,] 0 0 0 0 0 0 [2,] 1 1 1 1 0 0 [3,] 1 1 1 1 0 0 S2WantCurse S2DoCurse S2WantScold S2DoScold [1,] 1 0 0 0 [2,] 1 1 1 0 [3,] 1 1 1 0 > > all.equal(med, mn) [1] TRUE > all.equal(mod, mn) [1] TRUE > > options(digits = o$digits) > > > > cleanEx() > nameEx("print.itemresp") > ### * print.itemresp > > flush(stderr()); flush(stdout()) > > ### Name: print.itemresp > ### Title: Formatting Item Response Data > ### Aliases: print.itemresp format.itemresp > ### Keywords: classes > > ### ** Examples > > ## item responses from binary matrix > x <- cbind(c(1, 0, 1, 0), c(1, 0, 0, 0), c(0, 1, 1, 1)) > xi <- itemresp(x) > ## change mscale > mscale(xi) <- c("-", "+") > xi [1] {+,+,-} {-,-,+} {+,-,+} {-,-,+} > > ## flexible formatting > ## no/other brackets > print(xi, brackets = FALSE) [1] +,+,- -,-,+ +,-,+ -,-,+ > print(xi, brackets = c(">>", "<<")) [1] >>+,+,-<< >>-,-,+<< >>+,-,+<< >>-,-,+<< > > ## include item labels (with different separators) > print(xi, labels = TRUE) [1] {item1:+,item2:+,item3:-} {item1:-,item2:-,item3:+} [3] {item1:+,item2:-,item3:+} {item1:-,item2:-,item3:+} > print(xi, labels = TRUE, sep = c(" | ", ": ")) [1] {item1: + | item2: + | item3: -} {item1: - | item2: - | item3: +} [3] {item1: + | item2: - | item3: +} {item1: - | item2: - | item3: +} > > ## handling longer mscale categories > mscale(xi) <- c("disagree", "agree") > print(xi) [1] {agre,agre,dsgr} {dsgr,dsgr,agre} {agre,dsgr,agre} {dsgr,dsgr,agre} > print(xi, mscale = FALSE) [1] {1,1,0} {0,0,1} {1,0,1} {0,0,1} > print(xi, abbreviate = FALSE) [1] {agree,agree,disagree} {disagree,disagree,agree} [3] {agree,disagree,agree} {disagree,disagree,agree} > print(xi, abbreviate = FALSE, width = 23) [1] {agree,agree,disagree} {disagree,disagree,...} {agree,disagree,agree} [4] {disagree,disagree,...} > print(xi, abbreviate = 2) [1] {ag,ag,ds} {ds,ds,ag} {ag,ds,ag} {ds,ds,ag} > > > > cleanEx() > nameEx("print.paircomp") > ### * print.paircomp > > flush(stderr()); flush(stdout()) > > ### Name: print.paircomp > ### Title: Formatting Paired Comparison Data > ### Aliases: print.paircomp format.paircomp > ### Keywords: classes > > ### ** Examples > > pc2 <- paircomp(rbind( + c(4, 1, 0), + c(1, 2, -1), + c(1, -2, -1), + c(0, 0, -3)), + labels = c("New York", "Rio", "Tokyo")) > > print(pc2) [1] {NwYr 4> Rio, NwYr > Toky, Rio = Toky} [2] {NwYr > Rio, NwYr 2> Toky, Rio < Toky} [3] {NwYr > Rio, NwYr 2< Toky, Rio < Toky} [4] {NwYr = Rio, NwYr = Toky, Rio 3< Toky} > print(pc2, abbreviate = FALSE) [1] {New York 4> Rio, New York > Tokyo, Rio = Tokyo} [2] {New York > Rio, New York 2> Tokyo, Rio < Tokyo} [3] {New York > Rio, New York 2< Tokyo, Rio < Tokyo} [4] {New York = Rio, New York = Tokyo, Rio 3< Tokyo} > print(pc2, abbreviate = FALSE, width = 10) [1] {New Y...} {New Y...} {New Y...} {New Y...} > > > > cleanEx() > nameEx("profileplot") > ### * profileplot > > flush(stderr()); flush(stdout()) > > ### Name: profileplot > ### Title: Profile Plots for IRT Models > ### Aliases: profileplot > ### Keywords: aplot > > ### ** Examples > > ## load verbal aggression data > data("VerbalAggression", package = "psychotools") > > ## fit Rasch, rating scale and partial credit model to verbal aggression data > rmmod <- raschmodel(VerbalAggression$resp2) > rsmod <- rsmodel(VerbalAggression$resp) > pcmod <- pcmodel(VerbalAggression$resp) > > ## profile plots of the item parameters of the three fitted IRT models > plot(rmmod, type = "profile", what = "items", col = 4) > plot(rsmod, type = "profile", what = "items", col = 2, add = TRUE) > plot(pcmod, type = "profile", what = "items", col = 3, add = TRUE) > legend(x = "topleft", legend = c("RM", "RSM", "PCM"), col = 1, + bg = c(4, 2, 3), pch = 21, bty = "n") > > ## profile plots of the threshold parameters of type "mode" > plot(rmmod, type = "profile", what = "thresholds", parg = list(type = "mode")) > plot(rsmod, type = "profile", what = "thresholds", parg = list(type = "mode")) > plot(pcmod, type = "profile", what = "thresholds", parg = list(type = "mode")) > > ## profile plot of the discrimination parameters of the dichotomous RM > plot(rmmod, type = "profile", what = "discrimination") > > > > > cleanEx() > nameEx("raschmodel") > ### * raschmodel > > flush(stderr()); flush(stdout()) > > ### Name: raschmodel > ### Title: Rasch Model Fitting Function > ### Aliases: raschmodel RaschModel.fit print.raschmodel summary.raschmodel > ### print.summary.raschmodel coef.raschmodel bread.raschmodel > ### estfun.raschmodel logLik.raschmodel vcov.raschmodel > ### Keywords: regression > > ### ** Examples > > o <- options(digits = 4) > > ## Verbal aggression data > data("VerbalAggression", package = "psychotools") > > ## Rasch model for the other-to-blame situations > m <- raschmodel(VerbalAggression$resp2[, 1:12]) > ## IGNORE_RDIFF_BEGIN > summary(m) Rasch model Difficulty parameters: Estimate Std. Error z value Pr(>|z|) S1DoCurse -1.56e-08 2.04e-01 0.00 1.00000 S1WantScold 6.86e-01 2.00e-01 3.44 0.00059 *** S1DoScold 8.73e-01 1.99e-01 4.38 1.2e-05 *** S1WantShout 1.21e+00 2.00e-01 6.03 1.6e-09 *** S1DoShout 2.29e+00 2.13e-01 10.77 < 2e-16 *** S2WantCurse -5.39e-01 2.13e-01 -2.53 0.01152 * S2DoCurse 3.61e-01 2.01e-01 1.80 0.07200 . S2WantScold 5.34e-01 2.00e-01 2.67 0.00753 ** S2DoScold 1.36e+00 2.01e-01 6.76 1.4e-11 *** S2WantShout 1.28e+00 2.01e-01 6.39 1.6e-10 *** S2DoShout 3.07e+00 2.34e-01 13.09 < 2e-16 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Log-likelihood: -1260 (df = 11) Number of iterations in BFGS optimization: 19 > ## IGNORE_RDIFF_END > > ## visualizations > plot(m, type = "profile") > plot(m, type = "regions") > plot(m, type = "curves") > plot(m, type = "information") > plot(m, type = "piplot") > > options(digits = o$digits) > > > > cleanEx() > nameEx("regionplot") > ### * regionplot > > flush(stderr()); flush(stdout()) > > ### Name: regionplot > ### Title: Region Plots for IRT Models > ### Aliases: regionplot > ### Keywords: aplot > > ### ** Examples > > ## load verbal aggression data > data("VerbalAggression", package = "psychotools") > > ## fit a Partial credit model to the items of the first other-to-blame > ## situation: "A bus fails to stop for me" > pcm <- pcmodel(VerbalAggression$resp[, 1:6]) > > ## a region plot with modus as cutpoint and custom labels > lab <- paste(rep(c("Curse", "Scold", "Shout"), each = 2), + rep(c("Want", "Do"), 3 ), sep = "-") > plot(pcm, type = "regions", names = lab) > > ## compare the cutpoints (with ylim specified manually) > opar <- par(no.readonly = TRUE) > ylim <- c(-2, 2) > layout(matrix(1:3, ncol = 1)) > plot(pcm, type = "regions", parg = list(type = "mode"), + main = "Modus as Cutpoint", ylim = ylim) > plot(pcm, type = "regions", parg = list(type = "median"), + main = "Median as Cutpoint", ylim = ylim) > plot(pcm, type = "regions", parg = list(type = "mean"), + main = "Mean as Cutpoint", ylim = ylim) > par(opar) > > ## PCM for full verbal aggression data set > pcm_va <- pcmodel(VerbalAggression$resp) > plot(pcm_va, type = "regions") > > if(requireNamespace("mirt")) { + ## generalized partial credit model for full verbal aggression data set + gpcm_va <- gpcmodel(VerbalAggression$resp) + plot(gpcm_va, type = "regions") + } > > > > graphics::par(get("par.postscript", pos = 'CheckExEnv')) > cleanEx() > nameEx("rgpcm") > ### * rgpcm > > flush(stderr()); flush(stdout()) > > ### Name: rgpcm > ### Title: Simulate Data under a Generalized Partial Credit Model > ### Aliases: rgpcm > > ### ** Examples > > set.seed(1) > ## item responses under a GPCM (generalized partial credit model) from > ## 6 persons with three different person parameters > ## 8 items with different combinations of two or three threshold parameters > ## and corresponding discrimination parameters > ppar <- rep(-1:1, each = 2) > tpar <- rep(list(-2:0, -1:1, 0:1, 0:2), each = 2) > dpar <- rep(list(1, 2), each = 4) > sim <- rgpcm(theta = ppar, a = dpar, b = tpar) > > ## simulated item response data along with setting parameters > sim $a $a[[1]] [1] 1 $a[[2]] [1] 1 $a[[3]] [1] 1 $a[[4]] [1] 1 $a[[5]] [1] 2 $a[[6]] [1] 2 $a[[7]] [1] 2 $a[[8]] [1] 2 $b $b[[1]] [1] -2 -1 0 $b[[2]] [1] -2 -1 0 $b[[3]] [1] -1 0 1 $b[[4]] [1] -1 0 1 $b[[5]] [1] 0 1 $b[[6]] [1] 0 1 $b[[7]] [1] 0 1 2 $b[[8]] [1] 0 1 2 $theta [1] -1 -1 0 0 1 1 $data [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0 1 2 1 0 0 0 1 [2,] 1 0 1 0 0 0 1 0 [3,] 2 2 0 1 1 1 1 1 [4,] 3 3 3 2 0 1 1 0 [5,] 3 3 3 2 1 2 2 3 [6,] 3 3 2 3 2 1 3 2 > > ## print and plot corresponding item response object > iresp <- itemresp(sim$data) > iresp [1] {0,1,2,1,0,0,0,1} {1,0,1,0,0,0,1,0} {2,2,0,1,1,1,1,1} {3,3,3,2,0,1,1,0} [5] {3,3,3,2,1,2,2,3} {3,3,2,3,2,1,3,2} > plot(iresp) > > > > cleanEx() > nameEx("rpcm") > ### * rpcm > > flush(stderr()); flush(stdout()) > > ### Name: rpcm > ### Title: Simulate Data under a Partial Credit Model > ### Aliases: rpcm > > ### ** Examples > > set.seed(1) > ## item responses under a partial credit model (PCM) with > ## 6 persons with three different person parameters > ## 8 items with different combinations of two or three threshold parameters > ppar <- rep(-1:1, each = 2) > tpar <- rep(list(-2:0, -1:1, 0:1, 0:2), each = 2) > sim <- rpcm(theta = ppar, delta = tpar) > > ## simulated item response data along with setting parameters > sim $delta $delta[[1]] [1] -2 -1 0 $delta[[2]] [1] -2 -1 0 $delta[[3]] [1] -1 0 1 $delta[[4]] [1] -1 0 1 $delta[[5]] [1] 0 1 $delta[[6]] [1] 0 1 $delta[[7]] [1] 0 1 2 $delta[[8]] [1] 0 1 2 $theta [1] -1 -1 0 0 1 1 $data [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0 1 2 1 2 0 1 1 [2,] 1 0 1 0 0 0 0 0 [3,] 2 2 0 1 0 1 1 1 [4,] 3 3 3 2 0 0 2 2 [5,] 3 3 3 2 1 2 3 3 [6,] 3 3 2 3 1 1 2 1 > > ## print and plot corresponding item response object > iresp <- itemresp(sim$data) > iresp [1] {0,1,2,1,2,0,1,1} {1,0,1,0,0,0,0,0} {2,2,0,1,0,1,1,1} {3,3,3,2,0,0,2,2} [5] {3,3,3,2,1,2,3,3} {3,3,2,3,1,1,2,1} > plot(iresp) > > > > cleanEx() > nameEx("rpl") > ### * rpl > > flush(stderr()); flush(stdout()) > > ### Name: rpl > ### Title: Simulate Data under a Parametric Logistic IRT Model > ### Aliases: rpl > > ### ** Examples > > set.seed(1) > ## item responses under a 2PL (two-parameter logistic) model from > ## 6 persons with three different person parameters > ## 9 increasingly difficult items and corresponding discrimination parameters > ## no guessing (= 0) and upper asymptote 1 > ppar <- rep(c(-2, 0, 2), each = 2) > ipar <- seq(-2, 2, by = 0.5) > dpar <- rep(c(0.5, 1, 1.5), each = 3) > sim <- rpl(theta = ppar, a = dpar, b = ipar) > > ## simulated item response data along with setting parameters > sim $a [1] 0.5 0.5 0.5 1.0 1.0 1.0 1.5 1.5 1.5 $b [1] -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 $g [1] 0 0 0 0 0 0 0 0 0 $u [1] 1 1 1 1 1 1 1 1 1 $theta [1] -2 -2 0 0 2 2 $data [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 1 0 0 0 0 0 0 0 0 [2,] 1 0 0 0 0 0 0 0 0 [3,] 1 1 0 0 1 0 0 0 0 [4,] 0 1 1 1 1 1 0 0 0 [5,] 1 1 1 1 1 0 0 1 1 [6,] 0 1 0 1 1 1 1 1 1 > > ## print and plot corresponding item response object > iresp <- itemresp(sim$data) > iresp [1] {1,0,0,0,0,0,0,0,0} {1,0,0,0,0,0,0,0,0} {1,1,0,0,1,0,0,0,0} [4] {0,1,1,1,1,1,0,0,0} {1,1,1,1,1,0,0,1,1} {0,1,0,1,1,1,1,1,1} > plot(iresp) > > > > cleanEx() > nameEx("rrm") > ### * rrm > > flush(stderr()); flush(stdout()) > > ### Name: rrm > ### Title: Simulate Data under a Rasch model > ### Aliases: rrm > > ### ** Examples > > set.seed(1) > ## item responses under a Rasch model from > ## 6 persons with three different person parameters > ## 9 increasingly difficult items > ppar <- rep(-1:1, each = 2) > ipar <- seq(-2, 2, by = 0.5) > sim <- rrm(theta = ppar, beta = ipar) > > ## simulated item response data along with setting parameters > sim $beta [1] -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 $theta [1] -1 -1 0 0 1 1 $data [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 1 0 0 0 1 0 0 0 0 [2,] 1 0 1 0 0 0 1 0 0 [3,] 1 1 0 0 1 0 0 0 0 [4,] 0 1 1 1 1 1 0 0 0 [5,] 1 1 1 1 0 0 0 1 0 [6,] 1 1 0 1 1 0 0 0 1 > > ## print and plot corresponding item response object > iresp <- itemresp(sim$data) > iresp [1] {1,0,0,0,1,0,0,0,0} {1,0,1,0,0,0,1,0,0} {1,1,0,0,1,0,0,0,0} [4] {0,1,1,1,1,1,0,0,0} {1,1,1,1,0,0,0,1,0} {1,1,0,1,1,0,0,0,1} > plot(iresp) > > > > cleanEx() > nameEx("rrsm") > ### * rrsm > > flush(stderr()); flush(stdout()) > > ### Name: rrsm > ### Title: Simulate Data under a Rating Scale Model > ### Aliases: rrsm > > ### ** Examples > > set.seed(1) > ## item responses under a rating scale model (RSM) with > ## 6 persons with three different person parameters > ## 9 increasingly difficult items > ## 3 different threshold parameters > ppar <- rep(-1:1, each = 2) > ipar <- seq(-2, 2, by = 0.5) > tpar <- 0:2 > sim <- rrsm(theta = ppar, beta = ipar, tau = tpar) > > ## simulated item response data along with setting parameters > sim $beta [1] -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 $tau [1] 0 1 2 $theta [1] -1 -1 0 0 1 1 $data [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 0 0 1 2 2 0 0 2 0 [2,] 1 1 0 1 0 0 1 0 0 [3,] 2 3 3 3 1 1 0 0 0 [4,] 3 2 2 0 0 2 2 1 2 [5,] 3 3 2 2 3 3 3 3 1 [6,] 3 3 3 1 2 1 0 0 3 > > ## print and plot corresponding item response object > iresp <- itemresp(sim$data) > iresp [1] {0,0,1,2,2,0,0,2,0} {1,1,0,1,0,0,1,0,0} {2,3,3,3,1,1,0,0,0} [4] {3,2,2,0,0,2,2,1,2} {3,3,2,2,3,3,3,3,1} {3,3,3,1,2,1,0,0,3} > plot(iresp) > > > > cleanEx() > nameEx("rsmodel") > ### * rsmodel > > flush(stderr()); flush(stdout()) > > ### Name: rsmodel > ### Title: Rating Scale Model Fitting Function > ### Aliases: rsmodel RSModel.fit print.rsmodel summary.rsmodel > ### print.summary.rsmodel coef.rsmodel bread.rsmodel estfun.rsmodel > ### logLik.rsmodel vcov.rsmodel > ### Keywords: regression > > ### ** Examples > > o <- options(digits = 4) > > ## Verbal aggression data > data("VerbalAggression", package = "psychotools") > > ## Rating scale model for the other-to-blame situations > rsm <- rsmodel(VerbalAggression$resp[, 1:12]) > summary(rsm) Rating scale model Item location and threshold parameters: Estimate Std. Error z value Pr(>|z|) S1DoCurse 0.0899 0.1177 0.76 0.44467 S1WantScold 0.4205 0.1181 3.56 0.00037 *** S1DoScold 0.6379 0.1194 5.34 9.1e-08 *** S1WantShout 0.9161 0.1220 7.51 6.0e-14 *** S1DoShout 1.5657 0.1330 11.77 < 2e-16 *** S2WantCurse -0.2182 0.1189 -1.84 0.06636 . S2DoCurse 0.2619 0.1177 2.23 0.02606 * S2WantScold 0.3582 0.1179 3.04 0.00238 ** S2DoScold 0.9849 0.1228 8.02 1.1e-15 *** S2WantShout 0.8635 0.1214 7.11 1.1e-12 *** S2DoShout 2.0598 0.1466 14.05 < 2e-16 *** C2 0.5024 0.0850 5.91 3.4e-09 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Log-likelihood: -2480 (df = 12) Number of iterations in BFGS optimization: 19 > > ## visualizations > plot(rsm, type = "profile") > plot(rsm, type = "regions") > plot(rsm, type = "curves") > plot(rsm, type = "information") > plot(rsm, type = "piplot") > > options(digits = o$digits) > > > > cleanEx() > nameEx("subset.itemresp") > ### * subset.itemresp > > flush(stderr()); flush(stdout()) > > ### Name: subset.itemresp > ### Title: Subsetting Item Response Data > ### Aliases: subset.itemresp merge.itemresp c.itemresp [.itemresp > ### Keywords: classes > > ### ** Examples > > ## binary responses to three items, coded as matrix > x <- cbind(c(1, 0, 1, 0), c(1, 0, 0, 0), c(0, 1, 1, 1)) > xi <- itemresp(x) > > ## subsetting/indexing > xi[2] [1] {0,0,1} > xi[-(3:4)] [1] {1,1,0} {0,0,1} > xi[c(TRUE, TRUE, FALSE, FALSE)] [1] {1,1,0} {0,0,1} > subset(xi, items = 1:2) # or xi[, 1:2] [1] {1,1} {0,0} {1,0} {0,0} > subset(xi, items = -2, subjects = 2:3) [1] {0,1} {1,1} > > ## combine two itemresp vectors for different subjects but the same items > xi12 <- xi[1:2] > xi34 <- xi[3:4] > c(xi12, xi34) [1] {1,1,0} {0,0,1} {1,0,1} {0,0,1} > > ## combine two itemresp vectors for the same subjects but different items > ## polytomous responses in a data frame > d <- data.frame(q1 = c(-2, 1, -1, 0), q2 = factor(c(1, 3, 1, 3), + levels = 1:3, labels = c("disagree", "neutral", "agree"))) > di <-itemresp(d) > merge(xi, di) 1 2 3 4 {1,1,0,-2,dsgr} {0,0,1,1,agre} {1,0,1,-1,dsgr} {0,0,1,0,agre} > > ## if subjects have names/IDs, these are used for merging > names(xi) <- c("John", "Joan", "Jen", "Jim") > names(di) <- c("Joan", "Jen", "Jim", "Jo") > merge(xi, di) Joan Jen Jim {0,0,1,-2,dsgr} {1,0,1,1,agre} {0,0,1,-1,dsgr} > merge(xi, di, all = TRUE) John Joan Jen Jim {1,1,0,NA,NA} {0,0,1,-2,dsgr} {1,0,1,1,agre} {0,0,1,-1,dsgr} Jo {NA,NA,NA,0,agre} > > > > cleanEx() > nameEx("subset.paircomp") > ### * subset.paircomp > > flush(stderr()); flush(stdout()) > > ### Name: subset.paircomp > ### Title: Subsetting/Reordering Paired Comparison Data > ### Aliases: subset.paircomp reorder.paircomp > ### Keywords: classes > > ### ** Examples > > pc <- paircomp(rbind( + c(1, 1, 1), # a > b, a > c, b > c + c(1, 1, -1), # a > b, a > c, b < c + c(1, -1, -1), # a > b, a < c, b < c + c(1, 1, 1))) > reorder(pc, c("c", "a")) [1] {c < a} {c < a} {c > a} {c < a} > > > > cleanEx() > nameEx("summary.itemresp") > ### * summary.itemresp > > flush(stderr()); flush(stdout()) > > ### Name: summary.itemresp > ### Title: Summarizing and Visualizing Item Response Data > ### Aliases: summary.itemresp plot.itemresp > ### Keywords: classes > > ### ** Examples > > ## summary/visualization for verbal aggression data > data("VerbalAggression", package = "psychotools") > r <- itemresp(VerbalAggression$resp[, 1:6]) > mscale(r) <- c("no", "perhaps", "yes") > summary(r) no perhaps yes S1WantCurse 91 95 130 S1DoCurse 91 108 117 S1WantScold 126 86 104 S1DoScold 136 97 83 S1WantShout 154 99 63 S1DoShout 208 68 40 > plot(r) > > ## modify formatting of mscale > summary(r, abbreviate = 1) n p y S1WantCurse 91 95 130 S1DoCurse 91 108 117 S1WantScold 126 86 104 S1DoScold 136 97 83 S1WantShout 154 99 63 S1DoShout 208 68 40 > summary(r, mscale = FALSE) 0 1 2 S1WantCurse 91 95 130 S1DoCurse 91 108 117 S1WantScold 126 86 104 S1DoScold 136 97 83 S1WantShout 154 99 63 S1DoShout 208 68 40 > > ## illustration for varying mscale across items > ## merge with additional random binary response > b <- itemresp(rep(c(-1, 1), length.out = length(r)), + mscale = c(-1, 1), labels = "Dummy") > rb <- merge(r[, 1:2], b) > head(rb, 2) [1] {no,prh,-1} {no,no,1} > ## summary has NAs for non-existent response categories > summary(rb) 0 1 2 S1WantCurse (no,perhaps,yes) 91 95 130 S1DoCurse (no,perhaps,yes) 91 108 117 Dummy (-1,1) 158 158 NA > summary(rb, mscale = FALSE) 0 1 2 S1WantCurse 91 95 130 S1DoCurse 91 108 117 Dummy 158 158 NA > plot(rb, srt = 25) > plot(rb, mscale = FALSE) > > > > cleanEx() > nameEx("threshpar") > ### * threshpar > > flush(stderr()); flush(stdout()) > > ### Name: threshpar > ### Title: Extract Threshold Parameters of Item Response Models > ### Aliases: threshpar threshpar.raschmodel threshpar.rsmodel > ### threshpar.pcmodel threshpar.plmodel threshpar.gpcmodel coef.threshpar > ### print.threshpar > ### Keywords: classes > > ### ** Examples > > o <- options(digits = 4) > > ## load verbal aggression data > data("VerbalAggression", package = "psychotools") > > ## fit a rasch model to dichotomized verbal aggression data > raschmod <- raschmodel(VerbalAggression$resp2) > > ## extract threshold parameters with sum zero restriction > tr <- threshpar(raschmod) > tr Item response threshold parameters (RM, type mode): S1WantCurse-C1 S1DoCurse-C1 S1WantScold-C1 S1DoScold-C1 S1WantShout-C1 -1.3834 -1.3834 -0.7307 -0.5566 -0.2491 S1DoShout-C1 S2WantCurse-C1 S2DoCurse-C1 S2WantScold-C1 S2DoScold-C1 0.6981 -1.9093 -1.0367 -0.8727 -0.1131 S2WantShout-C1 S2DoShout-C1 S3WantCurse-C1 S3DoCurse-C1 S3WantScold-C1 -0.1810 1.3120 -0.6955 0.0403 0.5136 S3DoScold-C1 S3WantShout-C1 S3DoShout-C1 S4WantCurse-C1 S4DoCurse-C1 1.3348 1.3577 2.8709 -1.2450 -0.8727 S4WantScold-C1 S4DoScold-C1 S4WantShout-C1 S4DoShout-C1 0.1779 0.2126 0.8711 1.8402 > > ## compare to item parameters (again with sum zero restriction) > ip <- itempar(raschmod) > ip Item response item parameters (RM): S1WantCurse S1DoCurse S1WantScold S1DoScold S1WantShout S1DoShout -1.3834 -1.3834 -0.7307 -0.5566 -0.2491 0.6981 S2WantCurse S2DoCurse S2WantScold S2DoScold S2WantShout S2DoShout -1.9093 -1.0367 -0.8727 -0.1131 -0.1810 1.3120 S3WantCurse S3DoCurse S3WantScold S3DoScold S3WantShout S3DoShout -0.6955 0.0403 0.5136 1.3348 1.3577 2.8709 S4WantCurse S4DoCurse S4WantScold S4DoScold S4WantShout S4DoShout -1.2450 -0.8727 0.1779 0.2126 0.8711 1.8402 > > all.equal(coef(tr), coef(ip)) [1] "Names: 24 string mismatches" > > ## rating scale model example > rsmod <- rsmodel(VerbalAggression$resp) > trmod <- threshpar(rsmod, type = "mode") > trmed <- threshpar(rsmod, type = "median") > trmn <- threshpar(rsmod, type = "mean") > > ## compare different types of threshold parameters > cbind("Mode" = coef(trmod, type = "vector"), + "Median" = coef(trmod, type = "vector"), + "Mean" = coef(trmn, type = "vector")) Mode Median Mean S1WantCurse-C1 -1.36551 -1.36551 -0.63583 S1WantCurse-C2 -0.78469 -0.78469 1.21667 S1DoCurse-C1 -1.27784 -1.27784 -0.54819 S1DoCurse-C2 -0.69702 -0.69702 1.30434 S1WantScold-C1 -0.95781 -0.95781 -0.22816 S1WantScold-C2 -0.37699 -0.37699 1.62440 S1DoScold-C1 -0.74918 -0.74918 -0.01953 S1DoScold-C2 -0.16836 -0.16836 1.83301 S1WantShout-C1 -0.48394 -0.48394 0.24574 S1WantShout-C2 0.09688 0.09688 2.09825 S1DoShout-C1 0.13116 0.13116 0.86081 S1DoShout-C2 0.71198 0.71198 2.71335 S2WantCurse-C1 -1.57926 -1.57926 -0.84961 S2WantCurse-C2 -0.99845 -0.99845 1.00292 S2DoCurse-C1 -1.11091 -1.11091 -0.38126 S2DoCurse-C2 -0.53009 -0.53009 1.47126 S2WantScold-C1 -1.01776 -1.01776 -0.28811 S2WantScold-C2 -0.43694 -0.43694 1.56439 S2DoScold-C1 -0.41863 -0.41863 0.31102 S2DoScold-C2 0.16219 0.16219 2.16355 S2WantShout-C1 -0.53396 -0.53396 0.19567 S2WantShout-C2 0.04686 0.04686 2.04823 S2DoShout-C1 0.59875 0.59875 1.32841 S2DoShout-C2 1.17957 1.17957 3.18094 S3WantCurse-C1 -0.70132 -0.70132 0.02833 S3WantCurse-C2 -0.12050 -0.12050 1.88086 S3DoCurse-C1 -0.15887 -0.15887 0.57078 S3DoCurse-C2 0.42194 0.42194 2.42328 S3WantScold-C1 0.14953 0.14953 0.87919 S3WantScold-C2 0.73035 0.73035 2.73172 S3DoScold-C1 0.72406 0.72406 1.45372 S3DoScold-C2 1.30488 1.30488 3.30625 S3WantShout-C1 0.77736 0.77736 1.50703 S3WantShout-C2 1.35818 1.35818 3.35956 S3DoShout-C1 1.93477 1.93477 2.66442 S3DoShout-C2 2.51559 2.51559 4.51694 S4WantCurse-C1 -1.05771 -1.05771 -0.32806 S4WantCurse-C2 -0.47689 -0.47689 1.52445 S4DoCurse-C1 -0.85739 -0.85739 -0.12774 S4DoCurse-C2 -0.27657 -0.27657 1.72479 S4WantScold-C1 -0.19072 -0.19072 0.53893 S4WantScold-C2 0.39009 0.39009 2.39144 S4DoScold-C1 -0.13472 -0.13472 0.59493 S4DoScold-C2 0.44610 0.44610 2.44750 S4WantShout-C1 0.26366 0.26366 0.99331 S4WantShout-C2 0.84448 0.84448 2.84584 S4DoShout-C1 1.04642 1.04642 1.77607 S4DoShout-C2 1.62724 1.62724 3.62860 > > if(requireNamespace("mirt")) { + ## fit a partial credit model and a generalized partial credit model + pcmod <- pcmodel(VerbalAggression$resp) + gpcmod <- gpcmodel(VerbalAggression$resp) + + ## extract the threshold parameters with different default restrictions and + ## therefore incompareable scales + tp <- threshpar(pcmod) + tg <- threshpar(gpcmod) + plot(unlist(tp), unlist(tg), xlab = "PCM", ylab = "GPCM") + abline(a = 0, b = 1) + + ## extract the threshold parameters with the first as the reference leading + ## to a compareable scale visualizing the differences due to different + ## discrimination parameters + tp <- threshpar(pcmod, ref = 1) + tg <- threshpar(gpcmod, ref = 1) + plot(unlist(tp), unlist(tg), xlab = "PCM", ylab = "GPCM") + abline(a = 0, b = 1) + + options(digits = o$digits) + } > > > > cleanEx() > nameEx("upperpar") > ### * upperpar > > flush(stderr()); flush(stdout()) > > ### Name: upperpar > ### Title: Extract Upper Asymptote Parameters of Item Response Models > ### Aliases: upperpar upperpar.raschmodel upperpar.rsmodel upperpar.pcmodel > ### upperpar.plmodel upperpar.gpcmodel coef.upperpar print.upperpar > ### vcov.upperpar > ### Keywords: classes > > ### ** Examples > > if(requireNamespace("mirt")) { + + o <- options(digits = 3) + + ## load simulated data + data("Sim3PL", package = "psychotools") + + ## fit 2PL to data simulated under the 3PLu + twoplmod <- plmodel(Sim3PL$resp2) + + ## extract the upper asymptote parameters (all fixed at 1) + up1 <- upperpar(twoplmod) + + ## fit 3PLu to data simulated under the 3PLu + threeplmodu <- plmodel(Sim3PL$resp2, type = "3PLu") + + ## extract the upper asymptote parameters + up2 <- upperpar(threeplmodu) + + ## extract the standard errors + sqrt(diag(vcov(up2))) + + ## extract the upper asymptote parameters on the logit scale + up2_logit <- upperpar(threeplmodu, logit = TRUE) + + ## along with the delta transformed standard errors + sqrt(diag(vcov(up2_logit))) + + options(digits = o$digits) + } > > > > cleanEx() > nameEx("worth") > ### * worth > > flush(stderr()); flush(stdout()) > > ### Name: worth > ### Title: Extract Worth Parameters > ### Aliases: worth > ### Keywords: classes > > ### ** Examples > > o <- options(digits = 4) > > ## data > data("GermanParties2009", package = "psychotools") > > ## Bradley-Terry model > bt <- btmodel(GermanParties2009$preference) > > ## worth parameters > worth(bt) Bradley-Terry model parameters (btmodel): none Linke Gruene SPD CDU/CSU FDP 0.0768 0.0604 0.3658 0.2520 0.1332 0.1118 > > ## or > itempar(bt) Bradley-Terry model parameters (btmodel): none Linke Gruene SPD CDU/CSU FDP 0.0768 0.0604 0.3658 0.2520 0.1332 0.1118 > > options(digits = o$digits) > > > > ### *