lsirm2pl_normal_mcar_ss {lsirm12pl}R Documentation

2pl LSIRM model with normal likelihood and model selection approach for missing completely at random data.

Description

lsirm2pl_normal_mcar_ss is used to fit 2pl LSIRM model with model selection approach based on spike-and-slab priors for continuous variable in incomplete data assumed to be missing completely at random. lsirm2pl_normal_mcar_ss factorizes item response matrix into column-wise item effect, row-wise respondent effect and further embeds interaction effect in a latent space, while ignoring the missing element under the assumption of missing completely at random. Unlike 1pl model, 2pl model assumes the item effect can vary according to respondent, allowing additional parameter multiplied with respondent effect. The resulting latent space provides an interaction map that represents interactions between respondents and items.

Usage

lsirm2pl_normal_mcar_ss(
  data,
  ndim = 2,
  niter = 15000,
  nburn = 2500,
  nthin = 5,
  nprint = 500,
  jump_beta = 0.4,
  jump_theta = 1,
  jump_alpha = 1,
  jump_gamma = 1,
  jump_z = 0.5,
  jump_w = 0.5,
  pr_mean_beta = 0,
  pr_sd_beta = 1,
  pr_mean_theta = 0,
  pr_spike_mean = -3,
  pr_spike_sd = 1,
  pr_slab_mean = 0.5,
  pr_slab_sd = 1,
  pr_mean_alpha = 0.5,
  pr_sd_alpha = 1,
  pr_a_eps = 0.001,
  pr_b_eps = 0.001,
  pr_a_theta = 0.001,
  pr_b_theta = 0.001,
  pr_xi_a = 0.001,
  pr_xi_b = 0.001,
  missing.val = 99,
  verbose = FALSE
)

Arguments

data

Matrix; continuous item response matrix to be analyzed. Each row is assumed to be respondent and its column values are assumed to be response to the corresponding item.

ndim

Numeric; dimension of latent space. default value is 2.

niter

Numeric; number of iterations to run MCMC sampling. default value is 15000.

nburn

Numeric; number of initial, pre-thinning, MCMC iterations to discard. default value is 2500.

nthin

Numeric;number of thinning, MCMC iterations to discard. default value is 5.

nprint

Numeric; MCMC samples is displayed during execution of MCMC chain for each nprint. default value is 500.

jump_beta

Numeric; jumping rule of the proposal density for beta. default value is 0.4.

jump_theta

Numeric; jumping rule of the proposal density for theta. default value is 1.0.

jump_alpha

Numeric; jumping rule of the proposal density for alpha default value is 1.0.

jump_gamma

Numeric; jumping rule of the proposal density for gamma. default value is 0.025.

jump_z

Numeric; jumping rule of the proposal density for z. default value is 0.5.

jump_w

Numeric; jumping rule of the proposal density for w. default value is 0.5.

pr_mean_beta

Numeric; mean of normal prior for beta. default value is 0.

pr_sd_beta

Numeric; standard deviation of normal prior for beta. default value is 1.0.

pr_mean_theta

Numeric; mean of normal prior for theta. default value is 0.

pr_spike_mean

Numeric; mean of spike prior for log gamma default value is -3.

pr_spike_sd

Numeric; standard deviation of spike prior for log gamma default value is 1.

pr_slab_mean

Numeric; mean of spike prior for log gamma default value is 0.5.

pr_slab_sd

Numeric; standard deviation of spike prior for log gamma default value is 1.

pr_mean_alpha

Numeric; mean of normal prior for alpha. default value is 0.5.

pr_sd_alpha

Numeric; mean of normal prior for beta. default value is 1.0.

pr_a_eps

Numeric; shape parameter of inverse gamma prior for variance of data likelihood. default value is 0.001.

pr_b_eps

Numeric; scale parameter of inverse gamma prior for variance of data likelihood default value is 0.001.

pr_a_theta

Numeric; shape parameter of inverse gamma prior for variance of theta. default value is 0.001.

pr_b_theta

Numeric; scale parameter of inverse gamma prior for variance of theta. default value is 0.001.

pr_xi_a

Numeric; first shape parameter of beta prior for latent variable xi. default value is 1.

pr_xi_b

Numeric; second shape parameter of beta prior for latent variable xi. default value is 1.

missing.val

Numeric; a number to replace missing values. default value is 99.

verbose

Logical; If TRUE, MCMC samples are printed for each nprint. default value is FALSE

Details

lsirm2pl_normal_mcar_ss models the continuous value of response by respondent j to item i with item effect \beta_i, respondent effect \theta_j and the distance between latent position w_i of item i and latent position z_j of respondent j in the shared metric space, with \gamma represents the weight of the distance term. For 2pl model, the the item effect is assumed to have additional discrimination parameter \alpha_i multiplied by \theta_j:

Y_{j,i} = \theta_j+\beta_i-\gamma||z_j-w_i|| + e_{j,i}

where the error e_{j,i} \sim N(0,\sigma^2) Under the assumption of missing completely at random, the model ignores the missing element in doing inference. For the details of missing completely at random assumption and data augmentation, see References. lsirm2pl_normal_mcar_ss model include model selection approach based on spike-and-slab priors for log gamma. For detail of spike-and-slab priors, see References.

Value

lsirm2pl_normal_mcar_ss returns an object of list containing the following components:

data

data frame or matrix containing the variables in the model.

missing.val

a number to replace missing values.

bic

Numeric value with the corresponding BIC.

mcmc_inf

number of mcmc iteration, burn-in periods, and thinning intervals.

map_inf

value of log maximum a posterior and iteration number which have log maximum a posterior.

beta_estimate

posterior estimation of beta.

theta_estimate

posterior estimation of theta.

sigma_theta_estimate

posterior estimation of standard deviation of theta.

sigma_estimate

posterior estimation of standard deviation.

gamma_estimate

posterior estimation of gamma.

alpha_estimate

posterior estimation of alpha.

z_estimate

posterior estimation of z.

w_estimate

posterior estimation of w.

pi_estimate

posterior estimation of phi. inclusion probability of gamma. if estimation of phi is less than 0.5, choose Rasch model with gamma = 0, otherwise latent space model with gamma > 0.

beta

posterior samples of beta.

theta

posterior samples of theta.

theta_sd

posterior samples of standard deviation of theta.

sigma

posterior samples of standard deviation.

gamma

posterior samples of gamma.

alpha

posterior samples of alpha.

z

posterior samples of z. The output is 3-dimensional matrix with last axis represent the dimension of latent space.

w

posterior samples of w. The output is 3-dimensional matrix with last axis represent the dimension of latent space.

pi

posterior samples of phi which is indicator of spike and slab prior. If phi is 1, log gamma follows the slab prior, otherwise follows the spike prior.

accept_beta

accept ratio of beta.

accept_theta

accept ratio of theta.

accept_w

accept ratio of w.

accept_z

accept ratio of z.

accept_gamma

accept ratio of gamma.

accept_alpha

accept ratio of alpha.

References

Little, R. J., & Rubin, D. B. (2019). Statistical analysis with missing data (Vol. 793). John Wiley & Sons. Ishwaran, H., & Rao, J. S. (2005). Spike and slab variable selection: frequentist and Bayesian strategies. The Annals of Statistics, 33(2), 730-773.

Examples

# generate example (continuous) item response matrix
data     <- matrix(rnorm(500, mean = 0, sd = 1),ncol=10,nrow=50)

# generate example missing indicator matrix
missing_mat     <- matrix(rbinom(500, size = 1, prob = 0.2),ncol=10,nrow=50)

# make missing value with missing indicator matrix
data[missing_mat==1] <- 99

lsirm_result <- lsirm2pl_normal_mcar_ss(data)

# The code following can achieve the same result.
lsirm_result <- lsirm(data ~ lsirm2pl(spikenslab = TRUE, fixed_gamma = FALSE,
                      missing_data = "mcar"))


[Package lsirm12pl version 1.3.1 Index]