lsirm2pl_normal_fixed_gamma_mar {lsirm12pl} | R Documentation |
2PL LSIRM fixing gamma to 1 with normal likelihood for missing at random data.
Description
lsirm2pl_normal_fixed_gamma_mar is used to fit 2PL LSIRM with gamma fixed to 1 for continuous variable in incomplete data assumed to be missing at random.
lsirm2pl_normal_fixed_gamma_mar factorizes item response matrix into column-wise item effect, row-wise respondent effect and further embeds interaction effect in a latent space, while considering the missing element under the assumption of missing 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_fixed_gamma_mar(
data,
ndim = 2,
niter = 15000,
nburn = 2500,
nthin = 5,
nprint = 500,
jump_beta = 0.4,
jump_theta = 1,
jump_alpha = 1,
jump_z = 0.5,
jump_w = 0.5,
pr_mean_beta = 0,
pr_sd_beta = 1,
pr_mean_theta = 0,
pr_mean_alpha = 0.5,
pr_sd_alpha = 1,
pr_a_theta = 0.001,
pr_b_theta = 0.001,
pr_a_eps = 0.001,
pr_b_eps = 0.001,
missing.val = 99,
verbose = FALSE
)
Arguments
data |
Matrix; a binary or continuous item response matrix for analysis. Each row represents a respondent, and each column contains responses to the corresponding item. |
ndim |
Integer; the dimension of the latent space. Default is 2. |
niter |
Integer; the total number of MCMC iterations to run. Default is 15000. |
nburn |
Integer; the number of initial MCMC iterations to discard as burn-in. Default is 2500. |
nthin |
Integer; the number of MCMC iterations to thin. Default is 5. |
nprint |
Integer; the interval at which MCMC samples are displayed during execution. Default is 500. |
jump_beta |
Numeric; the jumping rule for the beta proposal density. Default is 0.4. |
jump_theta |
Numeric; the jumping rule for the theta proposal density. Default is 1.0. |
jump_alpha |
Numeric; the jumping rule for the alpha proposal density. Default is 1.0. |
jump_z |
Numeric; the jumping rule for the z proposal density. Default is 0.5. |
jump_w |
Numeric; the jumping rule for the w proposal density. Default is 0.5. |
pr_mean_beta |
Numeric; the mean of the normal prior for beta. Default is 0. |
pr_sd_beta |
Numeric; the standard deviation of the normal prior for beta. Default is 1.0. |
pr_mean_theta |
Numeric; the mean of the normal prior for theta. Default is 0. |
pr_mean_alpha |
Numeric; the mean of the log normal prior for alpha. Default is 0.5. |
pr_sd_alpha |
Numeric; the standard deviation of the log normal prior for alpha. Default is 1.0. |
pr_a_theta |
Numeric; the shape parameter of the inverse gamma prior for the variance of theta. Default is 0.001. |
pr_b_theta |
Numeric; the scale parameter of the inverse gamma prior for the variance of theta. Default is 0.001. |
pr_a_eps |
Numeric; the shape parameter of inverse gamma prior for variance of data likelihood. Default is 0.001. |
pr_b_eps |
Numeric; the scale parameter of inverse gamma prior for variance of data likelihood Default is 0.001. |
missing.val |
Numeric; a number to replace missing values. Default is 99. |
verbose |
Logical; If TRUE, MCMC samples are printed for each |
Details
lsirm2pl_normal_fixed_gamma_mar
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. 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 at random, the model takes the missing element into consideration in the sampling procedure. For the details of missing at random assumption and data augmentation, see References.
Value
lsirm2pl_normal_fixed_gamma_mar
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 |
Details about the number of MCMC iterations, burn-in periods, and thinning intervals. |
map_inf |
The log maximum a posteriori (MAP) value and the iteration number at which this MAP value occurs. |
beta_estimate |
Posterior estimates of the beta parameter. |
theta_estimate |
Posterior estimates of the theta parameter. |
sigma_theta_estimate |
Posterior estimates of the standard deviation of theta. |
z_estimate |
Posterior estimates of the z parameter. |
w_estimate |
Posterior estimates of the w parameter. |
imp_estimate |
Probability of imputating a missing value with 1. |
beta |
Posterior samples of the beta parameter. |
theta |
Posterior samples of the theta parameter. |
theta_sd |
Posterior samples of the standard deviation of theta. |
z |
Posterior samples of the z parameter, represented as a 3-dimensional matrix where the last axis denotes the dimension of the latent space. |
w |
Posterior samples of the w parameter, represented as a 3-dimensional matrix where the last axis denotes the dimension of the latent space. |
imp |
Imputation for missing Values using posterior samples. |
accept_beta |
Acceptance ratio for the beta parameter. |
accept_theta |
Acceptance ratio for the theta parameter. |
accept_z |
Acceptance ratio for the z parameter. |
accept_w |
Acceptance ratio for the w parameter. |
sigma_estimate |
Posterior estimates of the standard deviation. |
sigma |
Posterior samples of the standard deviation. |
alpha_estimate |
Posterior estimates of the alpha parameter. |
alpha |
Posterior estimates of the alpha parameter. |
accept_alpha |
Acceptance ratio for the alpha parameter. |
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_fixed_gamma_mar(data)
# The code following can achieve the same result.
lsirm_result <- lsirm(data ~ lsirm2pl(spikenslab = FALSE, fixed_gamma = TRUE,
missing_data = "mar"))