> Reproducibility package version 1.0.0 (per-paper track; released 2026-07-02). Drawn from the master Comparable-Strata Designer software record (Zenodo 10.5281/zenodo.20709963, currently v2.26.0). This is the submitted-state package.

# Reproducibility package — *The Coefficient-of-Variation Screen and the Mean-Free Log-Scale Variance Ratio (ρ)*

Code and data reproducing every simulation, table, and figure in the manuscript
*"Recovering Parametric Inference for Skewed, Small-Sample, and Heteroscedastic Data: The
Coefficient-of-Variation Screen and the Log-Scale Variance Ratio (ρ)"* (`Dwyer_Manuscript_formatted.docx`),
plus the interactive applications. Python (numpy/scipy/pandas/matplotlib) and R (shiny).

> The step-by-step derivation of ρ and its symbolic+numeric verification suite are a **separate**
> deposit (`rho_deposit`). This package is the manuscript's empirical code.

## Applications

| File | What it is |
|------|------------|
| `cvscreen_core.py` | Shared engine: log-normal parameterization, samplers, the CV screen and CV ratio, the raw/log/permutation t-tests and Mann–Whitney, summary-statistic mode. |
| `cvscreen_app.py` | Python/Streamlit application — Monte-Carlo simulator (reproduces the figures), a tool that applies the screen and the competing tests to user data, and a summary-statistic mode for a published mean and SD. Run: `streamlit run cvscreen_app.py`. |
| `app.R` | R/Shiny equivalent. Run in R: `shiny::runApp("app.R")`. |

## Simulations (each writes a JSON the figures and tables consume)

| Script | Output | Manuscript |
|--------|--------|-----------|
| `sim.py` | `results.json` | Shapiro pass-rates, power, and the worked-example sims (Figures of Shapiro detectability, power; tables). |
| `sim_cutoff.py` | `cutoff_clean.json` | Detectability and power vs the common CV at n = 30 (the CV ≈ 0.5–1.0 cutoff zone). |
| `sim_normtests.py` | `normtests.json` | Power of the five normality tests (Shapiro–Wilk, Anderson–Darling, Lilliefors, D'Agostino–Pearson, Jarque–Bera). |
| `sim_cvratio_recover.py` | `recover.json` | Recovered parametric (log-scale) test vs the Mann–Whitney resolution floor. |
| `sim_cvratio_cutoffs.py` | `cvratio_cutoffs.json` | Pooled-test calibration vs the CV ratio by sample-size imbalance (the tolerance band). |

## Figure scripts

| Script | Figure file |
|--------|-------------|
| `fig_cushings.py` | `fig1_cushings.png` (Cushing's syndrome worked example) |
| `figs.py` | `fig1_shapiro.png`, `fig2_power.png`, `fig3_cutoff.png`, `fig4_typeI.png` |
| `fig_normtests.py` | `fig6_normtests.png` |
| `fig_recover.py` | `fig7_recover.png` |
| `fig_rescue_zone.py` | `fig8_rescue_zone.png` |
| `fig_skew_review.py` | `fig9_skew_locus.png` |
| `fig_cvratio_cutoffs.py` | `fig_cvratio_cutoffs.png` (the pooled-test tolerance band) |
| `fig_flowchart.py` | `fig_flowchart_gray.png` (the published colour version is `fig_flowchart_color.png`, included) |

The generated `*.json` and `*.png` are included so the figures render without rerunning the
(Monte-Carlo) simulations; delete them and run the pipeline below to regenerate from scratch.

## How to run

```bash
pip install numpy scipy pandas matplotlib       # on macOS use python3/pip3

python sim.py                   # -> results.json
python sim_cutoff.py            # -> cutoff_clean.json
python sim_normtests.py         # -> normtests.json
python sim_cvratio_recover.py   # -> recover.json
python sim_cvratio_cutoffs.py   # -> cvratio_cutoffs.json

python figs.py                  # Shapiro / power / cutoff / type-I figures
python fig_cushings.py          # Cushing's worked example
python fig_normtests.py         # normality-test power
python fig_recover.py           # parametric recovery vs rank floor
python fig_rescue_zone.py       # rescue zone
python fig_skew_review.py       # skew locus
python fig_cvratio_cutoffs.py   # CV-ratio tolerance band
python fig_flowchart.py         # decision flowchart
```

Random seeds are fixed, so all reported quantities and figures reproduce exactly.

## Data note

The only non-simulated values are the Cushing's syndrome urinary-steroid measurements (Aitchison &
Dunsmore), now included as `Cushings.csv` (also embedded in `fig_cushings.py`) and listed in the
manuscript. Everything else is Monte-Carlo generated.

## Deposit / citation

To archive on Zenodo for a DOI: upload these files (or this folder zipped), set type *Software*,
license *CC-BY-4.0*, paste the abstract from `CITATION.cff`, **Reserve DOI**, then publish and put
the DOI into the manuscript's Data and Code Availability statement.

## Interactive tools (HTML)

Two self-contained, single-file browser tools (no dependencies; open in any web browser) implement
the CV screen for reading and reuse:

- `CV_Screen_CI_Calculator.html` — paste summary statistics; applies the CV screen and returns the
  log-scale t recovery with a back-transformed confidence interval, plus the log-domain distributional
  atlas and the fit-free L (log-skewness), K (log-kurtosis), and Delta = ln(AM) - ln(GM) coordinate
  readouts.
- `strata_designer.html` — the interactive comparable-strata designer for the CV-ratio screen, with the
  atlas verdict and the same coordinate readouts, including the four-mean D3 log-normality diagnostic.

These are the browser versions of `cvscreen_app.py` / `app.R`; the maintained 44-planner suite is
archived at the software DOI (10.5281/zenodo.20709963).
