Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

draw_parameters

Draw plausible parameter instantiations from a given model


Description

Draws plausible parameters from a model using parametric sampling (if the information matrix was computed) or via boostrap sampling. Primarily for use with the DRF function.

Usage

draw_parameters(
  mod,
  draws,
  method = c("parametric", "boostrap"),
  redraws = 20,
  ...
)

Arguments

mod

estimated single or multiple-group model

draws

number of draws to obtain

method

type of plausible values to obtain. Can be 'parametric', for the parametric sampling scheme which uses the estimated information matrix, or 'boostrap' to obtain values from the boot function. Default is 'parametric'

redraws

number of redraws to perform when the given parameteric sample does not satisfy the upper and lower parameter bounds. If a valid set cannot be found within this number of draws then an error will be thrown

...

additional arguments to be passed

Value

returns a draws x p matrix of plausible parameters, where each row correspeonds to a single set

Examples

## Not run: 
set.seed(1234)
n <- 40
N <- 500

# only first 5 items as anchors
model <- 'F = 1-40
          CONSTRAINB = (1-5, a1), (1-5, d)'

a <- matrix(1, n)
d <- matrix(rnorm(n), n)
group <- c(rep('Group_1', N), rep('Group_2', N))

## -------------
# groups completely equal
dat1 <- simdata(a, d, N, itemtype = 'dich')
dat2 <- simdata(a, d, N, itemtype = 'dich')
dat <- rbind(dat1, dat2)
mod <- multipleGroup(dat, model, group=group, SE=TRUE,
                     invariance=c('free_means', 'free_var'))

param_set <- draw_parameters(mod, 100)
head(param_set)

## End(Not run)

mirt

Multidimensional Item Response Theory

v1.33.2
GPL (>= 3)
Authors
Phil Chalmers [aut, cre] (<https://orcid.org/0000-0001-5332-2810>), Joshua Pritikin [ctb], Alexander Robitzsch [ctb], Mateusz Zoltak [ctb], KwonHyun Kim [ctb], Carl F. Falk [ctb], Adam Meade [ctb], Lennart Schneider [ctb], David King [ctb], Chen-Wei Liu [ctb], Ogreden Oguzhan [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.