Learn R Programming

QualityMeasure (version 2.0.1)

calcHLGMRel: Calculate reliability using a hierarchical logistic regression model

Description

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

Usage

calcHLGMRel(
  df = NULL,
  model = NULL,
  entity = "entity",
  y = "y",
  show.all = FALSE,
  ctrPerf = controlPerf(),
  ctrRel = controlRel()
)

Value

A list containing:

  • fit: fitted model

  • marg.p: marginal probability of the outcome

  • entity: list of entities

  • n: entity sample sizes

  • p: entity-level sample proportions

  • p.re: predicted entity-level outcome probabilities (i.e., shrunken estimates)

  • var.b: between-entity variance on the outcome scale

  • var.w: within-entity variance on the outcome scale

  • est.HLGM.delta: reliability estimates on the outcome scale

If show.all is set to TRUE, then the outputted list will also contain:

  • var.b.HLGM.latent: between-entity variance on the latent log-odds scale

  • var.b.HLGM.delta: between-entity variance on the outcome scale using delta method approximation

  • var.b.MC: between-entity variance on the outcome scale using Monte Carlo approximation

  • var.w.latent: within-entity variance on the latent log-odds scale

  • var.w.delta: within-entity variance on the outcome scale using delta method approximation

  • var.w.MC: within-entity variance on the outcome scale using Monte Carlo approximation

  • var.w.FE: within-entity variance calculated using fixed effect estimates of entity-level performance

  • var.w.RE: within-entity variance calculated using random effect estimates of entity-level performance

  • est.HLGM.latent: reliability estimates on latent log-odds scale

  • est.HLGM.delta: reliability estimates on outcome scale using delta approximation

  • est.HLGM.MC: reliability estimates on outcome scale using Monte Carlo approximation

  • est.HLGM.FE: reliability estimates on outcome scale using fixed effect estimates

  • est.HLGM.RE: reliability estimates on outcome scale using random effect estimates

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

show.all

logical parameter indicating whether all variations of reliability estimates should be calculated; default is FALSE.

ctrPerf

parameters to control performance measure calculation

ctrRel

parameters to control reliability estimation

Author

Kenneth Nieser (nieser@stanford.edu)

Details

Hierarchical logistic regression models are fit using lme4::glmer() with control = lme4::glmerControl(optimizer = "bobyqa") and nAGQ = 0.

References

Goldstein H, Browne W, Rasbash J. Partitioning variation in multilevel models. Understanding statistics: statistical issues in psychology, education, and the social sciences. 2002 Dec 2;1(4):223-31.

He K, Kalbfleisch JD, Yang Y, Fei Z, Kim S, Kang J, Li Y. Inter-unit reliability for quality measure testing. Journal of hospital administration. 2019 Jan 8;8(2):1.

Hwang J, Adams JL, Paddock SM. Defining and estimating the reliability of physician quality measures in hierarchical logistic regression models. Health Services and Outcomes Research Methodology. 2021 Mar;21(1):111-30.

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 = .2, r = .7)

# Calculate reliability
out <- calcHLGMRel(df = df, entity = 'entity', y = 'y')
summary(out$est.HLGM.delta)

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

## Reliability estimates from additional methods can be obtained by toggling show.all parameter
out.all <- calcHLGMRel(df = df, entity = 'entity', y = 'y', show.all = TRUE)
summary(out.all$est.HLGM.latent)
summary(out.all$est.HLGM.delta)
summary(out.all$est.HLGM.MC)
summary(out.all$est.HLGM.FE)
summary(out.all$est.HLGM.RE)

Run the code above in your browser using DataLab