Description Usage Arguments Value Examples
Function generates categorical data 1...5 for N persons and J items given the item parameters betas.
1 2 3  | 
N | 
 number of persons  | 
J | 
 number of items  | 
betas | 
 Jx3 matrix with item parameters on three response dimensions
(middle, extreme, target trait defined by   | 
traitItem | 
 vector of length J specifying the underlying traits (e.g., indexed from 1...5). Standard: only a single trait is measured by all items. If the Big5 are measured, might be something like c(1,1,1,2,2,2,...,5,5,5,5)  | 
theta_vcov | 
 3x3 covariance matrix for middle, extremity, trait(s) (can be a vector of length 3 with variances for uncorrelated processes).  | 
prop.rev | 
 proportion of reversed items (rounded to next integer). Can
be a vector if multiple traits are specified by   | 
revItem | 
 vector of length J specifying reversed items (1=reversed, 0=regular)  | 
cat | 
 whether to return categorical data (response categories 1...5) or multinomial data (frequencies of 0 and 1)  | 
The function returns a list containing the generated matrix of responses X, a vector revItem indicating reversed items and true, latent values of the parameters.
1 2 3 4  | N <- 20
J <- 10
betas <- cbind(rnorm(J, .5), rnorm(J, .5), rnorm(J, 0))
dat <- generate_irtree_2012(N = N, J = J, betas = betas)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.