Learn R Programming

mirtCAT (version 1.2)

generate_pattern: 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

See Also

mirtCAT

Examples

Run this code
## 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)

Run the code above in your browser using DataLab