Learn R Programming

tcl (version 1.0.1)

get_eRm_arg: Extract Arguments from an eRm Object

Description

This function extracts specific arguments from an object of class `'LR'` from the `eRm` package. Depending on the selected argument, it retrieves degrees of freedom (`df`), local deviations (`local_dev`), or informative sample size (`n_info`).

Usage

get_eRm_arg(obj, arg = c("df", "local_dev, n_info"))

Value

The extracted argument value:

  • A numeric value if `arg = "df"`.

  • A list containing local deviation parameters if `arg = "local_dev"`.

  • A computed sample size if `arg = "n_info"`.

Arguments

obj

An object of class `'LR'`, typically created using functions from the `eRm` package.

arg

A character string specifying the argument to extract. Options are:

  • `"df"` (default): Extracts the degrees of freedom.

  • `"local_dev"`: Extracts item parameters for the two person groups from the model. If more than two split groups are available, only the first two are selected.

  • `"n_info"`: Computes and returns the informative sample size using `n_info()`.

Details

If multiple argument values are provided, `"df"` is selected by default. If an invalid `arg` is provided, the function throws an error.

Examples

Run this code
if (FALSE) {
  # Example usage with an LR object
  dat = eRm::sim.rasch(1000,10)
  mod = eRm::RM(dat)

  obj <- eRm::LRtest(mod) # Create an LR object
  get_eRm_arg(obj, "df")      # Extract degrees of freedom
  get_eRm_arg(obj, "local_dev")  # Extract local deviations
  get_eRm_arg(obj, "n_info")  # Extract informative sample size
}

Run the code above in your browser using DataLab