R: Randomly sample response patterns given a list of items

rpf.sample {rpf} | R Documentation

## Randomly sample response patterns given a list of items

### Description

Returns a random sample of response patterns given a list of item models and parameters. If `grp` is given then theta, items, params, mean, and cov can be omitted.

### Usage

    rpf.sample(theta, items, params, ..., prefix = "i", mean = NULL,
      cov = NULL, mcar = 0, grp = NULL)

### Arguments

`theta` | either a vector (for 1 dimension) or a matrix (for >1 dimension) of person abilities or the number of response patterns to generate randomly
`items` | a list of item models
`params` | a list or matrix of item parameters. If omitted, random item parameters are generated for each item model.
`...` | Not used. Forces remaining arguments to be specified by name.
`prefix` | Column names are taken from param or items. If no column names are available, some will be generated using the given prefix.
`mean` | mean vector of latent distribution (optional)
`cov` | covariance matrix of latent distribution (optional)
`mcar` | proportion of generated data to set to NA (missing completely at random)
`grp` | a list with spec, param, mean, and cov

### Value

Returns a data frame of response patterns

### See Also

`sample`

### Examples

    # 1 dimensional items
    i1 <- rpf.drm()
    i1.p <- rpf.rparam(i1)
    i2 <- rpf.nrm(outcomes=3)
    i2.p <- rpf.rparam(i2)
    rpf.sample(5, list(i1,i2), list(i1.p, i2.p))

[Package rpf version 0.59 Index]