Title: | Latent Space Item Response Model |
---|---|
Description: | Analysis of dichotomous and continuous response data using latent factor by both 1PL LSIRM and 2PL LSIRM as described in Jeon et al. (2021) <doi:10.1007/s11336-021-09762-5>. It includes original 1PL LSIRM and 2PL LSIRM provided for binary response data and its extension for continuous response data. Bayesian model selection with spike-and-slab prior and method for dealing data with missing value under missing at random, missing completely at random are also supported. Various diagnostic plots are available to inspect the latent space and summary of estimated parameters. |
Authors: | Dongyoung Go [aut], Gwanghee Kim [aut], Jina Park [aut, cre], Ickhoon Jin [ctb], Minjeong Jeon [ctb] |
Maintainer: | Jina Park <[email protected]> |
License: | GPL-3 |
Version: | 1.3.3 |
Built: | 2024-11-27 06:54:55 UTC |
Source: | CRAN |
A dataset containing the result of personality test for 50 questions from 1,000 random sampled people.
data(BFPT)
data(BFPT)
A matrix with 1,015,341 rows and 50 columns.
A dataset collected in 2016-2018 through an interactive on-line personality test, containing the result of personality test for 50 questions. 1,000 people are random sampled from the original dataset containing 1,015,341 people. The scale is labeled as 1=Disagree, 3=Neutral and 5=Agree.
https://www.kaggle.com/tunguz/big-five-personality-test
diagnostic
checks the convergence of MCMC for LSIRM parameters using various diagnostic tools, such as trace plots, posterior density distributions, autocorrelation functions (ACF), and Gelman-Rubin-Brooks plots.
diagnostic( object, draw.item = list(beta = c(1), theta = c(1)), gelman.diag = FALSE )
diagnostic( object, draw.item = list(beta = c(1), theta = c(1)), gelman.diag = FALSE )
object |
Object of class |
draw.item |
List; Each key in the list corresponds to a specific parameters such as "beta", "theta", "gamma", "alpha", "sigma", "sigma_sd", and "zw.dist". The values of the list indicate the indices of these parameters. For the key "zw.dist", the value is a matrix with two columns: the first column represents the indices of respondents, and the second column represents the indices of items. |
gelman.diag |
Logical; If TRUE, the Gelman-Rubin convergence diagnostic will be printed. Default is FALSE. |
diagnostic
returns plots for checking MCMC convergence for selected parameters.
# Generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5), ncol=10, nrow=50) # For 1PL LSIRM lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = FALSE, fixed_gamma = FALSE)) diagnostic(lsirm_result) # For 2PL LSIRM lsirm_result <- lsirm(data ~ lsirm2pl(spikenslab = FALSE, fixed_gamma = FALSE)) diagnostic(lsirm_result)
# Generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5), ncol=10, nrow=50) # For 1PL LSIRM lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = FALSE, fixed_gamma = FALSE)) diagnostic(lsirm_result) # For 2PL LSIRM lsirm_result <- lsirm(data ~ lsirm2pl(spikenslab = FALSE, fixed_gamma = FALSE)) diagnostic(lsirm_result)
gof is goodness-of-fit the latent space of fitted LSIRM.
gof(object, chain.idx = 1)
gof(object, chain.idx = 1)
object |
Object of class |
chain.idx |
Numeric; Index of MCMC chain. Default is 1. |
gof
returns the boxplot or AUC plot
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),ncol=10,nrow=50) lsirm_result <- lsirm(data ~ lsirm1pl()) gof(lsirm_result)
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),ncol=10,nrow=50) lsirm_result <- lsirm(data ~ lsirm1pl()) gof(lsirm_result)
lsirm is used to fit 1PL LSIRM and 2PL LSIRM using Bayesian method as described in Jeon et al. (2021).
lsirm(formula, ...)
lsirm(formula, ...)
formula |
The form of formula is |
... |
Additional arguments for the corresponding function. |
The descriptions of options for each model, such as <term 2>
and <term 3>
, are included in lsirm1pl
for 1PL LSIRM and lsirm2pl
for 2PL LSIRM.
lsirm
returns an object of class list
.
See corresponding functions such as lsirm1pl
for 1PL LSIRM and lsirm2pl
for 2PL LSIRM.
lsirm1pl
for 1PL LSIRM.
lsirm2pl
for 2PL LSIRM.
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),ncol=10,nrow=50) lsirm_result <- lsirm(data~lsirm1pl()) lsirm_result <- lsirm(data~lsirm2pl())
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),ncol=10,nrow=50) lsirm_result <- lsirm(data~lsirm1pl()) lsirm_result <- lsirm(data~lsirm2pl())
lsirm.formula is formula object.
## S3 method for class 'formula' lsirm(formula, ...)
## S3 method for class 'formula' lsirm(formula, ...)
formula |
The form of formula is |
... |
Additional arguments for the corresponding function. |
Analysis of dichotomous and continuous response data using latent factor by both 1PL LSIRM and 2PL LSIRM as described in Jeon et al. (2021) <doi:10.1007/s11336-021-09762-5>. It includes original 1PL LSIRM and 2PL LSIRM provided for binary response data and its extension for continuous response data. Bayesian model selection with spike-and-slab prior and method for dealing data with missing value under missing at random, missing completely at random are also supported. Various diagnostic plots are available to inspect the latent space and summary of estimated parameters.
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.
lsirm1pl( data, spikenslab = FALSE, fixed_gamma = FALSE, missing_data = NA, chains = 1, multicore = 1, seed = NA, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 1, jump_z = 0.5, jump_w = 0.5, pr_mean_beta = 0, pr_sd_beta = 1, pr_mean_theta = 0, pr_a_theta = 0.001, pr_b_theta = 0.001, ... )
lsirm1pl( data, spikenslab = FALSE, fixed_gamma = FALSE, missing_data = NA, chains = 1, multicore = 1, seed = NA, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 1, jump_z = 0.5, jump_w = 0.5, pr_mean_beta = 0, pr_sd_beta = 1, pr_mean_theta = 0, pr_a_theta = 0.001, pr_b_theta = 0.001, ... )
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. |
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 to item
with item effect
, respondent effect
and the distance between latent position
of item
and latent position
of respondent
in the shared metric space, with
represents the weight of the distance term:
For 1PL LSIRM with continuous item response data, the continuous value of response by respondent to item
with item effect
, respondent effect
and the distance between latent position
of item
and latent position
of respondent
in the shared metric space, with
represents the weight of the distance term:
where the error .
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. |
If both spikenslab
and fixed_gamma
are set TRUE
, it returns error because both are related to gamma
.
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
# 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())
# 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())
lsirm1pl_fixed_gamma is used to fit 1PL LSIRM with gamma fixed to 1. lsirm1pl_fixed_gamma factorizes item response matrix into column-wise item effect, row-wise respondent effect and further embeds interaction effect in a latent space. The resulting latent space provides an interaction map that represents interactions between respondents and items.
lsirm1pl_fixed_gamma( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 1, jump_z = 0.5, jump_w = 0.5, pr_mean_beta = 0, pr_sd_beta = 1, pr_mean_theta = 0, pr_a_theta = 0.001, pr_b_theta = 0.001, verbose = FALSE )
lsirm1pl_fixed_gamma( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 1, jump_z = 0.5, jump_w = 0.5, pr_mean_beta = 0, pr_sd_beta = 1, pr_mean_theta = 0, pr_a_theta = 0.001, pr_b_theta = 0.001, verbose = FALSE )
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_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. |
verbose |
Logical; If TRUE, MCMC samples are printed for each |
lsirm1pl_fixed_gamma
models the probability of correct response by respondent to item
with item effect
, respondent effect
and the distance between latent position
of item
and latent position
of respondent
in the shared metric space:
lsirm1pl_fixed_gamma
returns an object of list containing the following components:
data |
Data frame or matrix containing the variables in the model. |
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. |
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. |
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),ncol=10,nrow=50) lsirm_result <- lsirm1pl_fixed_gamma(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = FALSE, fixed_gamma = TRUE))
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),ncol=10,nrow=50) lsirm_result <- lsirm1pl_fixed_gamma(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = FALSE, fixed_gamma = TRUE))
lsirm1pl_fixed_gamma_mar is used to fit LSIRM with gamma fixed to 1 in incomplete data assumed to be missing at random. lsirm1pl_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. The resulting latent space provides an interaction map that represents interactions between respondents and items.
lsirm1pl_fixed_gamma_mar( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 1, jump_z = 0.5, jump_w = 0.5, pr_mean_beta = 0, pr_sd_beta = 1, pr_mean_theta = 0, pr_a_theta = 0.001, pr_b_theta = 0.001, missing.val = 99, verbose = FALSE )
lsirm1pl_fixed_gamma_mar( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 1, jump_z = 0.5, jump_w = 0.5, pr_mean_beta = 0, pr_sd_beta = 1, pr_mean_theta = 0, pr_a_theta = 0.001, pr_b_theta = 0.001, missing.val = 99, verbose = FALSE )
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_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. |
missing.val |
Numeric; a number to replace missing values. Default is 99. |
verbose |
Logical; If TRUE, MCMC samples are printed for each |
lsirm1pl_fixed_gamma_mar
models the probability of correct response by respondent to item
with item effect
, respondent effect
and the distance between latent position
of item
and latent position
of respondent
in the shared metric space:
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.
lsirm1pl_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. |
Little, R. J., & Rubin, D. B. (2019). Statistical analysis with missing data (Vol. 793). John Wiley & Sons.
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),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 <- lsirm1pl_fixed_gamma_mar(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = FALSE, fixed_gamma = TRUE, missing_data = "mar", missing.val = 99))
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),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 <- lsirm1pl_fixed_gamma_mar(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = FALSE, fixed_gamma = TRUE, missing_data = "mar", missing.val = 99))
lsirm1pl_fixed_gamma_mcar is used to fit LSIRM with gamma fixed to 1 in incomplete data assumed to be missing completely at random. lsirm1pl_fixed_gamma_mcar 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. The resulting latent space provides an interaction map that represents interactions between respondents and items.
lsirm1pl_fixed_gamma_mcar( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 1, jump_z = 0.5, jump_w = 0.5, pr_mean_beta = 0, pr_sd_beta = 1, pr_mean_theta = 0, pr_a_theta = 0.001, pr_b_theta = 0.001, missing.val = 99, verbose = FALSE )
lsirm1pl_fixed_gamma_mcar( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 1, jump_z = 0.5, jump_w = 0.5, pr_mean_beta = 0, pr_sd_beta = 1, pr_mean_theta = 0, pr_a_theta = 0.001, pr_b_theta = 0.001, missing.val = 99, verbose = FALSE )
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_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. |
missing.val |
Numeric; a number to replace missing values. Default is 99. |
verbose |
Logical; If TRUE, MCMC samples are printed for each |
lsirm1pl_fixed_gamma_mcar
models the probability of correct response by respondent to item
with item effect
, respondent effect
and the distance between latent position
of item
and latent position
of respondent
in the shared metric space:
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.
lsirm1pl_fixed_gamma_mcar
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. |
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. |
Little, R. J., & Rubin, D. B. (2019). Statistical analysis with missing data (Vol. 793). John Wiley & Sons.
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),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 <- lsirm1pl_fixed_gamma_mcar(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = FALSE, fixed_gamma = TRUE, missing_data = "mcar", missing.val = 99))
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),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 <- lsirm1pl_fixed_gamma_mcar(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = FALSE, fixed_gamma = TRUE, missing_data = "mcar", missing.val = 99))
lsirm1pl_mar is used to fit 1PL LSIRM in incomplete data assumed to be missing at random. lsirm1pl_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. The resulting latent space provides an interaction map that represents interactions between respondents and items.
lsirm1pl_mar( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 1, jump_gamma = 0.025, jump_z = 0.5, jump_w = 0.5, pr_mean_beta = 0, pr_sd_beta = 1, pr_mean_theta = 0, pr_mean_gamma = 0.5, pr_sd_gamma = 1, pr_a_theta = 0.001, pr_b_theta = 0.001, missing.val = 99, verbose = FALSE )
lsirm1pl_mar( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 1, jump_gamma = 0.025, jump_z = 0.5, jump_w = 0.5, pr_mean_beta = 0, pr_sd_beta = 1, pr_mean_theta = 0, pr_mean_gamma = 0.5, pr_sd_gamma = 1, pr_a_theta = 0.001, pr_b_theta = 0.001, missing.val = 99, verbose = FALSE )
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_gamma |
Numeric; the jumping rule for the gamma proposal density. Default is 0.025 |
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_gamma |
Numeric; mean of log normal prior for gamma. Default is 0.5. |
pr_sd_gamma |
Numeric; standard deviation of log normal prior for gamma. 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. |
missing.val |
Numeric; a number to replace missing values. Default is 99. |
verbose |
Logical; If TRUE, MCMC samples are printed for each |
lsirm1pl_mar
models the probability of correct response by respondent to item
with item effect
, respondent effect
and the distance between latent position
of item
and latent position
of respondent
in the shared metric space, with
represents the weight of the distance term:
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.
lsirm1pl_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. |
gamma_estimate |
posterior estimates of gamma parameter. |
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. |
gamma |
Posterior samples of the gamma 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. |
accept_gamma |
Acceptance ratio for the gamma parameter. |
Little, R. J., & Rubin, D. B. (2019). Statistical analysis with missing data (Vol. 793). John Wiley & Sons.
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),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 <- lsirm1pl_mar(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = FALSE, fixed_gamma = FALSE, missing_data ='mar', missing.val = 99))
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),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 <- lsirm1pl_mar(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = FALSE, fixed_gamma = FALSE, missing_data ='mar', missing.val = 99))
lsirm1pl_mar_ss is used to fit 1PL LSIRM with model selection approach based on spike-and-slab priors in incomplete data assumed to be missing at random. lsirm1pl_mar_ss 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. The resulting latent space provides an interaction map that represents interactions between respondents and items.
lsirm1pl_mar_ss( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 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_a_theta = 0.001, pr_b_theta = 0.001, pr_xi_a = 1, pr_xi_b = 1, missing.val = 99, verbose = FALSE )
lsirm1pl_mar_ss( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 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_a_theta = 0.001, pr_b_theta = 0.001, pr_xi_a = 1, pr_xi_b = 1, missing.val = 99, verbose = FALSE )
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_gamma |
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_spike_mean |
Numeric; the mean of spike prior for log gamma. Default is -3. |
pr_spike_sd |
Numeric; the standard deviation of spike prior for log gamma. Default is 1. |
pr_slab_mean |
Numeric; the mean of spike prior for log gamma. Default is 0.5. |
pr_slab_sd |
Numeric; the standard deviation of spike prior for log gamma. Default is is 1. |
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_xi_a |
Numeric; the first shape parameter of beta prior for latent variable xi. Default is 1. |
pr_xi_b |
Numeric; the second shape parameter of beta prior for latent variable xi. Default is 1. |
missing.val |
Numeric; a number to replace missing values. Default is 99. |
verbose |
Logical; If TRUE, MCMC samples are printed for each |
lsirm1pl_mar_ss
models the probability of correct response by respondent to item
with item effect
, respondent effect
and the distance between latent position
of item
and latent position
of respondent
in the shared metric space, with
represents the weight of the distance term:
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. lsirm1pl_mar_ss
model include model selection approach based on spike-and-slab priors for log gamma. For detail of spike-and-slab priors, see References.
lsirm1pl_mar_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 |
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. |
gamma_estimate |
posterior estimates of gamma parameter. |
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. |
gamma |
Posterior samples of the gamma 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. |
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. |
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. |
accept_gamma |
Acceptance ratio for the gamma parameter. |
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. |
imp_estimate |
Probability of imputating a missing value with 1. |
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.
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),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 <- lsirm1pl_mar_ss(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = TRUE, fixed_gamma = FALSE, missing_data = 'mar', missing = 99))
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),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 <- lsirm1pl_mar_ss(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = TRUE, fixed_gamma = FALSE, missing_data = 'mar', missing = 99))
lsirm1pl_mcar is used to fit 1PL LSIRM in incomplete data assumed to be missing completely at random. lsirm1pl_mcar 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. The resulting latent space provides an interaction map that represents interactions between respondents and items.
lsirm1pl_mcar( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 1, jump_gamma = 0.025, jump_z = 0.5, jump_w = 0.5, pr_mean_beta = 0, pr_sd_beta = 1, pr_mean_theta = 0, pr_mean_gamma = 0.5, pr_sd_gamma = 1, pr_a_theta = 0.001, pr_b_theta = 0.001, missing.val = 99, verbose = FALSE )
lsirm1pl_mcar( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 1, jump_gamma = 0.025, jump_z = 0.5, jump_w = 0.5, pr_mean_beta = 0, pr_sd_beta = 1, pr_mean_theta = 0, pr_mean_gamma = 0.5, pr_sd_gamma = 1, pr_a_theta = 0.001, pr_b_theta = 0.001, missing.val = 99, verbose = FALSE )
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_gamma |
Numeric; the jumping rule for the gamma proposal density. Default is 0.025. |
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_gamma |
Numeric; mean of log normal prior for gamma. Default is 0.5. |
pr_sd_gamma |
Numeric; standard deviation of log normal prior for gamma. 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. |
missing.val |
Numeric; A number to replace missing values. Default is 99. |
verbose |
Logical; If TRUE, MCMC samples are printed for each |
lsirm1pl_mcar
models the probability of correct response by respondent to item
with item effect
, respondent effect
and the distance between latent position
of item
and latent position
of respondent
in the shared metric space, with
represents the weight of the distance term:
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.
lsirm1pl_mcar
returns an object of list containing the following components:
data |
A data frame or matrix containing the variables used 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. |
gamma_estimate |
Posterior estimates of gamma parameter. |
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. |
gamma |
Posterior samples of the gamma parameter. |
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. |
accept_gamma |
Acceptance ratio for the gamma parameter. |
Little, R. J., & Rubin, D. B. (2019). Statistical analysis with missing data (Vol. 793). John Wiley & Sons.
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),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 <- lsirm1pl_mcar(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = FALSE, fixed_gamma = FALSE, missing_data ='mcar', missing.val = 99))
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),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 <- lsirm1pl_mcar(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = FALSE, fixed_gamma = FALSE, missing_data ='mcar', missing.val = 99))
lsirm1pl_mcar_ss is used to fit 1PL LSIRM with model selection approach based on spike-and-slab priors in incomplete data assumed to be missing completely at random. lsirm1pl_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. The resulting latent space provides an interaction map that represents interactions between respondents and items.
lsirm1pl_mcar_ss( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 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_a_theta = 0.001, pr_b_theta = 0.001, pr_xi_a = 1, pr_xi_b = 1, missing.val = 99, verbose = FALSE )
lsirm1pl_mcar_ss( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 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_a_theta = 0.001, pr_b_theta = 0.001, pr_xi_a = 1, pr_xi_b = 1, missing.val = 99, verbose = FALSE )
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_gamma |
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_spike_mean |
Numeric; the mean of spike prior for log gamma. Default is -3. |
pr_spike_sd |
Numeric; the standard deviation of spike prior for log gamma. Default is 1. |
pr_slab_mean |
Numeric; the mean of spike prior for log gamma. Default is 0.5. |
pr_slab_sd |
Numeric; the standard deviation of spike prior for log gamma. Default is 1. |
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_xi_a |
Numeric; the first shape parameter of beta prior for latent variable xi. Default is 1. |
pr_xi_b |
Numeric; the second shape parameter of beta prior for latent variable xi. Default is 1. |
missing.val |
Numeric; a number to replace missing values. Default is 99. |
verbose |
Logical; If TRUE, MCMC samples are printed for each |
lsirm1pl_mcar_ss
models the probability of correct response by respondent to item
with item effect
, respondent effect
and the distance between latent position
of item
and latent position
of respondent
in the shared metric space, with
represents the weight of the distance term:
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. lsirm1pl_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.
lsirm1pl_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 |
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. |
gamma_estimate |
posterior estimates of gamma parameter. |
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. |
gamma |
Posterior samples of the gamma 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. |
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 |
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. |
accept_gamma |
Acceptance ratio for the gamma parameter. |
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.
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),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 <- lsirm1pl_mcar_ss(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = TRUE, fixed_gamma = FALSE, missing_data ='mcar', missing.val = 99))
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),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 <- lsirm1pl_mcar_ss(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = TRUE, fixed_gamma = FALSE, missing_data ='mcar', missing.val = 99))
lsirm1pl_normal_fixed_gamma is used to fit 1PL LSIRM for continuous variable with gamma fixed to 1. lsirm1pl_normal_fixed_gamma factorizes continuous 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 at random. The resulting latent space provides an interaction map that represents interactions between respondents and items.
lsirm1pl_normal_fixed_gamma( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 1, jump_z = 0.5, jump_w = 0.5, pr_mean_beta = 0, pr_sd_beta = 1, pr_mean_theta = 0, pr_a_theta = 0.001, pr_b_theta = 0.001, pr_a_eps = 0.001, pr_b_eps = 0.001, verbose = FALSE )
lsirm1pl_normal_fixed_gamma( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 1, jump_z = 0.5, jump_w = 0.5, pr_mean_beta = 0, pr_sd_beta = 1, pr_mean_theta = 0, pr_a_theta = 0.001, pr_b_theta = 0.001, pr_a_eps = 0.001, pr_b_eps = 0.001, verbose = FALSE )
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_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. |
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. |
verbose |
Logical; If TRUE, MCMC samples are printed for each |
lsirm1pl_normal_fixed_gamma
models the continuous value of response by respondent to item
with item effect
, respondent effect
and the distance between latent position
of item
and latent position
of respondent
in the shared metric space:
where the error .
lsirm1pl_normal_fixed_gamma
returns an object of 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. |
sigma_estimate |
Posterior estimates of the standard deviation. |
sigma |
Posterior samples of the standard deviation. |
# 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 <- lsirm1pl_normal_fixed_gamma(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = FALSE, fixed_gamma = TRUE))
# 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 <- lsirm1pl_normal_fixed_gamma(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = FALSE, fixed_gamma = TRUE))
lsirm1pl_normal_fixed_gamma_mar is used to fit 1PL LSIRM for continuous variable with gamma fixed to 1 in incomplete data assumed to be missing at random.
lsirm1pl_normal_fixed_gamma_mar factorizes continuous 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. The resulting latent space provides an interaction map that represents interactions between respondents and items.
lsirm1pl_normal_fixed_gamma_mar( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 1, jump_z = 0.5, jump_w = 0.5, pr_mean_beta = 0, pr_sd_beta = 1, pr_mean_theta = 0, 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 )
lsirm1pl_normal_fixed_gamma_mar( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 1, jump_z = 0.5, jump_w = 0.5, pr_mean_beta = 0, pr_sd_beta = 1, pr_mean_theta = 0, 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 )
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_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. |
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 |
lsirm1pl_normal_fixed_gamma_mar
models the continuous value of response by respondent to item
with item effect
, respondent effect
and the distance between latent position
of item
and latent position
of respondent
in the shared metric space:
where the error 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.
lsirm1pl_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. |
# 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 <- lsirm1pl_normal_fixed_gamma_mar(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = FALSE, fixed_gamma = TRUE, missing_data = "mar", missing.val = 99))
# 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 <- lsirm1pl_normal_fixed_gamma_mar(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = FALSE, fixed_gamma = TRUE, missing_data = "mar", missing.val = 99))
lsirm1pl_normal_fixed_gamma_mcar is used to fit 1PL LSIRM for continuous variable with gamma fixed to 1 in incomplete data assumed to be missing completely at random.
lsirm1pl_normal_fixed_gamma_mcar factorizes continuous 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. The resulting latent space provides an interaction map that represents interactions between respondents and items.
lsirm1pl_normal_fixed_gamma_mcar( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 1, jump_z = 0.5, jump_w = 0.5, pr_mean_beta = 0, pr_sd_beta = 1, pr_mean_theta = 0, 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 )
lsirm1pl_normal_fixed_gamma_mcar( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 1, jump_z = 0.5, jump_w = 0.5, pr_mean_beta = 0, pr_sd_beta = 1, pr_mean_theta = 0, 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 )
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_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. |
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 |
lsirm1pl_normal_fixed_gamma_mcar
models the continuous value of response by respondent to item
with item effect
, respondent effect
and the distance between latent position
of item
and latent position
of respondent
in the shared metric space:
where the error 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.
lsirm1pl_normal_fixed_gamma_mcar
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. |
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. |
sigma_estimate |
Posterior estimates of the standard deviation. |
sigma |
Posterior samples of the standard deviation. |
# 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 <- lsirm1pl_normal_fixed_gamma_mcar(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = FALSE, fixed_gamma = TRUE, missing_data = "mcar", missing.val = 99))
# 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 <- lsirm1pl_normal_fixed_gamma_mcar(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = FALSE, fixed_gamma = TRUE, missing_data = "mcar", missing.val = 99))
lsirm1pl_normal_mar is used to fit LSIRM for continuous variable with 1pl in incomplete data assumed to be missing at random. lsirm1pl_normal_mar factorizes continuous 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. The resulting latent space provides an interaction map that represents interactions between respondents and items.
lsirm1pl_normal_mar( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 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_mean_gamma = 0.5, pr_sd_gamma = 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 )
lsirm1pl_normal_mar( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 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_mean_gamma = 0.5, pr_sd_gamma = 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 )
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_gamma |
Numeric; the jumping rule for the gamma proposal density. Default is 0.025 |
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_gamma |
Numeric; mean of log normal prior for gamma. Default is 0.5. |
pr_sd_gamma |
Numeric; standard deviation of log normal prior for gamma. 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 |
lsirm1pl_normal_mar
models the continuous value of response by respondent to item
with item effect
, respondent effect
and the distance between latent position
of item
and latent position
of respondent
in the shared metric space, with
represents the weight of the distance term:
where the error 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.
lsirm1pl_normal_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. |
gamma_estimate |
posterior estimates of gamma parameter. |
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. |
gamma |
Posterior samples of the gamma 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. |
accept_gamma |
Acceptance ratio for the gamma parameter. |
sigma_estimate |
Posterior estimates of the standard deviation. |
sigma |
Posterior samples of the standard deviation. |
Little, R. J., & Rubin, D. B. (2019). Statistical analysis with missing data (Vol. 793). John Wiley & Sons.
# 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 <- lsirm1pl_normal_mar(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = FALSE, fixed_gamma = FALSE, missing_data ='mar', missing.val = 99))
# 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 <- lsirm1pl_normal_mar(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = FALSE, fixed_gamma = FALSE, missing_data ='mar', missing.val = 99))
lsirm1pl_normal_mar_ss is used to fit 1PL LSIRM with model selection approach based on spike-and-slab priors for continuous variable with 1pl in incomplete data assumed to be missing at random. lsirm1pl_normal_mar_ss factorizes continuous 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. The resulting latent space provides an interaction map that represents interactions between respondents and items.
lsirm1pl_normal_mar_ss( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 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_a_theta = 0.001, pr_b_theta = 0.001, pr_a_eps = 0.001, pr_b_eps = 0.001, pr_xi_a = 0.001, pr_xi_b = 0.001, missing.val = 99, verbose = FALSE )
lsirm1pl_normal_mar_ss( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 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_a_theta = 0.001, pr_b_theta = 0.001, pr_a_eps = 0.001, pr_b_eps = 0.001, pr_xi_a = 0.001, pr_xi_b = 0.001, missing.val = 99, verbose = FALSE )
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_gamma |
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_spike_mean |
Numeric; the mean of spike prior for log gamma. Default is -3. |
pr_spike_sd |
Numeric; the standard deviation of spike prior for log gamma. Default is 1. |
pr_slab_mean |
Numeric; the mean of spike prior for log gamma. Default is 0.5. |
pr_slab_sd |
Numeric; the standard deviation of spike prior for log gamma. Default is is 1. |
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. |
pr_xi_a |
Numeric; the first shape parameter of beta prior for latent variable xi. Default is 1. |
pr_xi_b |
Numeric; the second shape parameter of beta prior for latent variable xi. Default is 1. |
missing.val |
Numeric; a number to replace missing values. Default is 99. |
verbose |
Logical; If TRUE, MCMC samples are printed for each |
lsirm1pl_normal_mar_ss
models the continuous value of response by respondent to item
with item effect
, respondent effect
and the distance between latent position
of item
and latent position
of respondent
in the shared metric space, with
represents the weight of the distance term:
where the error 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.
lsirm1pl_normal_mar_ss
model include model selection approach based on spike-and-slab priors for log gamma. For detail of spike-and-slab priors, see References.
lsirm1pl_normal_mar_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 |
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. |
gamma_estimate |
posterior estimates of gamma parameter. |
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. |
gamma |
Posterior samples of the gamma 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. |
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. |
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. |
accept_gamma |
Acceptance ratio for the gamma parameter. |
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. |
imp_estimate |
Probability of imputating a missing value with 1. |
sigma_estimate |
Posterior estimates of the standard deviation. |
sigma |
Posterior samples of the standard deviation. |
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.
# 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 <- lsirm1pl_normal_mar_ss(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = TRUE, fixed_gamma = FALSE, missing_data = 'mar', missing = 99))
# 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 <- lsirm1pl_normal_mar_ss(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = TRUE, fixed_gamma = FALSE, missing_data = 'mar', missing = 99))
lsirm1pl_normal_mcar is used to fit LSIRM with 1pl in incomplete data assumed to be missing completely at random. lsirm1pl_normal_mcar factorizes continuous 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. The resulting latent space provides an interaction map that represents interactions between respondents and items.
lsirm1pl_normal_mcar( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 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_mean_gamma = 0.5, pr_sd_gamma = 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 )
lsirm1pl_normal_mcar( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 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_mean_gamma = 0.5, pr_sd_gamma = 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 )
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_gamma |
Numeric; the jumping rule for the gamma proposal density. Default is 0.025 |
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_gamma |
Numeric; mean of log normal prior for gamma. Default is 0.5. |
pr_sd_gamma |
Numeric; standard deviation of log normal prior for gamma. 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 |
lsirm1pl_normal_mcar
models the continuous value of response by respondent to item
with item effect
, respondent effect
and the distance between latent position
of item
and latent position
of respondent
in the shared metric space, with
represents the weight of the distance term:
where the error Under the assumption of missing completely at random, the model ignores the missing element in doing inference. For the details of missing at random assumption and data augmentation, see References.
lsirm1pl_normal_mcar
returns an object of list containing the following components:
data |
A data frame or matrix containing the variables used 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. |
gamma_estimate |
Posterior estimates of gamma parameter. |
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. |
gamma |
Posterior samples of the gamma parameter. |
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. |
accept_gamma |
Acceptance ratio for the gamma parameter. |
sigma_estimate |
Posterior estimates of the standard deviation. |
sigma |
Posterior samples of the standard deviation. |
Little, R. J., & Rubin, D. B. (2019). Statistical analysis with missing data (Vol. 793). John Wiley & Sons.
# 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 <- lsirm1pl_normal_mcar(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = FALSE, fixed_gamma = FALSE, missing_data ='mcar', missing.val = 99))
# 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 <- lsirm1pl_normal_mcar(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = FALSE, fixed_gamma = FALSE, missing_data ='mcar', missing.val = 99))
lsirm1pl_normal_mcar_ss is used to fit LSIRM with model selection approach based on spike-and-slab priors for continuous variable with 1pl in incomplete data assumed to be missing completely at random. lsirm1pl_normal_mcar_ss factorizes continuous 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. The resulting latent space provides an interaction map that represents interactions between respondents and items.
lsirm1pl_normal_mcar_ss( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 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_a_theta = 0.001, pr_b_theta = 0.001, pr_a_eps = 0.001, pr_b_eps = 0.001, pr_xi_a = 0.001, pr_xi_b = 0.001, missing.val = 99, verbose = FALSE )
lsirm1pl_normal_mcar_ss( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 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_a_theta = 0.001, pr_b_theta = 0.001, pr_a_eps = 0.001, pr_b_eps = 0.001, pr_xi_a = 0.001, pr_xi_b = 0.001, missing.val = 99, verbose = FALSE )
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_gamma |
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_spike_mean |
Numeric; the mean of spike prior for log gamma. Default is -3. |
pr_spike_sd |
Numeric; the standard deviation of spike prior for log gamma. Default is 1. |
pr_slab_mean |
Numeric; the mean of spike prior for log gamma. Default is 0.5. |
pr_slab_sd |
Numeric; the standard deviation of spike prior for log gamma. Default is is 1. |
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. |
pr_xi_a |
Numeric; the first shape parameter of beta prior for latent variable xi. Default is 1. |
pr_xi_b |
Numeric; the second shape parameter of beta prior for latent variable xi. Default is 1. |
missing.val |
Numeric; a number to replace missing values. Default is 99. |
verbose |
Logical; If TRUE, MCMC samples are printed for each |
lsirm1pl_normal_mcar_ss
models the continuous value of response by respondent to item
with item effect
, respondent effect
and the distance between latent position
of item
and latent position
of respondent
in the shared metric space, with
represents the weight of the distance term:
where the error . Under the assumption of missing completely at random, the model ignores the missing element in doing inference. For the details of missing at random assumption and data augmentation, see References.
lsirm1pl_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.
lsirm1pl_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 |
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. |
gamma_estimate |
posterior estimates of gamma parameter. |
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. |
gamma |
Posterior samples of the gamma 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. |
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 |
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. |
accept_gamma |
Acceptance ratio for the gamma parameter. |
sigma_estimate |
Posterior estimates of the standard deviation. |
sigma |
Posterior samples of the standard deviation. |
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.
# 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 <- lsirm1pl_normal_mcar_ss(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = TRUE, fixed_gamma = FALSE, missing_data ='mcar', missing.val = 99))
# 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 <- lsirm1pl_normal_mcar_ss(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = TRUE, fixed_gamma = FALSE, missing_data ='mcar', missing.val = 99))
lsirm1pl_normal_o is used to fit LSIRM for continuous variable with 1pl. lsirm1pl_normal_o factorizes continuous item response matrix into column-wise item effect, row-wise respondent effect and further embeds interaction effect in a latent space. The resulting latent space provides an interaction map that represents interactions between respondents and items.
lsirm1pl_normal_o( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 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_mean_gamma = 0.5, pr_sd_gamma = 1, pr_a_theta = 0.001, pr_b_theta = 0.001, pr_a_eps = 0.001, pr_b_eps = 0.001, verbose = FALSE )
lsirm1pl_normal_o( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 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_mean_gamma = 0.5, pr_sd_gamma = 1, pr_a_theta = 0.001, pr_b_theta = 0.001, pr_a_eps = 0.001, pr_b_eps = 0.001, verbose = FALSE )
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_gamma |
Numeric; the jumping rule for the gamma proposal density. Default is 0.025 |
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_gamma |
Numeric; mean of log normal prior for gamma. Default is 0.5. |
pr_sd_gamma |
Numeric; standard deviation of log normal prior for gamma. 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. |
verbose |
Logical; If TRUE, MCMC samples are printed for each |
lsirm1pl_normal_o
models the continuous value of response by respondent to item
with item effect
, respondent effect
and the distance between latent position
of item
and latent position
of respondent
in the shared metric space, with
represents the weight of the distance term:
where the error .
lsirm1pl_normal_o
returns an object of list containing the following components:
data |
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. |
gamma_estimate |
Posterior estimates of gamma parameter. |
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. |
gamma |
Posterior samples of the gamma parameter. |
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. |
accept_gamma |
Acceptance ratio for the gamma parameter. |
sigma_estimate |
Posterior estimates of the standard deviation. |
sigma |
Posterior samples of the standard deviation. |
# generate example (continuous) item response matrix data <- matrix(rnorm(500, mean = 0, sd = 1),ncol=10,nrow=50) lsirm_result <- lsirm1pl_normal_o(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = FALSE, fixed_gamma = FALSE))
# generate example (continuous) item response matrix data <- matrix(rnorm(500, mean = 0, sd = 1),ncol=10,nrow=50) lsirm_result <- lsirm1pl_normal_o(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = FALSE, fixed_gamma = FALSE))
lsirm1pl_normal_ss is used to fit LSIRM with model selection approach based on spike-and-slab priors for continuous variable with 1pl. LSIRM factorizes continuous item response matrix into column-wise item effect, row-wise respondent effect and further embeds interaction effect in a latent space. The resulting latent space provides an interaction map that represents interactions between respondents and items.
lsirm1pl_normal_ss( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 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_a_theta = 0.001, pr_b_theta = 0.001, pr_a_eps = 0.001, pr_b_eps = 0.001, pr_xi_a = 0.001, pr_xi_b = 0.001, verbose = FALSE )
lsirm1pl_normal_ss( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 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_a_theta = 0.001, pr_b_theta = 0.001, pr_a_eps = 0.001, pr_b_eps = 0.001, pr_xi_a = 0.001, pr_xi_b = 0.001, verbose = FALSE )
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_gamma |
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_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_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; shape parameter of inverse gamma prior for variance of data likelihood. Default is 0.001. |
pr_b_eps |
Numeric; scale parameter of inverse gamma prior for variance of data likelihood. Default is 0.001. |
pr_xi_a |
Numeric; first shape parameter of beta prior for latent variable xi. Default is 1. |
pr_xi_b |
Numeric; second shape parameter of beta prior for latent variable xi. Default is 1. |
verbose |
Logical; If TRUE, MCMC samples are printed for each |
lsirm1pl_normal_ss
models the continuous value of response by respondent to item
with item effect
, respondent effect
and the distance between latent position
of item
and latent position
of respondent
in the shared metric space, with
represents the weight of the distance term:
where the error .
lsrm1pl_noraml_ss
model include model selection approach based on spike-and-slab priors for log gamma. For detail of spike-and-slab priors, see References.
lsirm1pl_normal_ss
returns an object of list containing the following components:
data |
Data frame or matrix containing the variables in the model. |
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. |
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. |
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. |
Ishwaran, H., & Rao, J. S. (2005). Spike and slab variable selection: Frequentist and Bayesian strategies (Vol. 33). The Annals of Statistics
# generate example (continuous) item response matrix data <- matrix(rnorm(500, mean = 0, sd = 1),ncol=10,nrow=50) lsirm_result <- lsirm1pl_normal_ss(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = TRUE, fixed_gamma = FALSE))
# generate example (continuous) item response matrix data <- matrix(rnorm(500, mean = 0, sd = 1),ncol=10,nrow=50) lsirm_result <- lsirm1pl_normal_ss(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = TRUE, fixed_gamma = FALSE))
lsirm1pl_o is used to fit 1PL LSIRM. lsirm1pl_o factorizes item response matrix into column-wise item effect, row-wise respondent effect and further embeds interaction effect in a latent space. The resulting latent space provides an interaction map that represents interactions between respondents and items.
lsirm1pl_o( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 1, jump_gamma = 0.025, jump_z = 0.5, jump_w = 0.5, pr_mean_beta = 0, pr_sd_beta = 1, pr_mean_theta = 0, pr_mean_gamma = 0.5, pr_sd_gamma = 1, pr_a_theta = 0.001, pr_b_theta = 0.001, verbose = FALSE )
lsirm1pl_o( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 1, jump_gamma = 0.025, jump_z = 0.5, jump_w = 0.5, pr_mean_beta = 0, pr_sd_beta = 1, pr_mean_theta = 0, pr_mean_gamma = 0.5, pr_sd_gamma = 1, pr_a_theta = 0.001, pr_b_theta = 0.001, verbose = FALSE )
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_gamma |
Numeric; the jumping rule for the gamma proposal density. Default is 0.025. |
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_gamma |
Numeric; mean of log normal prior for gamma. Default is 0.5. |
pr_sd_gamma |
Numeric; standard deviation of log normal prior for gamma. 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. |
verbose |
Logical; If TRUE, MCMC samples are printed for each |
lsirm1pl_o
models the probability of correct response by respondent to item
with item effect
, respondent effect
and the distance between latent position
of item
and latent position
of respondent
in the shared metric space, with
represents the weight of the distance term:
lsirm1pl_o
returns an object of list containing the following components:
data |
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. |
gamma_estimate |
Posterior estimates of gamma parameter. |
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. |
gamma |
Posterior samples of the gamma parameter. |
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. |
accept_gamma |
Acceptance ratio for the gamma parameter. |
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),ncol=10,nrow=50) lsirm_result <- lsirm1pl_o(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = FALSE, fixed_gamma = FALSE))
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),ncol=10,nrow=50) lsirm_result <- lsirm1pl_o(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = FALSE, fixed_gamma = FALSE))
lsirm1pl_ss is used to fit 1PL LSIRM with model selection approach based on spike-and-slab priors. LSIRM factorizes item response matrix into column-wise item effect, row-wise respondent effect and further embeds interaction effect in a latent space. The resulting latent space provides an interaction map that represents interactions between respondents and items.
lsirm1pl_ss( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 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_a_theta = 0.001, pr_b_theta = 0.001, pr_xi_a = 1, pr_xi_b = 1, verbose = FALSE )
lsirm1pl_ss( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 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_a_theta = 0.001, pr_b_theta = 0.001, pr_xi_a = 1, pr_xi_b = 1, verbose = FALSE )
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_gamma |
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_spike_mean |
Numeric; the mean of spike prior for log gamma. Default is -3. |
pr_spike_sd |
Numeric; the standard deviation of spike prior for log gamma. Default is 1. |
pr_slab_mean |
Numeric; the mean of spike prior for log gamma. Default is 0.5. |
pr_slab_sd |
Numeric; the standard deviation of spike prior for log gamma. Default is is 1. |
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_xi_a |
Numeric; the first shape parameter of beta prior for latent variable xi. Default is 1. |
pr_xi_b |
Numeric; the second shape parameter of beta prior for latent variable xi. Default is 1. |
verbose |
Logical; If TRUE, MCMC samples are printed for each |
lsirm1pl_ss
models the probability of correct response by respondent to item
with item effect
, respondent effect
and the distance between latent position
of item
and latent position
of respondent
in the shared metric space, with
represents the weight of the distance term:
lsirm1pl_ss
model include model selection approach based on spike-and-slab priors for log gamma. For detail of spike-and-slab priors, see References.
lsirm1pl_ss
returns an object of list containing the following components:
data |
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. |
gamma_estimate |
Posterior estimates of gamma parameter. |
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. |
gamma |
Posterior samples of the gamma parameter. |
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. |
accept_gamma |
Acceptance ratio for the gamma parameter. |
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. |
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. |
Ishwaran, H., & Rao, J. S. (2005). Spike and slab variable selection: Frequentist and Bayesian strategies (Vol. 33). The Annals of Statistics
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),ncol=10,nrow=50) lsirm_result <- lsirm1pl_ss(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = TRUE, fixed_gamma = FALSE))
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),ncol=10,nrow=50) lsirm_result <- lsirm1pl_ss(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = TRUE, fixed_gamma = FALSE))
lsirm2pl
integrates all functions related to 2PL LSIRM. Various 2PL 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.
lsirm2pl( data, spikenslab = FALSE, fixed_gamma = FALSE, missing_data = NA, chains = 1, multicore = 1, seed = NA, 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_a_theta = 0.001, pr_b_theta = 0.001, pr_mean_alpha = 0.5, pr_sd_alpha = 1, ... )
lsirm2pl( data, spikenslab = FALSE, fixed_gamma = FALSE, missing_data = NA, chains = 1, multicore = 1, seed = NA, 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_a_theta = 0.001, pr_b_theta = 0.001, pr_mean_alpha = 0.5, pr_sd_alpha = 1, ... )
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_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_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_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. |
... |
Additional arguments for the for various settings. Refer to the functions in the Details. |
Additional arguments and return values for each function are documented in the respective function's description.
* For 2PL LSIRM with data included missing value are detailed in lsirm2pl_mar and lsirm2pl_mcar.
* For 2PL LSIRM using the spike-and-slab model selection approach are detailed in lsirm2pl_ss.
* For continuous version of 2PL LSIRM are detailed in lsirm2pl_normal_o.
For 2PL LSIRM with binary item response data, the probability of correct response by respondent to item
with item effect
, respondent effect
and the distance between latent position
of item
and latent position
of respondent
in the shared metric space, with
represents the weight of the distance term. For 2pl model, the the item effect is assumed to have additional discrimination parameter
multiplied by
:
For 2PL LSIRM with continuous item response data, the continuous value of response by respondent to item
with item effect
, respondent effect
and the distance between latent position
of item
and latent position
of respondent
in the shared metric space, with
represents the weight of the distance term. For 2pl model, the the item effect is assumed to have additional discrimination parameter
multiplied by
:
where the error
lsirm2pl
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. |
alpha_estimate |
posterior estimates of alpha parameter.. |
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. |
alpha |
Posterior samples of the alpha parameter. |
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. |
accept_alpha |
Acceptance ratio for the alpha parameter. |
... |
Additional return values for various settings. Refer to the functions in the Details. |
If both spikenslab
and fixed_gamma
are set TRUE
, it returns error because both are related to gamma
.
The 2PL LSIRM for binary item response data as following:
lsirm2pl_o
, lsirm2pl_fixed_gamma
, lsirm2pl_mar
,lsirm2pl_mcar
, lsirm2pl_fixed_gamma_mar
, lsirm2pl_fixed_gamma_mcar
, lsirm2pl_ss
, lsirm2pl_mar_ss
, and lsirm2pl_mcar_ss
The 2PL LSIRM for continuous item response data as following:
lsirm2pl_normal_o
, lsirm2pl_normal_fixed_gamma
, lsirm2pl_normal_mar
, lsirm2pl_normal_mcar
,lsirm1pl_normal_fixed_gamma_mar
, lsirm2pl_normal_fixed_gamma_mcar
, lsirm2pl_normal_ss
, lsirm2pl_normal_mar_ss
, lsirm2pl_normal_mcar_ss
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),ncol=10,nrow=50) lsirm_result <- lsirm2pl(data) # The code following can achieve the same result. lsirm_result <- lsirm(data~lsirm2pl())
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),ncol=10,nrow=50) lsirm_result <- lsirm2pl(data) # The code following can achieve the same result. lsirm_result <- lsirm(data~lsirm2pl())
lsirm2pl_fixed_gamma is used to fit 2PL LSIRM fixing gamma to 1. lsirm2pl_fixed_gamma factorizes item response matrix into column-wise item effect, row-wise respondent effect and further embeds interaction effect in a latent space. 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.
lsirm2pl_fixed_gamma( 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, verbose = FALSE )
lsirm2pl_fixed_gamma( 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, verbose = FALSE )
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. |
verbose |
Logical; If TRUE, MCMC samples are printed for each |
lsirm2pl_fixed_gamma
models the probability of correct response by respondent to item
with item effect
, respondent effect
and the distance between latent position
of item
and latent position
of respondent
in the shared metric space. For 2pl model, the the item effect is assumed to have additional discrimination parameter
multiplied by
:
lsirm2pl_fixed_gamma
returns an object of list containing the following components:
lsirm1pl_fixed_gamma
returns an object of list containing the following components:
data |
Data frame or matrix containing the variables in the model. |
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. |
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. |
alpha_estimate |
Posterior estimates of the alpha parameter. |
alpha |
Posterior estimates of the alpha parameter. |
accept_alpha |
Acceptance ratio for the alpha parameter. |
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),ncol=10,nrow=50) lsirm_result <- lsirm2pl_fixed_gamma(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm2pl(spikenslab = FALSE, fixed_gamma = TRUE))
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),ncol=10,nrow=50) lsirm_result <- lsirm2pl_fixed_gamma(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm2pl(spikenslab = FALSE, fixed_gamma = TRUE))
lsirm2pl_fixed_gamma_mar is used to fit 2PL LSIRM fixing gamma to 1 in incomplete data assumed to be missing at random. lsirm2pl_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.
lsirm2pl_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, missing.val = 99, verbose = FALSE )
lsirm2pl_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, missing.val = 99, verbose = FALSE )
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. |
missing.val |
Numeric; A number to replace missing values. Default is 99. |
verbose |
Logical; If TRUE, MCMC samples are printed for each |
lsirm2pl_fixed_gamma_mar
models the probability of correct response by respondent to item
with item effect
, respondent effect
and the distance between latent position
of item
and latent position
of respondent
in the shared metric space. For 2pl model, the the item effect is assumed to have additional discrimination parameter
multiplied by
:
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.
lsirm2pl_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. |
alpha_estimate |
Posterior estimates of the alpha parameter. |
alpha |
Posterior estimates of the alpha parameter. |
accept_alpha |
Acceptance ratio for the alpha parameter. |
Little, R. J., & Rubin, D. B. (2019). Statistical analysis with missing data (Vol. 793). John Wiley & Sons.
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),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_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"))
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),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_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"))
lsirm2pl_fixed_gamma_mcar is used to fit 2PL LSIRM fixing gamma to 1 in incomplete data assumed to be missing completely at random. lsirm2pl_fixed_gamma_mcar 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.
lsirm2pl_fixed_gamma_mcar( 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, missing.val = 99, verbose = FALSE )
lsirm2pl_fixed_gamma_mcar( 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, missing.val = 99, verbose = FALSE )
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. |
missing.val |
Numeric; A number to replace missing values. Default is 99. |
verbose |
Logical; If TRUE, MCMC samples are printed for each |
lsirm2pl_fixed_gamma_mcar
models the probability of correct response by respondent to item
with item effect
, respondent effect
and the distance between latent position
of item
and latent position
of respondent
in the shared metric space. For 2pl model, the the item effect is assumed to have additional discrimination parameter
multiplied by
:
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_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. |
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. |
alpha_estimate |
Posterior estimates of the alpha parameter. |
alpha |
Posterior estimates of the alpha parameter. |
accept_alpha |
Acceptance ratio for the alpha parameter. |
Little, R. J., & Rubin, D. B. (2019). Statistical analysis with missing data (Vol. 793). John Wiley & Sons.
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),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_fixed_gamma_mcar(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm2pl(spikenslab = FALSE, fixed_gamma = TRUE, missing_data = "mcar"))
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),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_fixed_gamma_mcar(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm2pl(spikenslab = FALSE, fixed_gamma = TRUE, missing_data = "mcar"))
lsirm2pl_mar is used to fit 2PL LSIRM in incomplete data assumed to be missing at random. lsirm2pl_mar factorizes item response matrix into column-wise item effect, row-wise respondent 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.
lsirm2pl_mar( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 1, jump_alpha = 1, jump_gamma = 0.025, jump_z = 0.5, jump_w = 0.5, pr_mean_beta = 0, pr_sd_beta = 1, pr_mean_theta = 0, pr_mean_gamma = 0.5, pr_sd_gamma = 1, pr_mean_alpha = 0.5, pr_sd_alpha = 1, pr_a_theta = 0.001, pr_b_theta = 0.001, missing.val = 99, verbose = FALSE )
lsirm2pl_mar( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 1, jump_alpha = 1, jump_gamma = 0.025, jump_z = 0.5, jump_w = 0.5, pr_mean_beta = 0, pr_sd_beta = 1, pr_mean_theta = 0, pr_mean_gamma = 0.5, pr_sd_gamma = 1, pr_mean_alpha = 0.5, pr_sd_alpha = 1, pr_a_theta = 0.001, pr_b_theta = 0.001, missing.val = 99, verbose = FALSE )
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_gamma |
Numeric; the jumping rule for the gamma proposal density. Default is 0.025. |
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_gamma |
Numeric; mean of log normal prior for gamma. Default is 0.5. |
pr_sd_gamma |
Numeric; standard deviation of log normal prior for gamma. Default is 1.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. |
missing.val |
Numeric; A number to replace missing values. Default is 99. |
verbose |
Logical; If TRUE, MCMC samples are printed for each |
lsirm2pl_mar
models the probability of correct response by respondent to item
with item effect
, respondent effect
in the shared metric space, with
represents the weight of the distance term. For 2pl model, the the item effect is assumed to have additional discrimination parameter
multiplied by
:
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.
lsirm2pl_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. |
gamma_estimate |
posterior estimates of gamma parameter. |
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. |
gamma |
Posterior samples of the gamma 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. |
accept_gamma |
Acceptance ratio for the gamma parameter. |
alpha_estimate |
Posterior estimates of the alpha parameter. |
alpha |
Posterior estimates of the alpha parameter. |
accept_alpha |
Acceptance ratio for the alpha parameter. |
Little, R. J., & Rubin, D. B. (2019). Statistical analysis with missing data (Vol. 793). John Wiley & Sons.
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5), 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_mar(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm2pl(spikenslab = FALSE, fixed_gamma = FALSE, missing_data = "mar"))
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5), 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_mar(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm2pl(spikenslab = FALSE, fixed_gamma = FALSE, missing_data = "mar"))
lsirm2pl_mar_ss is used to fit 2PL LSIRM based on spike-and-slab priors in incomplete data assumed to be missing at random. lsirm2pl_mar_ss factorizes item response matrix into column-wise item effect, row-wise respondent 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.
lsirm2pl_mar_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_theta = 0.001, pr_b_theta = 0.001, pr_xi_a = 1, pr_xi_b = 1, missing.val = 99, verbose = FALSE )
lsirm2pl_mar_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_theta = 0.001, pr_b_theta = 0.001, pr_xi_a = 1, pr_xi_b = 1, missing.val = 99, verbose = FALSE )
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_gamma |
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_spike_mean |
Numeric; the mean of spike prior for log gamma. Default is -3. |
pr_spike_sd |
Numeric; the standard deviation of spike prior for log gamma. Default is 1. |
pr_slab_mean |
Numeric; the mean of spike prior for log gamma. Default is 0.5. |
pr_slab_sd |
Numeric; the standard deviation of spike prior for log gamma. Default is is 1. |
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_xi_a |
Numeric; the first shape parameter of beta prior for latent variable xi. Default is 1. |
pr_xi_b |
Numeric; the second shape parameter of beta prior for latent variable xi. Default is 1. |
missing.val |
Numeric; a number to replace missing values. Default is 99. |
verbose |
Logical; If TRUE, MCMC samples are printed for each |
lsirm2pl_mar_ss
models the probability of correct response by respondent to item
with item effect
, respondent effect
in the shared metric space, with
represents the weight of the distance term. For 2pl model, the the item effect is assumed to have additional discrimination parameter
multiplied by
:
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. lsirm2pl_mar_ss
model include model selection approach based on spike-and-slab priors for log gamma. For detail of spike-and-slab priors, see References.
lsirm2pl_mar_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 |
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. |
gamma_estimate |
posterior estimates of gamma parameter. |
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. |
gamma |
Posterior samples of the gamma 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. |
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. |
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. |
accept_gamma |
Acceptance ratio for the gamma parameter. |
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. |
imp_estimate |
Probability of imputating a missing value with 1. |
alpha_estimate |
Posterior estimates of the alpha parameter. |
alpha |
Posterior estimates of the alpha parameter. |
accept_alpha |
Acceptance ratio for the alpha parameter. |
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.
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5), 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_mar_ss(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm2pl(spikenslab = TRUE, fixed_gamma = FALSE, missing_data = "mar"))
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5), 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_mar_ss(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm2pl(spikenslab = TRUE, fixed_gamma = FALSE, missing_data = "mar"))
lsirm2pl_mcar is used to fit 2PL LSIRM in incomplete data assumed to be missing completely at random. lsirm2pl_mcar factorizes item response matrix into column-wise item effect, row-wise respondent 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.
lsirm2pl_mcar( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 1, jump_alpha = 1, jump_gamma = 0.025, jump_z = 0.5, jump_w = 0.5, pr_mean_beta = 0, pr_sd_beta = 1, pr_mean_theta = 0, pr_mean_gamma = 0.5, pr_sd_gamma = 1, pr_mean_alpha = 0.5, pr_sd_alpha = 1, pr_a_theta = 0.001, pr_b_theta = 0.001, missing.val = 99, verbose = FALSE )
lsirm2pl_mcar( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 1, jump_alpha = 1, jump_gamma = 0.025, jump_z = 0.5, jump_w = 0.5, pr_mean_beta = 0, pr_sd_beta = 1, pr_mean_theta = 0, pr_mean_gamma = 0.5, pr_sd_gamma = 1, pr_mean_alpha = 0.5, pr_sd_alpha = 1, pr_a_theta = 0.001, pr_b_theta = 0.001, missing.val = 99, verbose = FALSE )
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_gamma |
Numeric; the jumping rule for the gamma proposal density. Default is 0.025 |
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_gamma |
Numeric; mean of log normal prior for gamma. Default is 0.5. |
pr_sd_gamma |
Numeric; standard deviation of log normal prior for gamma. Default is 1.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. |
missing.val |
Numeric; A number to replace missing values. Default is 99. |
verbose |
Logical; If TRUE, MCMC samples are printed for each |
lsirm2pl_mcar
models the probability of correct response by respondent to item
with item effect
, respondent effect
in the shared metric space, with
represents the weight of the distance term. For 2pl model, the the item effect is assumed to have additional discrimination parameter
multiplied by
:
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_mar
returns an object of list containing the following components:
data |
A data frame or matrix containing the variables used 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. |
gamma_estimate |
Posterior estimates of gamma parameter. |
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. |
gamma |
Posterior samples of the gamma parameter. |
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. |
accept_gamma |
Acceptance ratio for the gamma parameter. |
alpha_estimate |
Posterior estimates of the alpha parameter. |
alpha |
Posterior estimates of the alpha parameter. |
accept_alpha |
Acceptance ratio for the alpha parameter. |
Little, R. J., & Rubin, D. B. (2019). Statistical analysis with missing data (Vol. 793). John Wiley & Sons.
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5), 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_mcar(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm2pl(spikenslab = FALSE, fixed_gamma = FALSE, missing_data = "mcar"))
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5), 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_mcar(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm2pl(spikenslab = FALSE, fixed_gamma = FALSE, missing_data = "mcar"))
lsirm2pl_mar_ss is used to fit 2PL LSIRM based on spike-and-slab priors in incomplete data assumed to be missing completely at random. lsirm2pl_mar_ss factorizes item response matrix into column-wise item effect, row-wise respondent 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.
lsirm2pl_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_theta = 0.001, pr_b_theta = 0.001, pr_xi_a = 1, pr_xi_b = 1, missing.val = 99, verbose = FALSE )
lsirm2pl_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_theta = 0.001, pr_b_theta = 0.001, pr_xi_a = 1, pr_xi_b = 1, missing.val = 99, verbose = FALSE )
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_gamma |
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_spike_mean |
Numeric; the mean of spike prior for log gamma. Default is -3. |
pr_spike_sd |
Numeric; the standard deviation of spike prior for log gamma. Default is 1. |
pr_slab_mean |
Numeric; the mean of spike prior for log gamma. Default is 0.5. |
pr_slab_sd |
Numeric; the standard deviation of spike prior for log gamma. Default is 1. |
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_xi_a |
Numeric; the first shape parameter of beta prior for latent variable xi. Default is 1. |
pr_xi_b |
Numeric; the second shape parameter of beta prior for latent variable xi. Default is 1. |
missing.val |
Numeric; a number to replace missing values. Default is 99. |
verbose |
Logical; If TRUE, MCMC samples are printed for each |
lsirm2pl_mcar_ss
models the probability of correct response by respondent to item
with item effect
, respondent effect
in the shared metric space, with
represents the weight of the distance term. For 2pl model, the the item effect is assumed to have additional discrimination parameter
multiplied by
:
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. lsirm2pl_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.
lsirm2pl_mar_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 |
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. |
gamma_estimate |
posterior estimates of gamma parameter. |
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. |
gamma |
Posterior samples of the gamma 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. |
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 |
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. |
accept_gamma |
Acceptance ratio for the gamma parameter. |
alpha_estimate |
Posterior estimates of the alpha parameter. |
alpha |
Posterior estimates of the alpha parameter. |
accept_alpha |
Acceptance ratio for the alpha parameter. |
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.
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5), 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_mcar_ss(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm2pl(spikenslab = TRUE, fixed_gamma = FALSE, missing_data = "mcar"))
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5), 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_mcar_ss(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm2pl(spikenslab = TRUE, fixed_gamma = FALSE, missing_data = "mcar"))
lsirm2pl_normal_fixed_gamma is used to fit 2PL LSIRM with gamma fixed to 1 for continuous variable. lsirm2pl_normal_fixed_gamma factorizes item response matrix into column-wise item effect, row-wise respondent effect and further embeds interaction effect in a latent space. 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.
lsirm2pl_normal_fixed_gamma( 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, verbose = FALSE )
lsirm2pl_normal_fixed_gamma( 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, verbose = FALSE )
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. |
verbose |
Logical; If TRUE, MCMC samples are printed for each |
lsirm2pl_normal_fixed_gamma
models the continuous value of response by respondent to item
with item effect
, respondent effect
and the distance between latent position
of item
and latent position
of respondent
in the shared metric space. For 2pl model, the the item effect is assumed to have additional discrimination parameter
multiplied by
:
where the error
lsirm2pl_normal_fixed_gamma
returns an object of 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. |
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. |
# generate example (continuous) item response matrix data <- matrix(rnorm(500, mean = 0, sd = 1),ncol=10,nrow=50) lsrm_result <- lsirm2pl_normal_fixed_gamma(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm2pl(spikenslab = FALSE, fixed_gamma = TRUE))
# generate example (continuous) item response matrix data <- matrix(rnorm(500, mean = 0, sd = 1),ncol=10,nrow=50) lsrm_result <- lsirm2pl_normal_fixed_gamma(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm2pl(spikenslab = FALSE, fixed_gamma = TRUE))
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.
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 )
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 )
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 |
lsirm2pl_normal_fixed_gamma_mar
models the continuous value of response by respondent to item
with item effect
, respondent effect
and the distance between latent position
of item
and latent position
of respondent
in the shared metric space. For 2pl model, the the item effect is assumed to have additional discrimination parameter
multiplied by
:
where the error 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.
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. |
# 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"))
# 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"))
lsirm2pl_normal_fixed_gamma_mcar is used to fit 2PL LSIRM with gamma fixed to 1 for continuous variable in incomplete data assumed to be missing completely at random.
lsirm2pl_normal_fixed_gamma_mcar 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.
lsirm2pl_normal_fixed_gamma_mcar( 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 )
lsirm2pl_normal_fixed_gamma_mcar( 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 )
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 |
lsirm2pl_normal_fixed_gamma_mcar
models the continuous value of response by respondent to item
with item effect
, respondent effect
and the distance between latent position
of item
and latent position
of respondent
in the shared metric space. For 2pl model, the the item effect is assumed to have additional discrimination parameter
multiplied by
:
where the error 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_fixed_gamma_mcar
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. |
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. |
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. |
# 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_mcar(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm2pl(spikenslab = FALSE, fixed_gamma = TRUE, missing_data = "mcar"))
# 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_mcar(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm2pl(spikenslab = FALSE, fixed_gamma = TRUE, missing_data = "mcar"))
lsirm2pl_normal_mar is used to fit 2PL LSIRM for continuous variable in incomplete data assumed to be missing at random. lsirm2pl_normal_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.
lsirm2pl_normal_mar( 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_mean_gamma = 0.5, pr_sd_gamma = 1, 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 )
lsirm2pl_normal_mar( 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_mean_gamma = 0.5, pr_sd_gamma = 1, 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 )
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_gamma |
Numeric; the jumping rule for the gamma proposal density. Default is 0.025 |
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_gamma |
Numeric; mean of log normal prior for gamma. Default is 0.5. |
pr_sd_gamma |
Numeric; standard deviation of log normal prior for gamma. Default is 1.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 |
lsirm2pl_normal_mar
models the continuous value of response by respondent to item
with item effect
, respondent effect
and the distance between latent position
of item
and latent position
of respondent
in the shared metric space, with
represents the weight of the distance term. For 2pl model, the the item effect is assumed to have additional discrimination parameter
multiplied by
:
where the error 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.
lsirm2pl_normal_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. |
gamma_estimate |
posterior estimates of gamma parameter. |
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. |
gamma |
Posterior samples of the gamma 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. |
accept_gamma |
Acceptance ratio for the gamma 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. |
Little, R. J., & Rubin, D. B. (2019). Statistical analysis with missing data (Vol. 793). John Wiley & Sons.
# 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_mar(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm2pl(spikenslab = FALSE, fixed_gamma = FALSE, missing_data = "mar"))
# 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_mar(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm2pl(spikenslab = FALSE, fixed_gamma = FALSE, missing_data = "mar"))
lsirm2pl_normal_mar_ss is used to fit 2pl LSIRM with model selection approach based on spike-and-slab priors for continuous variable in incomplete data assumed to be missing at random. lsirm2pl_normal_mar_ss 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.
lsirm2pl_normal_mar_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 )
lsirm2pl_normal_mar_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 )
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_gamma |
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_spike_mean |
Numeric; the mean of spike prior for log gamma. Default is -3. |
pr_spike_sd |
Numeric; the standard deviation of spike prior for log gamma. Default is 1. |
pr_slab_mean |
Numeric; the mean of spike prior for log gamma. Default is 0.5. |
pr_slab_sd |
Numeric; the standard deviation of spike prior for log gamma. Default is is 1. |
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_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. |
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_xi_a |
Numeric; the first shape parameter of beta prior for latent variable xi. Default is 1. |
pr_xi_b |
Numeric; the second shape parameter of beta prior for latent variable xi. Default is 1. |
missing.val |
Numeric; a number to replace missing values. Default is 99. |
verbose |
Logical; If TRUE, MCMC samples are printed for each |
lsirm2pl_normal_mar_ss
models the continuous value of response by respondent to item
with item effect
, respondent effect
and the distance between latent position
of item
and latent position
of respondent
in the shared metric space, with
represents the weight of the distance term. For 2pl model, the the item effect is assumed to have additional discrimination parameter
multiplied by
:
where the error 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.
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.
lsirm2pl_normal_mar_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 |
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. |
gamma_estimate |
posterior estimates of gamma parameter. |
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. |
gamma |
Posterior samples of the gamma 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. |
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. |
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. |
accept_gamma |
Acceptance ratio for the gamma parameter. |
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. |
imp_estimate |
Probability of imputating a missing value with 1. |
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. |
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.
# 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_mar_ss(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm2pl(spikenslab = TRUE, fixed_gamma = FALSE, missing_data = "mar"))
# 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_mar_ss(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm2pl(spikenslab = TRUE, fixed_gamma = FALSE, missing_data = "mar"))
lsirm2pl_normal_mcar is used to fit 2PL LSIRM for continuous variable in incomplete data assumed to be missing completely at random. lsirm2pl_normal_mcar 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.
lsirm2pl_normal_mcar( 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_mean_gamma = 0.5, pr_sd_gamma = 1, 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 )
lsirm2pl_normal_mcar( 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_mean_gamma = 0.5, pr_sd_gamma = 1, 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 )
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_gamma |
Numeric; the jumping rule for the gamma proposal density. Default is 0.025 |
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_gamma |
Numeric; mean of log normal prior for gamma. Default is 0.5. |
pr_sd_gamma |
Numeric; standard deviation of log normal prior for gamma. Default is 1.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 |
lsirm2pl_normal_mcar
models the continuous value of response by respondent to item
with item effect
, respondent effect
and the distance between latent position
of item
and latent position
of respondent
in the shared metric space, with
represents the weight of the distance term. For 2pl model, the the item effect is assumed to have additional discrimination parameter
multiplied by
:
where the error 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
returns an object of list containing the following components:
data |
A data frame or matrix containing the variables used 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. |
gamma_estimate |
Posterior estimates of gamma parameter. |
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. |
gamma |
Posterior samples of the gamma parameter. |
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. |
accept_gamma |
Acceptance ratio for the gamma 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. |
Little, R. J., & Rubin, D. B. (2019). Statistical analysis with missing data (Vol. 793). John Wiley & Sons.
# 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(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm2pl(spikenslab = FALSE, fixed_gamma = FALSE, missing_data = "mcar"))
# 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(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm2pl(spikenslab = FALSE, fixed_gamma = FALSE, missing_data = "mcar"))
lsirm2pl_normal_mcar_ss is used to fit 2PL LSIRM 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.
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 )
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 )
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_gamma |
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_spike_mean |
Numeric; the mean of spike prior for log gamma. Default is -3. |
pr_spike_sd |
Numeric; the standard deviation of spike prior for log gamma. Default is 1. |
pr_slab_mean |
Numeric; the mean of spike prior for log gamma. Default is 0.5. |
pr_slab_sd |
Numeric; the standard deviation of spike prior for log gamma. Default is is 1. |
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_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. |
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_xi_a |
Numeric; the first shape parameter of beta prior for latent variable xi. Default is 1. |
pr_xi_b |
Numeric; the second shape parameter of beta prior for latent variable xi. Default is 1. |
missing.val |
Numeric; a number to replace missing values. Default is 99. |
verbose |
Logical; If TRUE, MCMC samples are printed for each |
lsirm2pl_normal_mcar_ss
models the continuous value of response by respondent to item
with item effect
, respondent effect
and the distance between latent position
of item
and latent position
of respondent
in the shared metric space, with
represents the weight of the distance term. For 2pl model, the the item effect is assumed to have additional discrimination parameter
multiplied by
:
where the error 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.
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 |
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. |
gamma_estimate |
posterior estimates of gamma parameter. |
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. |
gamma |
Posterior samples of the gamma 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. |
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 |
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. |
accept_gamma |
Acceptance ratio for the gamma 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. |
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.
# 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"))
# 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"))
lsirm2pl_normal_o is used to fit 2PL LSIRM for continuous variable. lsirm2pl_normal_o factorizes item response matrix into column-wise item effect, row-wise respondent effect and further embeds interaction effect in a latent space. 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.
lsirm2pl_normal_o( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 1, jump_alpha = 1, jump_gamma = 0.025, jump_z = 0.5, jump_w = 0.5, pr_mean_beta = 0, pr_sd_beta = 1, pr_mean_theta = 0, pr_mean_gamma = 0.5, pr_sd_gamma = 1, 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, verbose = FALSE )
lsirm2pl_normal_o( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 1, jump_alpha = 1, jump_gamma = 0.025, jump_z = 0.5, jump_w = 0.5, pr_mean_beta = 0, pr_sd_beta = 1, pr_mean_theta = 0, pr_mean_gamma = 0.5, pr_sd_gamma = 1, 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, verbose = FALSE )
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_gamma |
Numeric; the jumping rule for the gamma proposal density. Default is 0.025 |
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_gamma |
Numeric; mean of log normal prior for gamma. Default is 0.5. |
pr_sd_gamma |
Numeric; standard deviation of log normal prior for gamma. Default is 1.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. |
verbose |
Logical; If TRUE, MCMC samples are printed for each |
lsirm2pl_normal_o
models the continuous value of response by respondent to item
with item effect
, respondent effect
and the distance between latent position
of item
and latent position
of respondent
in the shared metric space, with
represents the weight of the distance term. For 2pl model, the the item effect is assumed to have additional discrimination parameter
multiplied by
:
where the error
lsirm2pl_normal_o
returns an object of list containing the following components:
data |
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. |
gamma_estimate |
Posterior estimates of gamma parameter. |
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. |
gamma |
Posterior samples of the gamma parameter. |
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. |
accept_gamma |
Acceptance ratio for the gamma 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. |
# generate example (continuous) item response matrix data <- matrix(rnorm(500, mean = 0, sd = 1),ncol=10,nrow=50) lsirm_result <- lsirm2pl_normal_o(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm2pl(spikenslab = FALSE, fixed_gamma = FALSE))
# generate example (continuous) item response matrix data <- matrix(rnorm(500, mean = 0, sd = 1),ncol=10,nrow=50) lsirm_result <- lsirm2pl_normal_o(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm2pl(spikenslab = FALSE, fixed_gamma = FALSE))
lsirm2pl_normal_ss is used to fit 2PL LSIRM for continuous variable with model selection approach. lsirm2pl_normal_ss factorizes item response matrix into column-wise item effect, row-wise respondent effect and further embeds interaction effect in a latent space. 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.
lsirm2pl_normal_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, verbose = FALSE )
lsirm2pl_normal_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, verbose = FALSE )
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_gamma |
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_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; 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_eps |
Numeric; shape parameter of inverse gamma prior for variance of data likelihood. Default is 0.001. |
pr_b_eps |
Numeric; scale parameter of inverse gamma prior for variance of data likelihood. Default is 0.001. |
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_xi_a |
Numeric; first shape parameter of beta prior for latent variable xi. Default is 1. |
pr_xi_b |
Numeric; second shape parameter of beta prior for latent variable xi. Default is 1. |
verbose |
Logical; If TRUE, MCMC samples are printed for each |
lsirm2pl_normal_ss
models the continuous value of response by respondent to item
with item effect
, respondent effect
and the distance between latent position
of item
and latent position
of respondent
in the shared metric space, with
represents the weight of the distance term. For 2pl model, the the item effect is assumed to have additional discrimination parameter
multiplied by
:
where the error .
lsrm2pl_noraml_ss
model include model selection approach based on spike-and-slab priors for log gamma. For detail of spike-and-slab priors, see References.
lsirm2pl_normal_ss
returns an object of list containing the following components:
data |
Data frame or matrix containing the variables in the model. |
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. |
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. |
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. |
alpha_estimate |
Posterior estimates of the alpha parameter. |
alpha |
Posterior estimates of the alpha parameter. |
accept_alpha |
Acceptance ratio for the alpha parameter. |
Ishwaran, H., & Rao, J. S. (2005). Spike and slab variable selection: frequentist and Bayesian strategies. The Annals of Statistics, 33(2), 730-773.
# generate example (continuous) item response matrix data <- matrix(rnorm(500, mean = 0, sd = 1),ncol=10,nrow=50) lsirm_result <- lsirm2pl_normal_ss(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm2pl(spikenslab = TRUE, fixed_gamma = FALSE))
# generate example (continuous) item response matrix data <- matrix(rnorm(500, mean = 0, sd = 1),ncol=10,nrow=50) lsirm_result <- lsirm2pl_normal_ss(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm2pl(spikenslab = TRUE, fixed_gamma = FALSE))
lsirm2pl_o is used to fit 2PL LSIRM. lsirm2pl_o factorizes item response matrix into column-wise item effect, row-wise respondent effect and further embeds interaction effect in a latent space. 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.
lsirm2pl_o( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 1, jump_alpha = 1, jump_gamma = 0.025, jump_z = 0.5, jump_w = 0.5, pr_mean_beta = 0, pr_sd_beta = 1, pr_mean_theta = 0, pr_mean_gamma = 0.5, pr_sd_gamma = 1, pr_mean_alpha = 0.5, pr_sd_alpha = 1, pr_a_theta = 0.001, pr_b_theta = 0.001, verbose = FALSE )
lsirm2pl_o( data, ndim = 2, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 1, jump_alpha = 1, jump_gamma = 0.025, jump_z = 0.5, jump_w = 0.5, pr_mean_beta = 0, pr_sd_beta = 1, pr_mean_theta = 0, pr_mean_gamma = 0.5, pr_sd_gamma = 1, pr_mean_alpha = 0.5, pr_sd_alpha = 1, pr_a_theta = 0.001, pr_b_theta = 0.001, verbose = FALSE )
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_gamma |
Numeric; the jumping rule for the gamma proposal density. Default is 0.025. |
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_gamma |
Numeric; mean of log normal prior for gamma. Default is 0.5. |
pr_sd_gamma |
Numeric; standard deviation of log normal prior for gamma. Default is 1.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. |
verbose |
Logical; If TRUE, MCMC samples are printed for each |
lsirm2pl_o
models the probability of correct response by respondent to item
with item effect
, respondent effect
and the distance between latent position
of item
and latent position
of respondent
in the shared metric space, with
represents the weight of the distance term. For 2pl model, the the item effect is assumed to have additional discrimination parameter
multiplied by
:
lsirm2pl_o
returns an object of list containing the following components:
data |
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. |
gamma_estimate |
Posterior estimates of gamma parameter. |
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. |
gamma |
Posterior samples of the gamma parameter. |
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. |
accept_gamma |
Acceptance ratio for the gamma parameter. |
alpha_estimate |
Posterior estimates of the alpha parameter. |
alpha |
Posterior estimates of the alpha parameter. |
accept_alpha |
Acceptance ratio for the alpha parameter. |
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),ncol=10,nrow=50) lsirm_result <- lsirm2pl_o(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm2pl(spikenslab = FALSE, fixed_gamma = FALSE))
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),ncol=10,nrow=50) lsirm_result <- lsirm2pl_o(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm2pl(spikenslab = FALSE, fixed_gamma = FALSE))
lsirm2pl_ss is used to fit 2PL LSIRM with model selection approach based on spike-and-slab priors. lsirm2pl_ss factorizes item response matrix into column-wise item effect, row-wise respondent effect and further embeds interaction effect in a latent space. 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.
lsirm2pl_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_theta = 0.001, pr_b_theta = 0.001, pr_xi_a = 1, pr_xi_b = 1, verbose = FALSE )
lsirm2pl_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_theta = 0.001, pr_b_theta = 0.001, pr_xi_a = 1, pr_xi_b = 1, verbose = FALSE )
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_gamma |
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_spike_mean |
Numeric; the mean of spike prior for log gamma. Default is -3. |
pr_spike_sd |
Numeric; the standard deviation of spike prior for log gamma. Default is 1. |
pr_slab_mean |
Numeric; the mean of spike prior for log gamma. Default is 0.5. |
pr_slab_sd |
Numeric; the standard deviation of spike prior for log gamma. Default is is 1. |
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_xi_a |
Numeric; the first shape parameter of beta prior for latent variable xi. Default is 1. |
pr_xi_b |
Numeric; the second shape parameter of beta prior for latent variable xi. Default is 1. |
verbose |
Logical; If TRUE, MCMC samples are printed for each |
lsirm2pl_ss
models the probability of correct response by respondent to item
with item effect
, respondent effect
and the distance between latent position
of item
and latent position
of respondent
in the shared metric space, with
represents the weight of the distance term. For 2pl model, the the item effect is assumed to have additional discrimination parameter
multiplied by
:
lsirm2pl_ss
model include model selection approach based on spike-and-slab priors for log gamma. For detail of spike-and-slab priors, see References.
lsirm2pl_ss
returns an object of list containing the following components:
data |
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. |
gamma_estimate |
Posterior estimates of gamma parameter. |
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. |
gamma |
Posterior samples of the gamma parameter. |
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. |
accept_gamma |
Acceptance ratio for the gamma parameter. |
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. |
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. |
alpha_estimate |
Posterior estimates of the alpha parameter. |
alpha |
Posterior estimates of the alpha parameter. |
accept_alpha |
Acceptance ratio for the alpha parameter. |
Ishwaran, H., & Rao, J. S. (2005). Spike and slab variable selection: Frequentist and Bayesian strategies. The Annals of Statistics, 33(2), 730-773.
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),ncol=10,nrow=50) lsirm_result <- lsirm2pl_ss(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm2pl(spikenslab = TRUE, fixed_gamma = FALSE))
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),ncol=10,nrow=50) lsirm_result <- lsirm2pl_ss(data) # The code following can achieve the same result. lsirm_result <- lsirm(data ~ lsirm2pl(spikenslab = TRUE, fixed_gamma = FALSE))
onepl is used to fit 1PL Rasch model.
onepl( data, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 1, pr_mean_beta = 0, pr_sd_beta = 1, pr_mean_theta = 0, pr_a_theta = 0.001, pr_b_theta = 0.001 )
onepl( data, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 1, pr_mean_beta = 0, pr_sd_beta = 1, pr_mean_theta = 0, pr_a_theta = 0.001, pr_b_theta = 0.001 )
data |
Matrix; binary 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. |
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 |
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. |
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_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. |
onepl
models the probability of correct response by respondent to item
with item effect
, respondent effect
:
onepl
returns an object of list containing the following components:
beta_estimate |
posterior estimation of beta. |
theta_estimate |
posterior estimation of theta. |
sigma_theta_estimate |
posterior estimation of standard deviation of theta. |
beta |
posterior samples of beta. |
theta |
posterior samples of theta. |
theta_sd |
posterior samples of standard deviation of theta. |
accept_beta |
accept ratio of beta. |
accept_theta |
accept ratio of theta. |
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),ncol=10,nrow=50) result <- onepl(data)
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),ncol=10,nrow=50) result <- onepl(data)
plot is used to plot the interaction map of fitted LSIRM or summarizing the parameter estimate of fitted LSIRM with box plot.
plot( object, ..., option = "interaction", rotation = FALSE, cluster = NA, which.clust = "item", interact = FALSE, chain.idx = 1 )
plot( object, ..., option = "interaction", rotation = FALSE, cluster = NA, which.clust = "item", interact = FALSE, chain.idx = 1 )
object |
Object of class |
... |
Additional arguments for the corresponding function. |
option |
Character; If value is "interaction", draw the interaction map that represents interactions between respondents and items. If value is "beta", draw the boxplot for the posterior samples of beta. If value is "theta", draw the distribution of the theta estimates per total test score for the |
rotation |
Logical; If TRUE the latent positions are visualized after oblique (oblimin) rotation. |
cluster |
Character; If value is "neyman" the cluster result are visualized by Point Process Cluster Analysis. If value is "spectral", spectral clustering method applied. Default is NA. |
which.clust |
Character; Choose which values to clustering. "resp" is the option for respondent and "item" is the option for items. Default is "item". |
interact |
Logical; If TRUE, draw the interaction map interactively. |
chain.idx |
Numeric; Index of MCMC chain. Default is 1. |
plot
returns the interaction map or boxplot for parameter estimate.
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5), ncol=10, nrow=50) lsirm_result <- lsirm(data ~ lsirm1pl()) plot(lsirm_result) # use oblique rotation plot(lsirm_result, rotation = TRUE) # interaction map interactively plot(lsirm_result, interact = TRUE) # clustering the respondents or items plot(lsirm_result, cluster = TRUE)
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5), ncol=10, nrow=50) lsirm_result <- lsirm(data ~ lsirm1pl()) plot(lsirm_result) # use oblique rotation plot(lsirm_result, rotation = TRUE) # interaction map interactively plot(lsirm_result, interact = TRUE) # clustering the respondents or items plot(lsirm_result, cluster = TRUE)
print.summary.lsirm is used to print summary the result of LSIRM.
## S3 method for class 'summary.lsirm' print(x, ...)
## S3 method for class 'summary.lsirm' print(x, ...)
x |
List; summary of LSIRM with |
... |
Additional arguments. |
print.summary.lsirm
return a summary of LSIRM.
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),ncol=10,nrow=50) lsirm_result <- lsirm(data ~ lsirm1pl()) summary(lsirm_result)
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),ncol=10,nrow=50) lsirm_result <- lsirm(data ~ lsirm1pl()) summary(lsirm_result)
summary is used to summary the result of LSIRM.
## S3 method for class 'lsirm' summary(object, chain.idx = 1, estimate = "mean", CI = 0.95, ...)
## S3 method for class 'lsirm' summary(object, chain.idx = 1, estimate = "mean", CI = 0.95, ...)
object |
Object of class |
chain.idx |
Numeric; Index of MCMC chain. Default is 1. |
estimate |
Character; Specifies the type of posterior estimate to provide for beta parameters. Options are |
CI |
Numeric; The significance level for the highest posterior density interval (HPD) for the beta parameters. Default is 0.95. |
... |
Additional arguments. |
summary.lsirm
contains following elements. A print method is available.
call |
R call used to fit the model. |
coef |
Covariate coefficients posterior means. |
mcmc.opt |
The 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. |
BIC |
Numeric value with the corresponding Bayesian information criterion (BIC). |
method |
Which model is fitted. |
missing |
The assumed missing type. One of NA, "mar" and "mcar". |
dtype |
Type of input data (Binary or Continuous). |
ss |
Whether a model selection approach using the spike-slab prior is applied. |
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),ncol=10,nrow=50) # 1PL LSIRM object lsirm_result <- lsirm(data ~ lsirm1pl()) summary(lsirm_result)
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),ncol=10,nrow=50) # 1PL LSIRM object lsirm_result <- lsirm(data ~ lsirm1pl()) summary(lsirm_result)
TDRI dataset is the answer to Inductive Reasoning Developmental Test of 1,803 Brazilians with age varying from 5 to 85 years.
data(TDRI)
data(TDRI)
A binary matrix with 1,803 rows and 56 columns.
It presents data from 1,803 Brazilians (52.5% female) with age varying from 5 to 85 years (M = 15.75; SD = 12.21) that answered to the Inductive Reasoning Developmental Test – IRDT, with 56 items designed to assess developmentally sequenced and hierarchically organized inductive reasoning.
https://figshare.com/articles/dataset/TDRI_dataset_csv/3142321
twopl is used to fit 2PL Rasch model. Unlike 1PL model, 2PL model assumes the item effect can vary according to respondent, allowing additional parameter multiplied with respondent effect.
twopl( data, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 1, jump_alpha = 1, 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 )
twopl( data, niter = 15000, nburn = 2500, nthin = 5, nprint = 500, jump_beta = 0.4, jump_theta = 1, jump_alpha = 1, 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 )
data |
Matrix; binary 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. |
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 |
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. |
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_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_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. |
twopl
models the probability of correct response by respondent to item
with item effect
, respondent effect
. For 2pl model, the the item effect is assumed to have additional discrimination parameter
multiplied by
:
twopl
returns an object of list containing the following components:
beta_estimate |
posterior estimation of beta. |
theta_estimate |
posterior estimation of theta. |
sigma_theta_estimate |
posterior estimation of standard deviation of theta. |
alpha_estimate |
posterior estimation of alpha. |
beta |
posterior samples of beta. |
theta |
posterior samples of theta. |
theta_sd |
posterior samples of standard deviation of theta. |
alpha |
posterior samples of alpha. |
accept_beta |
accept ratio of beta. |
accept_theta |
accept ratio of theta. |
accept_alpha |
accept ratio of alpha. |
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),ncol=10,nrow=50) result <- twopl(data)
# generate example item response matrix data <- matrix(rbinom(500, size = 1, prob = 0.5),ncol=10,nrow=50) result <- twopl(data)