| Title: | Overlap-Aware Workforce Wave Comparisons |
|---|---|
| Description: | Tools for comparing workforce metric distributions between panel waves using linked stayers, reliability assumptions, or Cauchy bounds. Its purpose is to provide a low-latency alternative to traditional hierarchical or latent-growth modeling that is better-able to scale in cloud based architectures. The mathematics is an extension of rotating panel formulae from the official statistics literature. |
| Authors: | Jack Kostal [aut, cre] |
| Maintainer: | Jack Kostal <[email protected]> |
| License: | GPL-3 |
| Version: | 0.1.0 |
| Built: | 2026-11-03 23:53:09 UTC |
| Source: | https://github.com/cran/wavecov |
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.
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, ... )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, ... )
data |
Data frame with at least id, wave, and metric columns. |
wave_0 |
Value in |
wave_1 |
Value in |
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, |
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 |
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. |
A "wavecov_result" object (linked or reliability) or a
"wavecov_bounds_result" object (bounds). Use print(), tidy(),
and confint() for summaries.
Batch comparisons of multiple waves and metrics
compare_waves_batch( data, wave_pairs, id_col, wave_col, metric_col, metric_id_col = NULL, group_cols = NULL, method = c("linked", "reliability", "bounds", "auto", "ols"), reliability = NULL, sigma2 = NULL, sigma2S = NULL, level = 0.95, ... )compare_waves_batch( data, wave_pairs, id_col, wave_col, metric_col, metric_id_col = NULL, group_cols = NULL, method = c("linked", "reliability", "bounds", "auto", "ols"), reliability = NULL, sigma2 = NULL, sigma2S = NULL, level = 0.95, ... )
data |
... |
wave_pairs |
... |
id_col |
... |
wave_col |
... |
metric_col |
... |
metric_id_col |
... |
group_cols |
... |
method |
... |
reliability |
... |
sigma2 |
... |
sigma2S |
... |
level |
... |
... |
... |
...
When individual-level data are not available, this function computes overlap-aware variance for the change in means using either a reliability assumption or Cauchy-based bounds from supplied summary statistics.
compare_waves_summary_stats( N0, N1, nS, sigma2 = NULL, reliability = NULL, V0_bar = NULL, V1_bar = NULL, method = c("reliability", "bounds"), cov_sign = c("unrestricted", "nonnegative"), overlap_mode = c("generic", "overlap_aware"), sigma2S = NULL, level = 0.95 )compare_waves_summary_stats( N0, N1, nS, sigma2 = NULL, reliability = NULL, V0_bar = NULL, V1_bar = NULL, method = c("reliability", "bounds"), cov_sign = c("unrestricted", "nonnegative"), overlap_mode = c("generic", "overlap_aware"), sigma2S = NULL, level = 0.95 )
N0 |
Workforce size at wave 0. |
N1 |
Workforce size at wave 1. |
nS |
Number of stayers (present in both waves). |
sigma2 |
Common individual-level variance for the relevant population (used with the reliability method). |
reliability |
Same-person cross-wave reliability (used with the reliability method). |
V0_bar |
Variance of the wave-0 mean (used with the bounds method). |
V1_bar |
Variance of the wave-1 mean (used with the bounds method). |
method |
"reliability" or "bounds". |
cov_sign |
Covariance sign restriction for bounds: "unrestricted" or "nonnegative". |
overlap_mode |
Whether to use generic Cauchy bounds or overlap-aware
tightening. Overlap-aware bounds additionally use |
sigma2S |
Optional pooled individual-level stayer variance for overlap-aware bounds. |
level |
Confidence level for point-estimate intervals or sensitivity envelopes. |
A "wavecov_result" (reliability) or "wavecov_bounds_result"
(bounds) object. Use print(), tidy(), and confint()
for summaries.
A minimal generic for tidying objects returned by wavecov functions.
tidy(x, ...)tidy(x, ...)
x |
An object to tidy. |
... |
Unused. |
A data frame with a structure determined by the class of x.
Tidy output for wavecov point-estimate results
## S3 method for class 'wavecov_result' tidy(x, ...)## S3 method for class 'wavecov_result' tidy(x, ...)
x |
A "wavecov_result" object. |
... |
Unused. |
A one-row data frame with change estimates and diagnostics.