compare_waves: Compare two workforce waves for a single metric

View source: R/compare_waves.R

compare_wavesR Documentation

Compare two workforce waves for a single metric

Description

Compute overlap-aware inference for the change in a repeated organizational metric between two workforce waves, using linked stayers, a reliability assumption, or Cauchy-based bounds.

Usage

compare_waves(
  data,
  wave_0,
  wave_1,
  id_col,
  wave_col,
  metric_col,
  method = c("auto", "linked", "reliability", "bounds"),
  reliability = NULL,
  sigma2 = NULL,
  sigma2S = NULL,
  cov_sign = c("unrestricted", "nonnegative"),
  overlap_mode = c("generic", "overlap_aware"),
  level = 0.95,
  ...
)

Arguments

data

Data frame with at least id, wave, and metric columns.

wave_0

Value in wave_col for the first wave.

wave_1

Value in wave_col for the second wave.

id_col

Column name for the employee identifier.

wave_col

Column name for the wave identifier.

metric_col

Column name for the metric.

method

Method to use: "auto", "linked", "reliability", or "bounds". In "auto" mode, wavecov prefers linked, then reliability, then bounds.

reliability

Same-person cross-wave reliability for the relevant stayer population (used only for the reliability method).

sigma2

Optional common individual-level variance. When supplied with the reliability method, overrides the pooled variance from the two waves.

sigma2S

Optional pooled individual-level stayer variance. When supplied with the reliability method, is treated as a candidate sigma2. When supplied with the bounds method and overlap_mode = "overlap_aware", is used as a common stayer variance to tighten the Cauchy bounds.

cov_sign

Covariance sign restriction for bounds: "unrestricted" or "nonnegative".

overlap_mode

Whether to use generic Cauchy bounds ("generic") or overlap-aware tightening ("overlap_aware").

level

Confidence level for intervals (point-estimate methods) or sensitivity envelopes (bounded results).

...

Reserved for future extensions.

Value

A "wavecov_result" object (linked or reliability) or a "wavecov_bounds_result" object (bounds). Use print(), tidy(), and confint() for summaries.


wavecov documentation built on Nov. 3, 2026, 5:07 p.m.