| print.pv | R Documentation |
This function draws npv plausible values for each person from their posterior density.
## 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, ...)
x, object |
An object of class |
digits |
Number of significant digits to print. |
... |
Not used. |
nrowmax |
|
estobj |
An object which originates from using |
npv |
The number of plausible values per person - default is 10. |
approx |
If |
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.
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.
Manuel Reif
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.
PP_gpcm, PP_4pl, PPall, JKpp
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.