lsirm1pl {lsirm12pl} | R Documentation |
Fit a 1PL LSIRM for binary and continuous item response data
Description
lsirm1pl
integrates all functions related to 1PL LSIRM. Various 1PL LSIRM function can be used by setting the spikenslab
, fixed_gamma
, and missing_data
arguments.
This function can be used regardless of the data type, providing a unified approach to model fitting.
Usage
lsirm1pl(
data,
spikenslab = FALSE,
fixed_gamma = FALSE,
missing_data = NA,
chains = 1,
multicore = 1,
seed = NA,
ndim,
niter,
nburn,
nthin,
nprint,
jump_beta,
jump_theta,
jump_z,
jump_w,
pr_mean_beta,
pr_sd_beta,
pr_mean_theta,
pr_a_theta,
pr_b_theta,
...
)
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. |
spikenslab |
Logical; specifies whether to use a model selection approach. Default is FALSE. |
fixed_gamma |
Logical; indicates whether to fix gamma at 1. Default is FALSE. |
missing_data |
Character; the type of missing data assumed. Options are NA, "mar", or "mcar". Default is NA. |
chains |
Integer; the number of MCMC chains to run. Default is 1. |
multicore |
Integer; the number of cores to use for parallel execution. Default is 1. |
seed |
Integer; the seed number for MCMC fitting. Default is NA. |
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_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_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. |
... |
Additional arguments for the for various settings. Refer to the functions in the Details. |
Details
Additional arguments and return values for each function are documented in the respective function's description.
* For LSIRM with data included missing value are detailed in lsirm1pl_mar and lsirm1pl_mcar.
* For LSIRM using the spike-and-slab model selection approach are detailed in lsirm1pl_ss.
* For continuous version of LSIRM are detailed in lsirm1pl_normal_o.
For 1PL LSIRM with binary item response data, the probability of correct 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:
logit(P(Y_{j,i} = 1|\theta_j,\beta_i,\gamma,z_j,w_i))=\theta_j+\beta_i-\gamma||z_j-w_i||
For 1PL LSIRM with continuous item response data, 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:
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)
.
Value
lsirm1pl
returns an object of list.
The basic return list containing the following components:
data |
A data frame or matrix containing the variables used in the model. |
bic |
A numeric value representing the Bayesian Information Criterion (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. |
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. |
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. |
... |
Additional return values for various settings. Refer to the functions in the Details. |
Note
If both spikenslab
and fixed_gamma
are set TRUE
, it returns error because both are related to gamma
.
See Also
The LSIRM for 1PL LSIRM for binary item response data as following:
lsirm1pl_o
, lsirm1pl_fixed_gamma
, lsirm1pl_mar
,lsirm1pl_mcar
, lsirm1pl_fixed_gamma_mar
, lsirm1pl_fixed_gamma_mcar
, lsirm1pl_ss
, lsirm1pl_mar_ss
, and lsirm1pl_mcar_ss
The LSIRM for 1PL LSIRM for continuous item response data as following:
lsirm1pl_normal_o
, lsirm1pl_normal_fixed_gamma
, lsirm1pl_normal_mar
, lsirm1pl_normal_mcar
,lsirm1pl_normal_fixed_gamma_mar
, lsirm1pl_normal_fixed_gamma_mcar
, lsirm1pl_normal_ss
, lsirm1pl_normal_mar_ss
, lsirm1pl_normal_mcar_ss
Examples
# generate example item response matrix
data <- matrix(rbinom(500, size = 1, prob = 0.5),ncol=10,nrow=50)
lsirm_result <- lsirm1pl(data)
# The code following can achieve the same result.
lsirm_result <- lsirm(data~lsirm1pl())