PPass: Person assessment: estimates and person fit in one step

View source: R/ppass.R

PPassR Documentation

Person assessment: estimates and person fit in one step

Description

PPass (Person Parameter assessment) estimates the person parameters and computes the person fit in one call, and returns both in one table, next to the other person variables. It takes a data.frame or matrix with item responses and known item parameters, or a model fitted with the eRm package.

Usage

PPass(...)

## Default S3 method:
PPass(
  respdf,
  items = "all",
  fitindices = c("lz", "lzstar", "infit", "outfit"),
  SE = FALSE,
  ...
)

## S3 method for class 'eRm'
PPass(
  RMobj,
  fitindices = c("lz", "lzstar", "infit", "outfit"),
  SE = FALSE,
  ...
)

## S3 method for class 'ppass'
print(x, n = 10, digits = 3, ...)

## S3 method for class 'ppass'
summary(object, alpha = 0.05, digits = 3, ...)

## S3 method for class 'ppass'
as.data.frame(x, row.names = NULL, optional = FALSE, ...)

Arguments

respdf

A data.frame or matrix with one row per person, which contains the item responses and possibly other person variables.

items

The item columns of respdf: "all" (default), their positions or their names.

fitindices

The person fit indices to compute, any of "lz", "lzstar", "infit" and "outfit" (default all).

SE

If TRUE, jackknife standard errors of the fit indices are added (see Pfit()).

RMobj

A model fitted with the eRm package (RM(), LLTM(), RSM(), PCM(), LRSM() or LPCM()).

x, object

A result of PPass().

n

Number of persons to print.

digits

Number of significant digits to print.

alpha

Significance level for flagging persons: |z| > z_{1-\alpha/2} for lz*, lz, in_t or ou_t (the first one computed).

row.names, optional

Ignored.

...

Arguments for the estimation: the item parameters (PPass.default only) and type, mu, sigma2, theta_start, range, maxsteps, exac, H and verbose, see PP_4pl(), PP_gpcm() and PPall(). The default estimate is WLE.

Details

Data with item parameters (PPass.default): the columns items of respdf are the responses, the other columns are kept as person variables. The item parameters are passed in ... (thres, slopes, lowerA, upperA), and the model follows from them: thres alone gives the 1PL model, with slopes the 2PL, with lowerA the 3PL and with upperA the 4PL model, estimated with PP_4pl(). A threshold matrix with more than one threshold for some item gives the partial credit model (all slopes 1) or the generalized partial credit model, estimated with PP_gpcm(). With such polytomous items and lowerA or upperA, the test is a mixed test (items with one threshold are 4PL items), estimated with PPall(). The arguments mod and model2est of earlier versions are no longer needed; they are ignored with a warning.

eRm models (PPass.eRm): all models of the eRm package are supported, the Rasch model (RM), the linear logistic test model (LLTM), the rating scale model (RSM), the partial credit model (PCM) and the linear models LRSM and LPCM, also with several time points (mpoints) and groups (groupvec). The responses and item parameters come from the fitted object. eRm stores easiness parameters per category, \beta_{ih} = -\sum_{k \le h} \delta_{ik}; they are turned into the thresholds \delta_{ih} = \beta_{i,h-1} - \beta_{ih}, so for the dichotomous models the difficulty is -\beta_i. With time points or groups every combination of item, time point and group is a virtual item with its own parameters; a person answers the virtual items of their group, and gets one ability over all time points. The person parameters are estimated with PP_4pl() (RM, LLTM) or PP_gpcm() with all slopes 1. The maximum likelihood estimates (type = "mle") equal those of eRm::person.parameter(); unlike eRm, PPass also gives estimates for models with group contrasts, and WLE, MAP, EAP and robust estimates, person fit, jackknife and plausible values. The eRm package is not needed to run PPass on such an object.

Person fit is computed by Pfit() and needs an estimate of type "mle", "wle" or "map". For type = "eap" and "robust" PPass returns the estimates only, with a message.

Value

A data.frame of class ppass with one row per person: the person variables (the columns of respdf that are not items; for eRm models with groups the column group), estimate, SE and status of the estimate (see PP_4pl()) and the columns of the chosen person fit indices (see Pfit()). It can be used like any data.frame. The estimation object is kept as attribute, so JKpp() and PV() can be applied to the result directly; print() and summary() show an overview with the persons flagged by the person fit, plot() draws the person fit map, the measurement precision or person profiles (see pp-plots), and as.data.frame() returns a plain data.frame.

Author(s)

Manuel Reif, Jan Steinfeld

See Also

PP_4pl, PP_gpcm, PPall, Pfit, JKpp, PV, pp-plots

Examples

## data with item parameters

set.seed(1337)
# difficulties and slopes of 15 items
diffpar <- seq(-3, 3, length = 15)
sl <- round(runif(15, 0.5, 1.5), 2)
# responses of 200 persons, plus an id and a group variable
awm <- sim_4pl(beta = diffpar, alpha = sl, lowerA = rep(0, 15), upperA = rep(1, 15),
               theta = rnorm(200))
dat <- data.frame(id = 1:200, group = rep(c("a", "b"), 100), awm)

# 2PL, WLE estimates and all person fit indices; id and group are kept
res <- PPass(dat, items = 3:17, thres = diffpar, slopes = sl)
res
summary(res)

# person fit map, flagged persons labelled with their id
plot(res, label = "id")

# a plain data.frame for further use
head(as.data.frame(res))

# jackknife directly from the result
jk <- JKpp(res)


## real data (adaptive test, 1PL)

data(pp_amt)
d <- pp_amt$daten_amt
rd_res <- PPass(d, items = 8:ncol(d), thres = pp_amt$betas[, 2], fitindices = "lz")
head(rd_res)


## models fitted with eRm

if (requireNamespace("eRm", quietly = TRUE)) {

  # Rasch model
  my_rm <- eRm::RM(eRm::raschdat1)
  res_rm <- PPass(my_rm)
  summary(res_rm)

  # the maximum likelihood estimates equal eRm::person.parameter()
  res_mle <- PPass(my_rm, type = "mle", fitindices = "lzstar")

  # partial credit model
  set.seed(2751)
  thres <- rbind(0, matrix(c(-2, -1, 0.5, -1.2, 0.3, NA, -0.5, 1, NA, 0, 1.5, 2), 3))
  simdat <- sim_gpcm(thres = thres, alpha = rep(1, 4), theta = rnorm(300))
  res_pcm <- PPass(eRm::PCM(simdat))

  # linear partial credit model with two time points and two groups
  simdat2 <- sim_gpcm(thres = thres, alpha = rep(1, 4), theta = rnorm(300, 0.5))
  my_lpcm <- eRm::LPCM(cbind(simdat, simdat2), mpoints = 2, groupvec = rep(1:2, 150))
  res_lpcm <- PPass(my_lpcm)
  head(res_lpcm)

  # plausible values need an EAP or MAP estimate
  pv <- PV(PPass(my_rm, type = "map"))
}

PP documentation built on Oct. 15, 2026, 1:06 a.m.