A Workflow for Statistical Testing and Interpretation
Overview
Provides a unified workflow for choosing, running, and interpreting common statistical tests, from group comparisons and analysis of variance to regression, survival analysis, and diagnostic and agreement statistics. The package combines assumption checks, test selection, effect sizes, formatted results, plain-language interpretation, and a sample-size planning module covering continuous, binary, survival, ordinal, bioequivalence, and precision-based designs. Implemented methods follow standard references including Casella and Berger (2002, ISBN:9780534243128), Hollander et al. (2013, ISBN:9781118553299), Agresti (2013, ISBN:9780470463635), Cohen (1988, ISBN:9780805802832), Hosmer, Lemeshow and Sturdivant (2013, ISBN:9780470582473), and Julious (2010, ISBN:9781584887393).
Bug fixes
sumtab()output no longer gets silently truncated in the console. It previously printed as a bare tibble, which hides columns and cuts cell text short (e.g."58.0 (10.4)…") once the table exceeds the console width - exactly the columns/values a summary table needs to show in full. It now has its ownprint.testflow_sumtab()method (reusing the same full-widthdata.frame-based printing already used for other workflow result tables), so every column and value is shown.- Fixed a
NAMESPACEregression: the file had lost its# Generated by roxygen2: do not edit by handheader at some point, which maderoxygen2::roxygenise()silently skip regenerating it on every subsequent release - so newly exported functions and S3 methods were never being registered by the normalroxygenise()workflow (thesumtab()print method above surfaced this: without the header restored,print.testflow_sumtabnever made it intoNAMESPACE). Header restored;NAMESPACEnow regenerates correctly again.
Show all changes in 1.0.0Hide the rest of the changes in 1.0.0
Bug fixes (scientific validity)
sample_size_bioequivalence(method = "iterative_tost")now computes the two-one-sided-test (TOST) power exactly via the noncentral t distribution (Phillips 1990), instead of a normal approximation that treated the within-/between-subject variance as known. The previous version under-sized bioequivalence studies by up to ~20% at small n or CV/GMR combinations away fromGMR = 1(e.g. 13 vs. the correct 16 subjects for a 2x2 crossover at GMR = 0.95, CV = 0.15, 90% power). Verified in package tests againstPowerTOST::power.TOST(), the regulatory-standard, Owen's-Q-based implementation, matching exactly for balanced designs. **If you sized a bioequivalence study withtestflowbefore this fix, re-run it** - the correctednmay be larger.method = "normal_approx"is unaffected.test_agreement()'s hypothesis test ofkappa = 0now uses the null-hypothesis standard error (Fleiss, 1981), instead of incorrectly reusing the confidence-interval standard error (Fleiss, Cohen & Everitt, 1969, evaluated at the observed kappa) as the test denominator. The CI itself was already correct and is unchanged. Because the CI-based SE understates the correct null SE whenever agreement is materially above chance (the typical case), the previous z-statistic was inflated and p-values were anti-conservative (too small); in one check this moved z from 17.2 to the correct 14.4, matchingirr::kappa2()exactly. **If you relied on atest_agreement()p-value near your significance threshold, re-run it** - the corrected p-value is larger (less significant).
Sample-size precision planning
sample_size_precision(endpoint = "binary", design = "one_sample") gained
rare-prevalence support (e.g. newborn-screening / rare-event studies):
- New
method = c("wald", "wilson", "exact")."wald"is unchanged and remains the default, so existing calls return identical numbers."wilson"and"exact"(Clopper-Pearson) instead run a deterministic doubling-bisection integer search for the minimumnwhose confidence interval has maximum one-sided half-width no greater thanwidth- more reliable than the normal approximation for small or extreme proportions. The achieved half-width is not perfectly monotone inn(integer event counts round differently asnchanges), so the search includes a bounded backward repair scan to guard against converging on a non-minimaln; verified against an exhaustive brute-force scan in the package tests. - New
criterion = c("expected", "worst_case")controls whether the search targets precision at the single anticipated event count, or requires it to hold across a prevalence-local band of plausible counts. - New
min_expected_eventsandmax_ncontrol the rare-event diagnostic threshold and the search's upper bound, respectively. x$diagnosticsnow reports rare-event planning quantities that a CI-width target alone does not guarantee:expected_events,probability_zero_events,probability_at_least_one_event,complete_case_nvs.adjusted_n(dropout-inflated), and achieved precision atcomplete_case_n. Anapproximation_warningfield (and a matching singlewarning()) fires when the Wald approximation is used or when expected event/non-event counts are small.conservative = TRUE(worst-casep = 0.5) remainsmethod = "wald"only and now errors informatively if combined with"wilson"/"exact", since there is no well-defined worst-casepfor the asymmetric search.print(),summary(), andas_tibble()onsample_sizeobjects gained an optional "Diagnostics" section / columns, populated only when diagnostics are available; all previously existing fields are unchanged.
Binary design = "two_sample" precision planning (risk-difference
half-width) now implements unequal allocation correctly instead of silently
returning the equal-allocation result whenever allocation != 1. This is a
**behavior change** for existing calls with allocation != 1; `allocation
= 1` (the default) is numerically unaffected.
A developer-facing numerical validation script
(inst/validation/validate-sample-size-precision.R) independently
recomputes achieved confidence intervals and checks the minimum-n property
across a grid of prevalences, widths, and alpha levels.
Bug fixes
test_repeated()/test_repeated_long()no longer error with "missing value where TRUE/FALSE needed" on R-devel.summary()on anaovlistfit walks everyError()stratum, including the degenerate intercept-only stratum (a single fitted value), and a recent change tostats:::summary.aov()'s perfect-fit check can produceNAthere. We now summarize each stratum independently and skip any that fail, since the intercept-only stratum was never used for the reported test.
Assumption checking
Closed remaining gaps where an assumption was labeled "not checked"
because no diagnostic had been implemented (as opposed to being genuinely
uncheckable, e.g. too few observations, which is unchanged). Every
assumption status now reflects either a real check or an honest "not
applicable"/"not enough data" label - never an unimplemented one.
caris now a hard dependency (Imports, notSuggests): regression homoscedasticity (Breusch-Pagan), multicollinearity (VIF), and ANOVA/factorial variance homogeneity (Levene's test) no longer fall back to"not checked"whencarisn't installed, andtest_factorial(type = 2/3)no longer errors for the same reason.- Added a real sphericity check for
test_repeated()/test_repeated_long()with 3+ conditions, via Mauchly's test (stats::mauchly.test()on the wide-format multivariate model,X = ~1) - verified to matchmauchly.test()andrstatix::anova_test()exactly. Reports "not applicable" for exactly two conditions, where sphericity isn't defined. - Added a real symmetry-of-deviations check for
test_one_sample()andtest_paired()(used to justify the Wilcoxon signed-rank test), via the closed-form Cabilio & Masaro (1996) test - verified to matchlawstat::symmetry.test(option = "CM", boot = FALSE)exactly. - Added a real linearity check for
test_correlation(method = "pearson"), via a quadratic-term F-test (anova()comparingy ~ xtoy ~ x + I(x^2)) - equivalent to Ramsey's RESET test with a single quadratic regressor term, verified to matchlmtest::resettest(power = 2, type = "regressor")exactly. test_correlation_matrix()now applies a Benjamini-Hochberg correction to its pairwise p-values by default (p.adjcolumn in the correlation table), instead of reporting pairwise p-values with no correction applied.
Sample size planning
- Removed
sample_size_ordinal(method = "whitehead"). Unlike every other formula in the sample-size module, the proportional-odds formula had not been checked against a published worked example or an external reference implementation (only against itself), and the input convention forprobs(which arm's category distribution to supply) is ambiguous across secondary sources describing Whitehead (1993).sample_size_ordinal()now implements only Noether's method, which was independently verified. It no longer takesmethod,probs, orodds_ratioarguments.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-04
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-07-22
- ERROR10 OK, 3 ERROR2026-07-16
- OK6 OK2026-07-03
Documentation
- Help pages
- 39 (2 internal)includes a package overview page
- Examples that run
- 100%3 run in a plain check
- Exported functions with examples
- 9%
- Documented parameters
- 99%
- Return-value docs
- 97%
- Help pages citing references
- 51%
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- not measured
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Releases over time
Commits over time
4 development-tooling and community-health practices detected across 3 families in the upstream repository
Checks run against github.com/ielbadisy/testflow on 2026-10-11.
The R CMD check workflow runs on Linux
This repository shows signs of AI coding tools.
- Claude Codefirst seen 2026-07-16Pull request it wrote: opened by a project member
Dependencies
Code & Tests
People & History
Pick two releases to compare their code metrics.
- 1.0.0Latest
- 0.9.02026-07-17 · diff ↗ ·
added 18 exports
sample_size, sample_size_adjust_dropout, sample_size_cluster_adjust, sample_size_binary, sample_size_bioequivalence, sample_size_continuous, sample_size_ordinal, sample_size_precision, sample_size_survival, Surv, test_agreement, test_cox, test_diagnostic, test_icc, test_linear_regression, test_logistic_regression, test_roc, test_survival - 0.8.22026-07-02
- RR 4.6.0 released · 2026-04-24
Package metadata
- First published
- 2026-07-02
- Total releases
- 3 / 1 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 4.1.0
- Download size
- 841 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("testflow")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-18, which the citation names so these numbers can be found later. More on citing and the projects behind them.