Learn R Programming

QualityMeasure (version 2.0.1)

calcHLMRel: Calculate reliability using a hierarchical linear regression model

Description

This function estimates reliability using a hierarchical linear regression model with random intercepts for each accountable entity.

Usage

calcHLMRel(
  df = NULL,
  model = NULL,
  entity = "entity",
  y = "y",
  ctrPerf = controlPerf()
)

Value

A list containing:

  • fit: fitted model

  • entity: list of entities

  • n: entity sample sizes

  • var.b: between-entity variance

  • var.w: within-entity variance

  • est.HLM: entity-level reliability

Arguments

df

observation-level data; if null, will use the dataframe from the model object

model

model; if null, will use an unadjusted model

entity

data column containing the accountable entity identifier

y

data column containing the outcome variable

ctrPerf

parameters to control performance measure calculation

Author

Kenneth Nieser (nieser@stanford.edu)

Details

Hierarchical linear regression models are fit using lme4::lmer().

References

Nieser KJ, Harris AH. Comparing methods for assessing the reliability of health care quality measures. Statistics in Medicine. 2024 Oct 15;43(23):4575-94.

Examples

Run this code
# Simulate data
df <- simulateData(n.entity = 50, n.obs = 100, mu = 12, r = .7, data.type = 'normal')

# Calculate reliability
out <- calcHLMRel(df = df, entity = 'entity', y = 'y')
summary(out$est.HLM)

# Plot reliability
plot(out$n, out$est.HLM)

Run the code above in your browser using DataLab