PhysioClinStats is the clinical
inference engine of the ecosystem: mixed-effects and MMRM longitudinal
models, single-case (N-of-1) designs, estimands with multiple
imputation, and per-estimate uncertainty. The heavy modelling backends
(lme4, mmrm, emmeans,
mice, …) are optional, guarded Suggests.
This vignette uses only the distribution-free single-case
tools, which need no modelling backend, so it runs anywhere.
Each estimator reproduces its reference implementation
(SingleCaseES, scan) exactly.
We have one participant measured repeatedly: a baseline phase (A) and an intervention phase (B). Higher is better (e.g. comfortable gait speed, scaled).
The non-overlap family summarises how cleanly the intervention points
separate from baseline. resultValue() pulls the numbers out
of the returned AnalysisResult.
pnd <- scedPND(A, B) # percentage of non-overlapping data
pem <- scedPEM(A, B) # percentage exceeding the median
nap <- scedNAP(A, B) # non-overlap of all pairs (= AUC), with a CI
PhysioExperiment::resultValue(pnd)$estimate
#> [1] 0.8333333
PhysioExperiment::resultValue(pem)$estimate
#> [1] 1
PhysioExperiment::resultValue(nap)[c("estimate", "ci_lower", "ci_upper", "p_value")]
#> $estimate
#> [1] 0.95
#>
#> $ci_lower
#> [1] 0.6006868
#>
#> $ci_upper
#> [1] 0.995108
#>
#> $p_value
#> [1] 0.01371083Tau rescales NAP to [-1, 1]; Tau-U additionally corrects for a
baseline trend (and exposes both the SingleCaseES and
scan denominator conventions).
A Shewhart-style band flags runs of intervention points beyond 2 SD of the baseline mean – a transparent visual-analysis aid.
Even for a single case it helps to state the estimand explicitly (ICH E9(R1)): the treatment, population, endpoint, intercurrent-event strategy and summary measure.
defineEstimand(
treatment = "task-oriented training",
population = "one post-stroke participant",
endpoint = "comfortable gait speed",
intercurrent = list(event = "missed sessions",
strategy = "treatment-policy"),
summary_measure = "non-overlap of all pairs"
)
#> <estimand> ICH E9(R1)
#> treatment: task-oriented training
#> population: one post-stroke participant
#> endpoint: comfortable gait speed
#> intercurrent event: missed sessions
#> strategy: treatment-policy
#> summary: non-overlap of all pairsfitMixedModel(),
fitMMRM(), estimatedMarginalMeans() – require
their modelling backends and guard for them at run time.multipleImputation(),
poolEstimates(), analyseEstimand().causalMediation(),
targetTrialEmulate().conformalPredict() gives distribution-free prediction
intervals.See ?PhysioClinStats and each function’s help page for
details.