measrdcm: S7 class for measrdcm objects

measrdcmR Documentation

S7 class for measrdcm objects

Description

The measrdcm constructor is exported to facilitate the conversion of other model objects (e.g., stanfit) to measrdcm objects. We do not expect or recommend calling this function directly, unless you are creating a method for converting to measrdcm. Rather, to create a measrdcm object, one should use dcm_estimate().

Usage

measrdcm(
  model_spec = NULL,
  data = list(),
  stancode = character(0),
  method = stanmethod(),
  algorithm = character(0),
  backend = stanbackend(),
  model = list(),
  respondent_estimates = list(),
  fit = list(),
  criteria = list(),
  reliability = list(),
  file = character(0),
  version = list()
)

Arguments

model_spec

The model specification used to estimate the model.

data

The data used to estimate the model.

stancode

The model code in Stan language.

method

The method used to fit the model.

algorithm

The name of the algorithm used to fit the model.

backend

The name of the backend used to fit the model.

model

The fitted Stan model. This will object of class rstan::stanfit if backend = "rstan" and CmdStanMCMC if backend = "cmdstanr" was specified when fitting the model.

respondent_estimates

An empty list for adding estimated person parameters after fitting the model.

fit

An empty list for adding model fit information after fitting the model.

criteria

An empty list for adding information criteria after fitting the model.

reliability

An empty list for adding reliability information after fitting the model.

file

Optional name of a file which the model objects was saved to or loaded from.

version

The versions of measr, Stan, and rstan or cmdstanr that were used to fit the model.

Value

A measrdcm object.

See Also

dcm_estimate().

Examples

qmatrix <- tibble::tibble(
  att1 = sample(0:1, size = 15, replace = TRUE),
  att2 = sample(0:1, size = 15, replace = TRUE),
  att3 = sample(0:1, size = 15, replace = TRUE),
  att4 = sample(0:1, size = 15, replace = TRUE)
)

spec <- dcm_specify(qmatrix = qmatrix)

measrdcm(spec)

measr documentation built on Jan. 14, 2026, 5:08 p.m.