Skip to contents

Each ordinal response is a thresholded latent normal, $$y^*_{ij} = \lambda_{j0} + \lambda_j^\top \phi_i + e_{ij}, \quad e_{ij} \sim N(0, 1),$$ with \(y_{ij} = c\) when \(\gamma_{j,c-1} < y^*_{ij} \le \gamma_{j,c}\), item-specific cutpoints \(\gamma_{j0} = -\infty\), \(\gamma_{j1} = 0\), \(\gamma_{jC} = \infty\), ideal points \(\phi_i \sim N(0, I)\), loadings \(\lambda_j \sim N(0, I / L_0)\) and a flat prior on the free cutpoints. \(L_0 = 0\) (the default) is the flat loading prior of MCMCpack::MCMCordfactanal. Each item's categories are its observed values in increasing order.

Usage

morie_spatial_voting_ordinal_irt(
  Y,
  n_dims = 1L,
  n_samples = 500L,
  burn_in = 100L,
  seed = 42L,
  lambda_prior_precision = 0
)

Arguments

Y

Respondent-by-item matrix of ordinal responses (any ordered numeric coding; NA for missing).

n_dims

Latent dimensions.

n_samples

Retained draws.

burn_in

Sweeps discarded first.

seed

RNG seed.

lambda_prior_precision

Prior precision \(L_0\) of the loadings and intercepts.

Value

List: ideal_points and ideal_sd (respondents by dimension), discrimination (items by dimension), intercept, cutpoints (per item, posterior means, the first fixed at 0), acceptance (cutpoint steps after burn-in), n_samples, engine.

Details

Each sweep updates the free cutpoints of every item by the Cowles (1996) Metropolis-Hastings step with \(y^*\) integrated out (step sizes tuned during burn-in only), then draws \(y^*\) from truncated normals and the loadings and ideal points from their Gaussian full conditionals. Reflection (and, with several dimensions, rotation) leaves the model unchanged; each draw is reflected so the first item loads positively, or with several dimensions rotated onto the first draw. On 200 simulated respondents and ten four-category items the posterior means agree with MCMCordfactanal (first loading constrained positive) to Monte Carlo error: ideal points correlate at 0.9999 and loadings, intercepts and cutpoints differ by at most 0.05.

References

Quinn, K. M. (2004). Bayesian factor analysis for mixed ordinal and continuous responses. Political Analysis 12(4), 338-353.

Cowles, M. K. (1996). Accelerating Monte Carlo Markov chain convergence for cumulative-link generalized linear models. Statistics and Computing 6(2), 101-111.

Examples

set.seed(1)
th <- rnorm(60)
Y <- matrix(cut(outer(th, runif(6, 0.8, 1.5)) + rnorm(360),
                c(-Inf, -0.5, 0.5, Inf), labels = FALSE), 60, 6)
fit <- morie_spatial_voting_ordinal_irt(Y, n_samples = 150L,
                                        burn_in = 100L)
cor(fit$ideal_points[, 1], th)
#> [1] 0.8837929