rmvlogis {ltm} | R Documentation |
Produces Bernoulli random variates under the Rasch, two-parameter and three parameter logistic models.
rmvlogis(n, thetas, IRT = TRUE, link = c("logit", "probit"), distr = c("normal", "logistic", "log-normal"))
n |
a scalar indicating the number of response patterns to simulate. |
thetas |
a numeric matrix with rows representing the items and columns the parameters. See Details for more info. |
IRT |
logical; if TRUE thetas are under the IRT parameterization.
See Details for more info. |
link |
a character string indicating the link function to use. Options are logit and probit. |
distr |
a character string indicating the distribution of the latent variable. Options are normal, logistic, and log-normal. |
The binary variates can be simulated under the following parameterizations for the probability of correctly responding in
the ith item. If IRT = TRUE
π_i = c_i + (1 - c_i) g(beta_{2i} (z - beta_{1i})),
whereas as if IRT = FALSE
π_i = c_i + (1 - c_i) g(beta_{1i} + beta_{2i} z),
z denotes the latent variable,
β_{1i} and β_{2i} are the first and second columns of thetas
, respectively, and g()
is the link function. If thetas
is a three-column matrix then the third column should contain the guessing
parameters c_i's.
a numeric matrix with n
rows and columns the number of items, containing the simulated binary variates.
For both options distr = "logistic"
and distr = "log-normal"
the simulated random variates for z are
standardized, using the theoretical mean and variance of the Logistic and log-Normal distribution, respectively.
Dimitris Rizopoulos dimitris.rizopoulos@med.kuleuven.be
# 10 response patterns under a Rasch model # with 5 items rmvlogis(10, cbind(seq(-2, 2, 1), 1))