Package: PITS 0.1.0

David de Lorenzo

PITS: Power of Interrupted Time Series (ITS) Studies

Provides tools for estimating the statistical power of Interrupted Time Series (ITS) designs, with a focus on healthcare applications. The package supports prospective power calculations before a study begins, and retrospective assessments of whether a completed study was adequately powered. It includes functions to estimate nuisance parameters (baseline, residual standard deviation, autocorrelation) from data observed before the intervention, and to estimate power via Monte Carlo simulation for single-site and multi-site designs. Utility functions for design optimisation sweeps and publication- ready plots are also provided.

Authors:David de Lorenzo [aut, cre]

PITS_0.1.0.tar.gz
PITS_0.1.0.tar.gz(r-4.7-any)PITS_0.1.0.tar.gz(r-4.6-any)
PITS_0.1.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
PITS/json (API)

# Install 'PITS' in R:
install.packages('PITS', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/drdaviddelorenzo/pits/issues

Datasets:

On CRAN:

Conda:

3.00 score 5 scripts 22 exports 2 dependencies

Last updated from:d63cf1f779. Checks:4 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK141
source / vignettesOK199
linux-release-x86_64OK155
wasm-releaseOK108

Exports:build_param_gridcalculate_powercalculate_power_multidiagnose_paramsestimate_and_calculateestimate_baselineestimate_its_paramsestimate_rhoestimate_sigmaestimate_trendexport_resultsfit_its_modelinterpret_powerplot_its_exampleplot_power_curveplot_power_heatmappower_sweeprun_its_powerrun_power_gridsimulate_its_datasimulate_predatavalidate_params

Dependencies:latticenlme

Estimating ITS parameters from pre-intervention data
Overview | Using individual estimation functions | When to use individual functions | Using the all-in-one wrapper | Custom column names | Diagnostic plots | What if I have no pre-intervention data? | Handling non-standard situations | Date-indexed time column | Missing values | Very short pre-periods | Typical parameter ranges for monthly hospital data | References

Last update: 2026-06-30
Started: 2026-06-30

PITS: Power of an ITS — CDSS/CFR worked example
Motivating example | Step 1 — Load pre-intervention data | Step 2 — Estimate nuisance parameters | Step 3 — Specify the clinical hypothesis | Step 4 — Calculate power for a single design | Step 5 — Optimise with a design sweep | Step 6 — Plot a simulated ITS realisation | Step 7 — Sensitivity analysis | Step 8 — Multi-site analysis | Summary table | One-call shortcut | References

Last update: 2026-06-30
Started: 2026-06-30

Readme and manuals

Help Manual

Help pageTopics
PITS: Power of Interrupted Time Series studiesPITS-package PITS
Build a factorial parameter grid for power calculationsbuild_param_grid
Estimate statistical power for a single-site ITS designcalculate_power
Estimate statistical power for a multi-site ITS designcalculate_power_multi
Diagnostic plots for pre-intervention datadiagnose_params
Estimate parameters and calculate power in one stepestimate_and_calculate
Estimate baseline outcome from pre-intervention dataestimate_baseline
Estimate all ITS nuisance parameters from pre-intervention dataestimate_its_params
Estimate AR(1) autocorrelation from pre-intervention dataestimate_rho
Estimate residual standard deviation from pre-intervention dataestimate_sigma
Estimate pre-intervention trend from pre-intervention dataestimate_trend
Example pre-intervention case fatality rate dataexample_cfr_data
Export PITS results to CSV and plain-text summaryexport_results
Fit a segmented regression model to an ITS datasetfit_its_model
Interpret a power estimate qualitativelyinterpret_power
Plot a simulated ITS exampleplot_its_example
Plot power as a function of post-intervention durationplot_power_curve
Plot a power heatmap across two parametersplot_power_heatmap
Design optimisation sweep: power across a range of n_post valuespower_sweep
Print method for PITS power resultsprint.pits_power_result
Print method for PITS sweep resultsprint.pits_sweep_result
Full single-site ITS power workflowrun_its_power
Run power calculations across a parameter gridrun_power_grid
Simulate a single ITS datasetsimulate_its_data
Generate synthetic pre-intervention datasimulate_predata
Summary method for PITS power resultssummary.pits_power_result
Validate ITS parameter values before simulationvalidate_params