PV: Draw Plausible values

View source: R/pv.R

print.pvR Documentation

Draw Plausible values

Description

This function draws npv plausible values for each person from their posterior density.

Usage

## S3 method for class 'pv'
print(x, digits = 4, ...)

## S3 method for class 'pv'
summary(object, nrowmax = 15, digits = 4, ...)

## S3 method for class 'ppass'
PV(estobj, ...)

PV(estobj, ...)

## S3 method for class 'ppeo'
PV(estobj, npv = 10, approx = TRUE, ...)

Arguments

x, object

An object of class pv, the result of PV().

digits

Number of significant digits to print.

...

Not used. thinning, burnin and mult of version 0.6.4 give a warning and are ignored.

nrowmax

summary(): how many persons to show. Default = 15.

estobj

An object which originates from using PP_4pl(), PP_gpcm() or PPall() with type = "eap" or type = "map".

npv

The number of plausible values per person - default is 10.

approx

If TRUE (default), the plausible values are drawn from a normal approximation of the posterior. If FALSE, they are drawn from the posterior itself.

Details

Plausible values need a prior, so estobj must come from an estimation with type = "eap" or type = "map". The posterior of each person combines the likelihood of the answered items with the normal prior N(mu, sigma2) of the person, as given to PP_4pl(), PP_gpcm() or PPall() (default N(0, 1)). It is computed on a grid of ability values, the same as for type = "eap": one grid for all persons, and a finer grid around the posterior mode for persons whose posterior is very narrow or lies outside the range of the prior. Both types give the same plausible values, since they share the posterior; the point estimate itself is not used. MLE, WLE and robust estimates have no prior, and PV() stops with an error for them. Missing responses are skipped; a person without any response gets draws from the prior.

With approx = FALSE each value is drawn from the posterior on the grid: a grid point is chosen with its posterior probability, then the value is drawn uniformly within its cell. The draws are independent. With approx = TRUE (default) the draws come from the normal distribution with the posterior mean and the posterior SD of the person (the EAP estimate and its SE).

Up to version 0.6.4 PV() accepted any estimation type, approx = FALSE used a Metropolis-Hastings algorithm and approx = TRUE drew from the normal distribution around the estimate of estobj with its SE. For an MLE or WLE estimate this is not a posterior and the plausible values were too widely spread. The arguments thinning, burnin and mult of the sampler are no longer used.

Value

An object of class pv, a list with pvdraws, a matrix with one row per person (in the order of respm) and npv columns, and call.

Author(s)

Manuel Reif

References

Mislevy, R. J. (1991). Randomization-based inference about latent variables from complex samples. Psychometrika, 56(2), 177-196.

Von Davier, M., Gonzalez, E., & Mislevy, R. (2009). What are plausible values and why are they useful. IERI monograph series, 2, 9-36.

See Also

PP_gpcm, PP_4pl, PPall, JKpp

Examples

## 2PL model

set.seed(1522)
# difficulties and slopes
diffpar <- seq(-3, 3, length = 12)
sl      <- round(runif(12, 0.5, 1.5), 2)

# response matrix
awm <- sim_4pl(beta = diffpar, alpha = sl, lowerA = rep(0, 12), upperA = rep(1, 12),
               theta = rnorm(10))

# plausible values need a prior: EAP (or MAP) estimation, here with the default N(0, 1)
res2pl <- PP_4pl(respm = awm, thres = diffpar, slopes = sl, type = "eap")

# 10 plausible values per person, normal approximation of the posterior
res_pv <- PV(res2pl)
summary(res_pv)

# 200 draws from the posterior itself; their means approximate the EAP
res_pv2 <- PV(res2pl, npv = 200, approx = FALSE)
cbind(pv_mean = rowMeans(res_pv2$pvdraws),
      eap = res2pl$estimates$estimate)


## GPCM model with person-specific priors

THRES  <- matrix(c(-2,-1.23,1.11,3.48,1
                   ,2,-1,-0.2,0.5,1.3,-0.8,1.5),nrow=2)
sl     <- c(0.5,1,1.5,1.1,1,0.98)
awmatrix <- matrix(c(1,0,2,0,1,1,1,0,0,1
                     ,2,0,0,0,0,0,0,0,0,1,1,2,2,1,1,1,1,0,0,1),byrow=TRUE,nrow=5)

resgpcm <- PP_gpcm(respm = awmatrix, thres = THRES, slopes = sl, type = "eap",
                   mu = c(0, 0, 1, 1, 1), sigma2 = 0.5)
PV(resgpcm, npv = 5, approx = FALSE)


## GPCM and 4PL items mixed

THRESx <- THRES
THRESx[2,1:3] <- NA
la     <- c(0.02,0.1,0,0,0,0)
ua     <- c(0.97,0.91,1,1,1,1)
awmatrix <- matrix(c(1,0,1,0,1,1,1,0,0,1
                     ,2,0,0,0,0,0,0,0,0,1
                     ,1,2,2,1,1,1,1,0,0,1),byrow=TRUE,nrow=5)

respcm <- PPall(respm = awmatrix, thres = THRESx, slopes = sl, lowerA = la, upperA = ua,
                type = "eap")
res_mixedpv <- PV(respcm, npv = 200, approx = FALSE)

# quantiles of the draws per person
apply(res_mixedpv$pvdraws, 1, quantile)

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