generate_pattern: Generate a CAT patterns

View source: R/generate_pattern.R

generate_patternR Documentation

Generate a CAT patterns

Description

Generate a CAT pattern given various inputs. Returns a character vector or numeric matrix (depending on whether a df input was supplied) with columns equal to the test size and rows equal to the number of rows in Theta. For simulation studies, supplying a Theta input with more than 1 row will generate a matrix of responses for running independent CAT session when passed to mirtCAT(..., local_pattern). When the returned object is an integer vector then the Theta values will be stored as an attribute 'Theta' to be automatically used in Monte Carlo simulations.

Usage

generate_pattern(mo, Theta, df = NULL)

Arguments

mo

single group object defined by the mirt package

Theta

a numeric vector indicating the latent theta values for a single person

df

(optional) data.frame object containing questions, options, and scoring keys. See mirtCAT for details

Author(s)

Phil Chalmers rphilip.chalmers@gmail.com

References

Chalmers, R., P. (2012). mirt: A Multidimensional Item Response Theory Package for the R Environment. Journal of Statistical Software, 48(6), 1-29. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v048.i06")}

Chalmers, R. P. (2016). Generating Adaptive and Non-Adaptive Test Interfaces for Multidimensional Item Response Theory Applications. Journal of Statistical Software, 71(5), 1-39. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v071.i05")}

See Also

mirtCAT

Examples

## Not run: 

# return real response vector given choices and (optional) answers 
pat <- generate_pattern(mod, Theta = 0, df=df)
# mirtCAT(df, mo=mod, local_pattern = pat)

# generate single pattern observed in dataset used to define mod
pat2 <- generate_pattern(mod, Theta = 0)
# mirtCAT(mo=mod, local_pattern = pat2)

# generate multiple patterns to be analyzed independently 
pat3 <- generate_pattern(mod, Theta = matrix(c(0, 2, -2), 3))
# mirtCAT(mo=mod, local_pattern = pat3)


## End(Not run)

philchalmers/mirtCAT documentation built on Oct. 24, 2023, 11:14 a.m.