Extract Person Parameters from a Hurdle Partial Credit Model
Source:R/brms_hpcm.R
person_parameters_hpcm.RdExtracts person trait estimates from a fitted hurdle Rasch partial
credit model (family = hurdle_acat()), returning a
per-submodel breakdown: a presence trait \(\theta_{hurdle}\)
(susceptibility) on the Bernoulli gate and a severity trait
\(\theta_{pcm}\) on the partial credit submodel. Each submodel's
output mirrors the shape of person_parameters so
res$hurdle and res$pcm can be passed to existing
downstream functions (RMUreliability,
plot_targeting, etc.).
Usage
person_parameters_hpcm(
model,
item_var = item,
person_var = id,
draws = FALSE,
center = TRUE,
theta_range = c(-7, 7)
)Arguments
- model
A fitted
brmsfitobject using thehurdle_acatcustom family.- item_var
An unquoted variable name identifying the item grouping variable in the model data. Default is
item.- person_var
An unquoted variable name identifying the person grouping variable in the model data. Default is
id.- draws
Logical. If
TRUE, a matrix of full posterior draws (persons x draws) is included in each submodel's output. Default isFALSE.- center
Logical. If
TRUE(the default), item parameters and person parameters are shifted within each submodel so that the mean item parameter is zero. Person traits are shifted by the same constant as the items in their submodel.- theta_range
A numeric vector of length 2 giving the range for the Newton-Raphson WLE search on the hurdle submodel. Default is
c(-7, 7).
Value
A list with three elements:
hurdleA list with the same structure as
person_parametersfor a dichotomous Rasch model:person_estimates(one row per person;sum_scoreis the number of items with \(Y > 0\); both EAP and Warm's WLE are provided),score_table, and optionallydraws_matrix. The hurdle EAP is the sign-flipped brms random effect onhu, so higher values mean greater presence / susceptibility.pcmA list with
person_estimates(columnsid,sum_score,n_active,eap,eap_se),score_table, and optionallydraws_matrix.sum_scoreis the sum of \(Y\) across items with \(Y_{vi} > 0\) for person \(v\);n_activeis the count of such items. WLE columns are omitted intentionally (see Details).correlationA
tibblesummarising the posterior of \(\rho(\theta_{hurdle}, \theta_{pcm})\), identical to thecorrelationelement returned byitem_parameters_hpcm.
Details
Hurdle person trait. Defined as
\(\theta_{hurdle, v} = -r_{id}(v, \texttt{hu\_Intercept})\),
i.e., the brms random effect on hu with its sign flipped.
Under this convention, the hurdle submodel reads
\(P(Y > 0) = \mathrm{plogis}(\theta_{hurdle, v} -
\delta_{hurdle, i})\), so higher \(\theta_{hurdle}\) means greater
presence / susceptibility. WLE is computed by treating the gate
as a dichotomous Rasch model on \(1[Y > 0]\) with item
difficulties \(\delta_{hurdle, i}\) from
item_parameters_hpcm.
Partial credit person trait. Defined as \(\theta_{pcm, v} = r_{id}(v, \texttt{Intercept})\). Higher values mean greater severity given presence.
Why no WLE on the partial credit submodel. Conditional on the hurdle, the severity submodel is a PCM, but the set of items contributing to person \(v\)'s severity score depends on \(v\)'s own pattern of \(1[Y_{vi} > 0]\): only items with \(Y_{vi} > 0\) provide PCM information about \(\theta_{pcm, v}\). The sum of partial credit scores is therefore not a sufficient statistic across the sample, and a standard score-table WLE is not well defined. The Bayesian EAP, which integrates over the (correlated) multivariate prior on \((\theta_{hurdle}, \theta_{pcm})\), remains well defined for all persons (including those with all-zero patterns) and is therefore the recommended point estimate; see Magnus and Garnier-Villarreal (2022, p. 272ff) for discussion in the closely-related MZI-GRM.
Centering. When center = TRUE, the same shifts that
item_parameters_hpcm applies to the item parameters
are applied here to the corresponding person traits. The likelihood
is unchanged.
Row ordering. person_estimates and
draws_matrix preserve the order of first appearance of each
person ID in the model data, matching person_parameters.
References
Magnus, B. E. & Garnier-Villarreal, M. (2022). A multidimensional zero-inflated graded response model for ordinal symptom data. Psychological Methods, 27(2), 261-279. doi:10.1037/met0000395
Warm, T. A. (1989). Weighted likelihood estimation of ability in item response theory. Psychometrika, 54(3), 427–450. doi:10.1007/BF02294627
See also
person_parameters for the single-submodel version,
item_parameters_hpcm for the item-side counterpart,
hurdle_acat for the custom brms family.