sim_TIRT_data | R Documentation |
Simulate Thurstonian IRT data
sim_TIRT_data(
npersons,
ntraits,
lambda,
gamma,
psi = NULL,
Phi = NULL,
eta = NULL,
family = "bernoulli",
nblocks_per_trait = 5,
nitems_per_block = 3,
comb_blocks = c("random", "fixed")
)
npersons |
Number of persons. |
ntraits |
Number of traits. |
lambda |
Item factor loadings. |
gamma |
Baseline attractiveness parameters of the first item versus the second item in the pairwise comparisons. Can be thought of as intercept parameters. |
psi |
Optional item uniquenesses. If not provided,
they will be computed as |
Phi |
Optional trait correlation matrix from which to sample
person factor scores. Only used if |
eta |
Optional person factor scores. If provided, argument
|
family |
Name of assumed the response distribution. Either
|
nblocks_per_trait |
Number of blocks per trait. |
nitems_per_block |
Number of items per block. |
comb_blocks |
Indicates how to combine traits to blocks.
|
A data.frame
of the same structure
as returned by make_TIRT_data
. Parameter values
from which the data were simulated are stored as attributes
of the returned object.
# simulate some data
sdata <- sim_TIRT_data(
npersons = 100,
ntraits = 3,
nblocks_per_trait = 4,
gamma = 0,
lambda = c(runif(6, 0.5, 1), runif(6, -1, -0.5)),
Phi = diag(3)
)
# take a look at the data
head(sdata)
str(attributes(sdata))
# fit a Thurstonian IRT model using lavaan
fit <- fit_TIRT_lavaan(sdata)
print(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.