---
title: "SPSS Compatibility Status"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{SPSS Compatibility Status}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r setup, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  echo = FALSE
)
```

This vignette reports the SPSS-compatibility status of every statistical
function in **mariposa**. It is auto-generated from the test suite and the
validation exception registry.

**Generated:** 2026-09-09

## Summary

- Functions in SPSS-validation scope: **53**
- With validation tests in place:      **42**
- Validation gaps (no test file yet):  **11**
- Active Tier-3 algorithmic exceptions: **0**

## Tier Definitions

Every numerical comparison between an R-side value and an SPSS reference
falls into one of four tiers (Charter §4):

- **Spec** — exact integers and SPSS-truncated sentinels (exact match)
- **Display** — SPSS rounds for print; tolerance is half a unit of the last printed decimal
- **Exception** — documented algorithmic difference; see `VALIDATION_EXCEPTIONS.md`
- **Internal** — statistic has no SPSS equivalent; verified via snapshot tests only

## Per-Function Status

The columns show how many `assert_spss()` calls per tier the validation file
contains. "Total" is the total number of charter-compliant assertions.

The "Internal (Tier 4)" column flags statistics that have no SPSS
reference and are therefore R-only: for the rank-based family the
*weighted variant* (SPSS `NPAR TESTS` and `NONPAR CORR` ignore
`WEIGHT BY`); for `reliability`, McDonald's omega in all paths (IBM does
not publicly document the SPSS omega algorithm; an SPSS v29 reference run
is pending). Tier-4 statistics are covered by internal regression and
cross-check tests plus a weights-equal-1 invariance suite instead of SPSS
references. (`mann_whitney`'s weighted variant is a design-based rank
test additionally validated against `survey::svyranktest()`.) All other
statistics of these functions are SPSS-validated as shown in the tier
columns.

| Function | Status | Spec | Display | Exception | Total | Internal (Tier 4) |
|---|---|---:|---:|---:|---:|---|
| `ancova` | compliant | 1 | 5 | 0 | 6 | — |
| `binomial_test` | compliant | 2 | 3 | 0 | 5 | weighted variant |
| `center` | not validated | — | — | — | — | — |
| `chi_square` | compliant | 2 | 6 | 0 | 8 | — |
| `chisq_gof` | compliant | 2 | 2 | 0 | 4 | — |
| `codebook` | not validated | — | — | — | — | — |
| `cramers_v` | not validated | — | — | — | — | — |
| `crosstab` | compliant | 4 | 5 | 0 | 9 | adjusted standardized residuals (Haberman-formula oracle; SPSS /CELLS=ASRESID reference run pending) |
| `describe` | compliant | 2 | 3 | 0 | 5 | — |
| `dunn_test` | compliant | 0 | 1 | 0 | 1 | weighted variant |
| `efa` | compliant | 1 | 7 | 0 | 8 | — |
| `factorial_anova` | compliant | 1 | 5 | 0 | 6 | — |
| `fisher_test` | compliant | 1 | 3 | 0 | 4 | — |
| `frequency` | compliant | 2 | 5 | 0 | 7 | — |
| `friedman_test` | compliant | 3 | 3 | 0 | 6 | weighted variant |
| `goodman_gamma` | not validated | — | — | — | — | — |
| `kendall_tau` | compliant | 4 | 6 | 0 | 10 | weighted variant |
| `kruskal_wallis` | compliant | 5 | 3 | 0 | 8 | weighted variant |
| `levene_test` | compliant | 0 | 2 | 0 | 2 | — |
| `linear_regression` | compliant | 4 | 23 | 0 | 27 | — |
| `logistic_regression` | compliant | 7 | 13 | 0 | 20 | all statistics (textbook-formula oracle; no SPSS v29 reference run yet) |
| `mann_whitney` | compliant | 2 | 8 | 0 | 10 | weighted variant |
| `mcnemar_test` | compliant | 3 | 1 | 0 | 4 | — |
| `multiple_response` | compliant | 11 | 10 | 0 | 21 | all statistics (hand-computation oracle; SPSS MULT RESPONSE reference run pending) |
| `normality_test` | compliant | 4 | 8 | 0 | 12 | all statistics (independent-implementation oracles; SPSS EXAMINE reference run pending) |
| `oneway_anova` | compliant | 6 | 16 | 0 | 22 | — |
| `pairwise_wilcoxon` | compliant | 0 | 1 | 0 | 1 | weighted variant |
| `partial_cor` | compliant | 3 | 9 | 0 | 12 | all statistics (residual-regression oracle; SPSS PARTIAL CORR reference run pending) |
| `pearson_cor` | compliant | 2 | 5 | 0 | 7 | — |
| `phi` | not validated | — | — | — | — | — |
| `pomps` | not validated | — | — | — | — | — |
| `rec` | not validated | — | — | — | — | — |
| `reliability` | compliant | 1 | 5 | 0 | 6 | McDonald's omega (all paths) |
| `row_count` | not validated | — | — | — | — | — |
| `row_means` | not validated | — | — | — | — | — |
| `row_sums` | not validated | — | — | — | — | — |
| `scheffe_test` | compliant | 0 | 2 | 0 | 2 | — |
| `spearman_rho` | compliant | 2 | 2 | 0 | 4 | — |
| `std` | not validated | — | — | — | — | — |
| `t_test` | compliant | 2 | 30 | 0 | 32 | — |
| `tukey_test` | compliant | 0 | 4 | 0 | 4 | — |
| `w_iqr` | compliant | 0 | 19 | 0 | 19 | — |
| `w_kurtosis` | compliant | 0 | 19 | 0 | 19 | — |
| `w_mean` | compliant | 0 | 19 | 0 | 19 | — |
| `w_median` | compliant | 0 | 19 | 0 | 19 | — |
| `w_modus` | compliant | 0 | 19 | 0 | 19 | — |
| `w_quantile` | compliant | 0 | 19 | 0 | 19 | — |
| `w_range` | compliant | 0 | 19 | 0 | 19 | — |
| `w_sd` | compliant | 0 | 19 | 0 | 19 | — |
| `w_se` | compliant | 0 | 19 | 0 | 19 | — |
| `w_skew` | compliant | 0 | 19 | 0 | 19 | — |
| `w_var` | compliant | 0 | 19 | 0 | 19 | — |
| `wilcoxon_test` | compliant | 6 | 6 | 0 | 12 | weighted variant |

## Active Exceptions

No active Tier-3 exceptions. All validated statistics agree with
SPSS within Spec or Display tolerances.

## Validation Gaps

The following functions are in SPSS-validation scope (per Charter §9)
but do not yet have a `test-<fn>-spss-validation.R` file:

- `center`
- `codebook`
- `cramers_v`
- `goodman_gamma`
- `phi`
- `pomps`
- `rec`
- `row_count`
- `row_means`
- `row_sums`
- `std`

## How to Read "SPSS-Compatible"

A function is **SPSS-compatible** when:

1. It has a validation test file (column "Status: compliant")
2. Its Legacy column is zero
3. Every value it asserts falls into Spec, Display, or a registered
   Exception
4. It carries no `NA` placeholders in its `spss_values` block

Functions with non-zero Legacy counts are mid-migration and not yet
Charter-compliant; their assertions may pass but do not yet enforce
the documented tolerance policy.

## Methodology

All validation runs SPSS v29 syntax scripts in
`tests/spss_reference/syntax/` against `tests/spss_reference/data/`,
saves the output to `tests/spss_reference/outputs/`, and asserts the
R-side computation matches via `assert_spss()` from the
validation helpers in `tests/testthat/`.
Inline cached values in test files cite their source line via
trailing `# <output_file>:<line>` comments; the dev-only script
`tests/spss_reference/verify_inline.R` audits this citation chain
before every release.

