gen_betas: Generate item parameters.

Description Usage Arguments Value See Also Examples

View source: R/generate_data.R

Description

Function used internally in recovery_irtree to generate item parameters.

Usage

1
2
gen_betas(genModel = c("ext", "2012", "pcm", "steps", "shift", "ext2"),
  J = NULL, betas = NULL)

Arguments

genModel

Character. The data generating model (either "2012" or "ext").

J

number of items. Can be a vector for multiple traits (e.g., J=c(10,10,10)).

betas

Optional list. May have entries "beta.mrs", "beta.ers", "beta.trait", and/or "beta.ars". Each of those may have arguments passed to rtruncnorm.

Value

A matrix with J rows containing the item parameters for MRS, ERS, ARS (if genModel != "2012"), and the target trait.

See Also

rtruncnorm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
J <- 10
# use defaults
betapar <- mpt2irt:::gen_betas("ext", J = J, betas = NULL)
dat <- generate_irtree_ext(N = 20, J = J, betas = betapar, beta_ARS_extreme = 1)

# modify distribution (truncated normal) from which to draw betas, here for MRS
tmp1 <- list("beta.mrs" = list("mean" =  0,
                               "sd"   =  0.3,
                               "a"    = -2,
                               "b"    =  Inf))
betapar <- mpt2irt:::gen_betas("ext", J = J, betas = tmp1)

hplieninger/mpt2irt documentation built on Aug. 4, 2018, 10:52 a.m.