MyNixOS website logo
Description

Robustness and Drift Auditing for Longitudinal Decision Systems.

Provides tools for constructing longitudinal decision paths, quantifying temporal drift, tracking subgroup disparity trajectories, and stress-testing longitudinal conclusions under hidden bias. Implements three signature metrics: the Drift Intensity Index (DII), which measures structural instability in transition dynamics using the Frobenius norm of consecutive transition matrix differences; the Bias Amplification Index (BAI), which quantifies whether group disparities widen or converge over time; and the Temporal Fragility Index (TFI), which estimates the minimum hidden-bias perturbation required to nullify a longitudinal trend conclusion. An interactive 'shiny' application supports exploratory analysis, visualization, and reproducible reporting. Methods are motivated by applications in educational and social science research, including the Early Childhood Longitudinal Study (ECLS). The DII is based on the Frobenius norm as described in Golub and Van Loan (2013, ISBN:9781421407944). The TFI extends the hidden-bias sensitivity framework of Rosenbaum (2002, ISBN:9781441912633). The BAI draws on disparity-trajectory methods discussed in Duncan and Murnane (2011, ISBN:9780871542731).

RobustFlow

R-CMD-check CRAN status Lifecycle: experimental License: GPL v3

RobustFlow is an R package for auditing temporal drift, subgroup disparities, and robustness in longitudinal decision systems. It implements three new metrics and provides an interactive Shiny application for exploratory analysis and reproducible reporting.


Motivation

Researchers who study repeated decisions — risk classifications, tracking placements, intervention assignments — face three questions that existing tools do not address together:

  1. Is the decision structure stable over time? (Drift)
  2. Are group disparities widening? (Amplification)
  3. How fragile are these conclusions to hidden bias? (Robustness)

RobustFlow answers all three in a single, coherent workflow.


Signature Metrics

MetricSymbolDefinition
Drift Intensity IndexDIIFrobenius norm of consecutive transition matrix differences
Bias Amplification IndexBAIGap_T − Gap_1 (change in disparity from first to last wave)
Temporal Fragility IndexTFIMinimum hidden-bias attenuation to nullify a longitudinal trend

Installation

Install the development version from GitHub:

# install.packages("pak")
pak::pak("causalfragility-lab/RobustFlow")

Once on CRAN:

install.packages("RobustFlow")

Quick Start

library(RobustFlow)

# 1. Validate panel data
validated <- validate_panel_data(
  data     = my_data,
  id       = "child_id",
  time     = "wave",
  decision = "risk_math",
  group    = "ses_group"
)

# 2. Build decision paths
paths <- build_paths(
  data     = validated$data,
  id       = "child_id",
  time     = "wave",
  decision = "risk_math"
)
paths$path_counts        # frequency table
paths$transition_matrix  # pooled transition matrix
paths$path_entropy       # Shannon entropy

# 3. Drift Intensity Index (DII)
drift <- compute_drift(validated$data, "child_id", "wave", "risk_math")
drift$summary            # DII per wave
drift$mean_dii           # mean DII across all periods

# 4. Group gaps and Bias Amplification Index (BAI)
gaps <- compute_group_gaps(validated$data, "wave", "risk_math", "ses_group")
bai  <- compute_bai(gaps$gap)
bai$bai                  # e.g. 0.12
bai$direction            # "amplification"

# 5. Temporal Fragility Index (TFI)
tfi <- compute_tfi_simple(drift$summary$DII[!is.na(drift$summary$DII)])
tfi$tfi                  # minimum attenuation to nullify trend

# 6. Launch the interactive Shiny app
run_app()

The Shiny Application

run_app() opens a browser-based interface with seven tabs:

TabContent
DataUpload (CSV/RDS), variable mapping, balance diagnostics, missingness
PathsPath bar chart, frequency table, transition matrix
DriftPrevalence over time, DII trend plot, drift summary table
DisparitiesGroup trajectories, gap plot, BAI summary
RobustnessTFI value, sensitivity curve, robustness summary
InterventionHighest-risk transitions, disparity-generating steps
ReportHTML report download, CSV bundle, reproducible R script

Function Reference

FunctionPurpose
validate_panel_data()Validate and prepare longitudinal panel data
build_paths()Construct individual decision paths and transition matrix
compute_transition_matrix_all()Pooled transition matrix across all individuals
compute_drift()Compute the Drift Intensity Index (DII)
compute_group_gaps()Group-specific trajectories and disparity gaps
compute_bai()Compute the Bias Amplification Index (BAI)
compute_tfi_simple()Compute the Temporal Fragility Index (TFI)
generate_r_script()Export a self-contained reproducible R script
run_app()Launch the interactive Shiny application

Example Dataset

The package vignette demonstrates a simulated longitudinal study of mathematics risk status across five elementary school waves for 200 children, with three SES groups. This mimics the structure of the Early Childhood Longitudinal Study, Kindergarten Class of 2010–11 (ECLS-K:2011).

vignette("introduction", package = "RobustFlow")

Citation

If you use RobustFlow in published research, please cite:

@Manual{RobustFlow2026,
  title  = {{RobustFlow}: Robustness and Drift Auditing for Longitudinal
            Decision Systems},
  author = {Subir Hait},
  year   = {2026},
  note   = {R package version 0.1.0},
  url    = {https://github.com/causalfragility-lab/RobustFlow}
}

Contributing

Bug reports and feature requests are welcome at
https://github.com/causalfragility-lab/RobustFlow/issues


License

GPL (>= 3)

Metadata

Version

0.1.1

License

Unknown

Platforms (80)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows