twopl {lsirm12pl} | R Documentation |
2PL Rasch model.
Description
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.
Usage
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
)
Arguments
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. |
Details
twopl
models the probability of correct response by respondent j
to item i
with item effect \beta_i
, respondent effect \theta_j
. For 2pl model, the the item effect is assumed to have additional discrimination parameter \alpha_i
multiplied by \theta_j
:
logit(P(Y_{j,i} = 1|\theta_j,\beta_i, \alpha_i))=\theta_j * \alpha_i+\beta_i
Value
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. |
Examples
# generate example item response matrix
data <- matrix(rbinom(500, size = 1, prob = 0.5),ncol=10,nrow=50)
result <- twopl(data)