# Supplementary material

**Measured Cd, Cr and Pb Increase in Maturing Compost While the Metal Inventory Does Not: Implications for Compliance Sampling and Digestion Protocols**

Manzoor, A., Manzoor, M., Aamir, A., & Chaudhry, A. N.

This archive contains the dataset and the analysis code behind every result reported in the paper: the dose–response regressions, the partition model and liberation factors, the liberation kinetics, the model comparison and bootstrap intervals, the Monte-Carlo compliance model, the soil-accumulation horizons, the geochemical indices and the ordination.

---

## Contents

### Data

| File | Contents |
|---|---|
| `data/data_compost_long.csv` | Tidy dataset, 420 rows: one per treatment × sampling day × variable, with the standard error and a statement of where that error came from |
| `data/data_compost_wide.csv` | The same data, one row per treatment × day |
| `data/Supplementary_Data.xlsx` | Excel workbook: the data together with every derived table in the paper |
| `data/data_anova_error_terms.csv` | The analysis-of-variance record behind Tables S1 and S2: for every element and sampling occasion, the grand mean, the treatment sum of squares reconstructed from the means, the sum of squares printed in the source appendix, the published and the validated error mean square, whether the term had to be reassigned, the published coefficient of variation, and the standard error actually used |
| `data.py` | The same dataset as a Python module, read by the analysis scripts, with the provenance of each block recorded in comments. Holds both `MSE_PUB`, the error mean squares exactly as the source appendices print them, and `MSE_VALIDATED`, the assignment used in the paper after three elements were traced to the wrong sampling occasion (see below) |

**On the error terms.** For Cu, Mn and Ni the treatment sum of squares reconstructed from the means does not match the appendix printed under the corresponding sampling day, but matches another day's appendix exactly. The day labels on those tables are transposed in the source record, and the error terms were reassigned to the occasions their sums of squares identify before use. `data_anova_error_terms.csv` shows both mappings side by side and flags every reassigned row, so the correction can be audited without taking it on trust.

Values are treatment means of three composite samples. Standard errors are derived as the square root of MS_error/3 from the analysis-of-variance tables archived in the source thesis; where no error term could be validated the field is empty and the reason is given in the `se_source` column. No value anywhere in this archive is simulated, imputed or interpolated.

### Analysis code

| File | Purpose |
|---|---|
| `ministats.py` | Statistical routines implemented from first principles so that results do not depend on the version of any third-party statistics library: incomplete beta and Student t, Pearson correlation, ordinary least squares, Mann–Whitney with tie correction, ranking with ties averaged |
| `models.py` | The mass-conservative partition model and liberation factor, first-order liberation kinetics, the Monte-Carlo compliance model, the soil-accumulation model, and the geochemical indices |
| `addstats.py` | Small-sample corrected model comparison, non-parametric bootstrap intervals, Spearman rank correlation, principal component analysis |
| `figs.py` | Figures 1–7, drawn at the journal's reproduction width as 600 dpi raster and as vector PDF |

Run in this order:

```
python3 models.py        # -> models.json
python3 addstats.py      # -> addstats.json
python3 figs.py          # -> F1-F7 .png and .pdf
```

`models.py` and `addstats.py` print every quantity reported in the paper and write their results to JSON; `figs.py` reads both. Runtime is a few minutes in total, most of it in the kinetic grid search and the Monte-Carlo compliance model.

**Requirements.** Python 3.10 or later, NumPy and Matplotlib. Nothing else is used: the statistical routines are implemented from first principles in `ministats.py`, so the results do not depend on the version of any third-party statistics library. All random draws are seeded, so the Monte-Carlo and bootstrap results reproduce exactly.

### Figures

`figures/` holds Figures 1–7 as 600 dpi PNG and as vector PDF, drawn at 174 mm reproduction width.

---

## Analytical quality control

The limits of the analytical record are set out in Section 2.3 of the paper and repeated here because they bear on how this archive should be used.

**Documented.** The digestion followed the collaborative-study procedure of Isaac and Johnson (1975). Reagent blanks were carried through every batch. Calibration used matrix-matched standards. All eight elements were determined in the same digest.

**Recoverable.** Within-occasion precision, computed from the archived error mean squares and given in full in Supplementary Table S2 of the paper. Median coefficients of variation were 1.5% (Fe), 3.1% (Mn), 5.0% (Ni), 6.4% (Cu), 10.8% (Zn), 1.2% (Cr) and 1.4% (Cd). No precision figure of any kind survives for Pb.

**Not available.** No certified reference material was analyzed, no record of the spectrometer or its calibration survives, and the grade and supplier of the acids are not documented. Trueness cannot be established retrospectively and no claim is made about the absolute accuracy of the concentrations. The central result is a relative comparison between elements measured in the same digest, which is why it does not depend on that missing information; the reasoning is given in Section 4.2.

---

## Provenance and license

The trial was carried out in 2009. Part of the primary concentration dataset was previously reported in an institutional thesis (Manzoor, 2010, PMAS–Arid Agriculture University, Rawalpindi); the modeling framework, the partition analysis, the kinetic treatment, the compliance and risk models and all interpretations are original to this paper.

Data and code are released for reuse under CC BY 4.0. Please cite the article.
