\name{wrongMap} \alias{wrongMap} %- Also NEED an '\alias' for EACH other topic documented here. \title{A Person--Item map made without IRT scaling.} } \description{ This is a version of the person--item map (\cite{\link{plotPImap}}, also known as a Wright Map, that does not require scaling. Instead, it assumes that the abilities of the people in the sample are roughly normally distributed. It is meant for exploratory item analysis when the sample size is small. } \usage{ wrongMap(x, item.subset = 1:ncol(x), scores = rowSums(x), itemLabs = NULL, abilLab = "Ability", cex.gen = 0.7, xrange = NULL, prop = 0.04, histOpt = list(col = "red"), itemPch = 19, itemCol = "black", statePch = 1, stateCol = "black", ...) } \arguments{ \item{x}{A numeric matrix with columns represneting items and rows persons. The values should be the scores, so that \code{rowSums(x)} gives the scores for each person taking the assessment. } \item{item.subset}{An expression which determins a subset of the columns of \code{x} that should be plotted.} \item{scores}{A vector of scores with length of \code{nrow(x)}.} \item{itemLabs}{A vector of labels for the items. If not supplied, the column names of \code{x} will be used. If \code{x} does not have column names, then names will be generated of the form \code{Q}\eqn{k}, where \eqn{k} is the column number.} \item{abilLab}{A character scalar giving the label for the ability.} \item{cex.gen}{A character expansion value (see \code{cex} in \code{\link[graphics[par]}) for the plotting characters.} \item{xrange}{The range of the \eqn{x}-axis. If not supplied, data dependent values will be calculated.} \item{prop}{A number between 0 and 1 giving the extent to which the plotting boundaries of the region will be expanded beyond the observed data if \code{xrange is not supplied}.} \item{histOpt}{A list of options passed to \code{\link[graphics]{hist}}.} \item{itemPch}{The plotting symbol (see \code{pch} in \code{\link[graphics]{par}}) used for ploting items.} \item{itemCol}{The plotting colour (see \code{col} in \code{\link[graphics]{par}}) used for ploting items.} \item{statePch}{The plotting symbol (see \code{pch} in \code{\link[graphics]{par}}) used for ploting item states.} \item{stateCol}{The plotting colour (see \code{col} in \code{\link[graphics]{par}}) used for ploting item states.} \item{\dots}{Other arguments passed to \code{\link[graphics]{dotplot}}.} } \details{ %% ~~ If necessary, more details than the description above ~~ } \value{ %% ~Describe the value returned %% If it is a LIST, use %% \item{comp1 }{Description of 'comp1'} %% \item{comp2 }{Description of 'comp2'} %% ... } \references{ %% ~put references to the literature/web site here ~ } \author{ %% ~~who you are~~ } \note{ %% ~~further notes~~ } %% ~Make other sections like Warning with \section{Warning }{....} ~ \seealso{ %% ~~objects to See Also as \code{\link{help}}, ~~~ } \examples{ ##---- Should be DIRECTLY executable !! ---- ##-- ==> Define data, use random, ##-- or do help(data=index) for the standard data sets. ## The function is currently defined as function (x, item.subset = 1:ncol(x), scores = rowSums(x), itemLabs = NULL, abilLab = "Ability", cex.gen = 0.7, xrange = NULL, prop = 0.04, histOpt = list(col = "red"), itemPch = 19, itemCol = "black", statePch = 1, stateCol = "black", ygrid = 5, xgrid = 0.5, ...) { if (is.null(itemLabs)) { if (is.null(colnames(x))) { itemLabs <- paste("Q", item.subset) } else { itemLabs <- colnames(x)[item.subset] } } z <- (scores - mean(scores))/sd(scores) J <- length(item.subset) diffs <- vector("list", J) Snames <- vector("list", J) Idiffs <- rep(NA, J) Nstates <- rep(NA, J) names(diffs) <- itemLabs names(Idiffs) <- itemLabs for (item in item.subset) { tab <- cumsum(rev(table(as.ordered(x[, item])))) ms <- max(tab) qtab <- qnorm((ms - tab)/ms) diffs[[item]] <- qtab[is.finite(qtab)] Snames[[item]] <- names(qtab)[is.finite(qtab)] Nstates[item] <- sum(is.finite(qtab)) Idiffs[item] <- qnorm(1 - mean(x[, item], na.rm = TRUE)/max(x[, item], na.rm = TRUE)) } alldiffs <- do.call("c", diffs) allitems <- rep(1:J, Nstates) allnames <- do.call("c", Snames) Items <- (1:J)[is.finite(Idiffs)] Idiffs <- Idiffs[is.finite(Idiffs)] diff.frame <- data.frame(Difficulty = c(Idiffs, alldiffs), number = J - c(Items, allitems), Item = itemLabs[c(Items, allitems)], pch = rep(c(itemPch, statePch), c(length(Items), length(allitems))), col = rep(c(itemCol, stateCol), c(length(Items), length(allitems)))) head(diff.frame) if (is.null(xrange)) { xrange <- range(c(z, alldiffs, Idiffs), na.rm = TRUE) } print(do.call("histogram", c(list(x = z, endpoints = xrange, xlab = abilLab, xlim = xrange * (1 + prop)), histOpt)), position = c(0, 0.68, 1, 1), more = TRUE, newpage = TRUE) xy <- dotplot(Item ~ Difficulty, diff.frame, pch = diff.frame$pch, col = diff.frame$col, xlim = xrange * (1 + prop), ...) print(xy, position = c(0, 0, 1, 0.7)) } } % Add one or more standard keywords, see file 'KEYWORDS' in the % R documentation directory. \keyword{ ~kwd1 }% use one of RShowDoc("KEYWORDS") \keyword{ ~kwd2 }% __ONLY ONE__ keyword per line