Learn R Programming

normref (version 0.0.0.1)

reliability_window: Estimate test reliability by age using a sliding window

Description

Estimates reliability across age using a sliding window approach, either at fixed age points or per individual.

Usage

reliability_window(
  data,
  age_name,
  item_variables,
  window_width,
  window_version = "step",
  min_agegroup = NULL,
  max_agegroup = NULL,
  step_agegroup = 1,
  complete.obs = TRUE
)

Value

A data.frame with:

  • rel: Reliability estimates

  • age: Corresponding age values

  • window_width: The width of the sliding window

  • window_per: Description of age step or observation unit

This output can be used as the datarel argument in normtable_create().

Arguments

data

data.frame containing the item scores and age variable.

age_name

string. Name of the age variable.

item_variables

numeric or character vector. Column indices or names of the item variables.

window_width

numeric. Width of the sliding window used to group individuals by age.

window_version

string. Type of windowing:

  • "step" (default): Estimate reliability at fixed age intervals.

  • "window_per_person": Estimate reliability for each individual.

min_agegroup

numeric. Minimum age to include. Defaults to the floor of the minimum age in the data.

max_agegroup

numeric. Maximum age to include. Defaults to the ceiling of the maximum age in the data.

step_agegroup

numeric. Step size between evaluated ages. Used only when window_version = "step".

complete.obs

logical. If TRUE (default), uses listwise deletion; if FALSE, uses pairwise deletion.

References

heister2024itemnormref

See Also

normtable_create()

Examples

Run this code
invisible(data("ids_kn_data"))
rel_est <- reliability_window(
  data = ids_kn_data,
  age_name = "age_years",
  item_variables = colnames(ids_kn_data),
  window_width = 2
)

Run the code above in your browser using DataLab