Skip to contents

Load a packaged simulation dataset

Usage

load_mfrmr_data(
  name = c("example_core", "example_bias", "example_operational", "study1", "study2",
    "combined", "study1_itercal", "study2_itercal", "combined_itercal")
)

Arguments

name

Dataset key. One of the values from list_mfrmr_data(). If omitted, the backward-compatible default is "example_core"; new code should pass a key explicitly.

Value

A data.frame in long format.

Details

load_mfrmr_data("<key>") is the canonical loader for the packaged datasets and the entry point used across the package help and vignettes. The equivalent base-R alternative data("<object-name>", package = "mfrmr") remains available for users who prefer the full data() spelling; both paths return identical long-format data frames.

All returned datasets include the core long-format columns Study, Person, Rater, Criterion, and Score. Some datasets, such as the packaged documentation examples, also include auxiliary variables like Group for DIF/bias demonstrations.

Interpreting output

The return value is a plain long-format data.frame. The example and study-specific keys are ready for fit_mfrm() after checking role and score mappings. The combined keys are design-review objects: overlapping IDs or simple Study-based prefixes do not establish a common measurement scale, so an explicit identity, anchor, or linking design is required before a joint fit is interpretable.

Typical workflow

  1. list valid names with list_mfrmr_data().

  2. load one dataset key with load_mfrmr_data(name).

  3. fit a model with fit_mfrm() and inspect with summary() / plot().

Examples

library(mfrmr)

# Load synthetic ratings and inspect their columns and score frequencies
toy <- load_mfrmr_data("example_operational")
head(toy)
#>                Study Person Rater    Criterion Score Group
#> 1 OperationalExample   P001   R01     Language     4     A
#> 2 OperationalExample   P001   R01 Organization     2     A
#> 3 OperationalExample   P001   R02      Content     4     A
#> 4 OperationalExample   P001   R02     Language     3     A
#> 5 OperationalExample   P001   R02 Organization     2     A
#> 6 OperationalExample   P002   R01      Content     3     A
names(toy)
#> [1] "Study"     "Person"    "Rater"     "Criterion" "Score"     "Group"    
table(toy$Score)
#> 
#>  1  2  3  4 
#> 62 96 78 46 

# Optional: base R's data() loads the same dataset under its full name
data("mfrmr_example_operational", package = "mfrmr")
identical(toy, mfrmr_example_operational) # TRUE: both contain the same data
#> [1] TRUE