Skip to content

testflow

1.0.0Package record

A Workflow for Statistical Testing and Interpretation

0packages depend
1.1Kdownloads / year
84.6%test coverage
13/13flavors OK

Overview

About

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).

Changes in 1.0.0

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 own print.testflow_sumtab() method (reusing the same full-width data.frame-based printing already used for other workflow result tables), so every column and value is shown.
  • Fixed a NAMESPACE regression: the file had lost its # Generated by roxygen2: do not edit by hand header at some point, which made roxygen2::roxygenise() silently skip regenerating it on every subsequent release - so newly exported functions and S3 methods were never being registered by the normal roxygenise() workflow (the sumtab() print method above surfaced this: without the header restored, print.testflow_sumtab never made it into NAMESPACE). Header restored; NAMESPACE now 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 from GMR = 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 against PowerTOST::power.TOST(), the regulatory-standard, Owen's-Q-based implementation, matching exactly for balanced designs. **If you sized a bioequivalence study with testflow before this fix, re-run it** - the corrected n may be larger. method = "normal_approx" is unaffected.
  • test_agreement()'s hypothesis test of kappa = 0 now 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, matching irr::kappa2() exactly. **If you relied on a test_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 minimum n whose confidence interval has maximum one-sided half-width no greater than width - more reliable than the normal approximation for small or extreme proportions. The achieved half-width is not perfectly monotone in n (integer event counts round differently as n changes), so the search includes a bounded backward repair scan to guard against converging on a non-minimal n; 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_events and max_n control the rare-event diagnostic threshold and the search's upper bound, respectively.
  • x$diagnostics now 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_n vs. adjusted_n (dropout-inflated), and achieved precision at complete_case_n. An approximation_warning field (and a matching single warning()) fires when the Wald approximation is used or when expected event/non-event counts are small.
  • conservative = TRUE (worst-case p = 0.5) remains method = "wald" only and now errors informatively if combined with "wilson"/"exact", since there is no well-defined worst-case p for the asymmetric search.
  • print(), summary(), and as_tibble() on sample_size objects 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 an aovlist fit walks every Error() stratum, including the degenerate intercept-only stratum (a single fitted value), and a recent change to stats:::summary.aov()'s perfect-fit check can produce NA there. 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.

  • car is now a hard dependency (Imports, not Suggests): regression homoscedasticity (Breusch-Pagan), multicollinearity (VIF), and ANOVA/factorial variance homogeneity (Levene's test) no longer fall back to "not checked" when car isn't installed, and test_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 match mauchly.test() and rstatix::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() and test_paired() (used to justify the Wilcoxon signed-rank test), via the closed-form Cabilio & Masaro (1996) test - verified to match lawstat::symmetry.test(option = "CM", boot = FALSE) exactly.
  • Added a real linearity check for test_correlation(method = "pearson"), via a quadratic-term F-test (anova() comparing y ~ x to y ~ x + I(x^2)) - equivalent to Ramsey's RESET test with a single quadratic regressor term, verified to match lmtest::resettest(power = 2, type = "regressor") exactly.
  • test_correlation_matrix() now applies a Benjamini-Hochberg correction to its pairwise p-values by default (p.adj column 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 for probs (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 takes method, probs, or odds_ratio arguments.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 5.9 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OK2026-08-04
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK13 OK2026-07-22
  • ERROR10 OK, 3 ERROR2026-07-16
  • OK6 OK2026-07-03
Advisories

none known

Documentation

In release 1.0.0
READMEYes · 1,327 wordsVignettesYes · 5 · evaluation depends on the environmentNEWSYes · 100% structured · mentions 1.0.0Citation fileNoWebsitenot declared in DESCRIPTION
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

1.1K
CRAN downloads in the past year
Rank #12,418 · ~3/day · ~93/mo
Daily download trend is not available in this view yet.
28330 days
88490 days
1.1K1 year
Compare downloads with other packages →
Also on39 r2u6 autocran

Repository

2Stars
0Forks
0Open issues
0Open PRs
3Releases
137Commits
1Commit identities
data-analysisggplot2rr-packagestatistical-testsstatisticsteaching
137 commits · Last activity 2026-09-19 · 0% stars, 30d · Default branch at 1.0.2, ahead of CRAN 1.0.0 (checked 2026-10-11)
Responsiveness
How these are sampled
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

2026-07-18 · 02026-08-02 · 2
PracticesBeta

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.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux

Docs source (1)
README.Rmd
CRAN release process (1)
cran-comments.md
How this is detected·Detection ruleset v3 (2026-09-26)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • Claude Codefirst seen 2026-07-16
    Pull request it wrote: opened by a project member
How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
17 external dependencies (excludes base and recommended)

Installing testflow adds 60 packages (32 with compiled code, 55 MB of source tarballs). Heaviest: stringi 11 MB, ggplot2 6.0 MB, doBy 4.3 MB.

Depends (1)
R >= 4.1.0
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

People & History

People (1)
Author, Maintainer since 0.8.2 (2026)
Releases (3)

Pick two releases to compare their code metrics.

  • 1.0.0Latest
    record
    2026-08-22 · current release · diff ↗
  • 0.9.0
    record
    2026-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.2
    record
    2026-07-02
  • R
    R 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")
El Badisy, I. (2026). testflow: A Workflow for Statistical Testing and Interpretation (Version 1.0.0) [Computer software]. https://doi.org/10.32614/CRAN.package.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.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for testflow version 1.0.0 [Data set]. HJJB, LLC. Data release v2026-10-18. https://doi.org/10.5281/zenodo.21843040

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.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy