Package: magentabook 0.1.1

magentabook: HM Treasury Magenta Book Policy Evaluation Primitives

Implements policy evaluation primitives from HM Treasury Magenta Book guidance (HM Treasury, 2026): theory of change and log-frame construction, evaluation planning and stakeholder mapping, power and minimum-detectable-effect calculations for randomised designs (including cluster and stepped-wedge designs following Hussey and Hughes (2007) <doi:10.1016/j.cct.2006.05.007> and Hemming et al. (2015) <doi:10.1136/bmj.h391>), Maryland Scientific Methods Scale ratings, structured confidence ratings, light-weight difference-in-differences and interrupted-time-series estimators (Bernal et al. (2017) <doi:10.1093/ije/dyw098>) with cluster-robust standard errors (Cameron and Miller (2015) <doi:10.3368/jhr.50.2.317>), pre-treatment balance checks (Stuart (2010) <doi:10.1214/09-STS313>), and cost-effectiveness analysis (cost per outcome, incremental cost-effectiveness ratio, acceptability curves, incremental net benefit, quality-adjusted and disability-adjusted life years). Designed as the evaluation companion to the appraisal package 'greenbook'. Bundled rubric and reference tables carry vintage metadata for reproducibility. Aligned with the May 2026 republication of the Magenta Book.

Authors:Charles Coverdale [aut, cre]

magentabook_0.1.1.tar.gz
magentabook_0.1.1.zip(r-4.7)magentabook_0.1.1.zip(r-4.6)magentabook_0.1.1.zip(r-4.5)
magentabook_0.1.1.tgz(r-4.6-any)magentabook_0.1.1.tgz(r-4.5-any)
magentabook_0.1.1.tar.gz(r-4.7-any)magentabook_0.1.1.tar.gz(r-4.6-any)
magentabook_0.1.1.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
magentabook/json (API)

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

Bug tracker:https://github.com/charlescoverdale/magentabook/issues

On CRAN:

Conda:

4.48 score 383 downloads 35 exports 1 dependencies

Last updated from:a935b2602e. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK162
source / vignettesOK195
linux-release-x86_64OK151
macos-release-arm64OK146
macos-oldrel-arm64OK90
windows-develOK100
windows-releaseOK94
windows-oldrelOK91
wasm-releaseOK128

Exports:mb_assumptionsmb_balance_tablemb_ceamb_ceacmb_cluster_designmb_cmomb_confidencemb_confidence_summarymb_contribution_claimmb_counterfactualmb_dalymb_data_versionsmb_did_2x2mb_evaluation_planmb_evaluation_reportmb_event_studymb_icc_referencemb_icermb_inbmb_itsmb_logframemb_mdemb_powermb_qalymb_questionsmb_sample_sizemb_schedule_tablemb_sms_explainmb_sms_ratemb_stakeholdersmb_stepped_wedgemb_theory_of_changemb_to_excelmb_to_latexmb_to_word

Dependencies:cli

Designing a Magenta Book evaluation
Stage 1: theory of change | Stage 2: evaluation plan | Stage 3: power and sample size | Stage 4: rate the evidence | Bringing it together | Reproducibility

Last update: 2026-05-19
Started: 2026-04-28

Cost-effectiveness with magentabook and greenbook
Step 1: build the cashflows | Step 2: discount | Step 3: cost-effectiveness with magentabook | Step 4: net benefit at standard willingness-to-pay thresholds | Step 5: probabilistic sensitivity | Step 6: report | Composing with greenbook

Last update: 2026-04-28
Started: 2026-04-28

Readme and manuals

Help Manual

Help pageTopics
Build a structured assumption registermb_assumptions
Pre-treatment balance tablemb_balance_table
Cost per unit of outcomemb_cea
Cost-effectiveness acceptability curvemb_ceac
Cluster-RCT design effectmb_cluster_design
Context-mechanism-outcome (CMO) configurationmb_cmo
Structured Magenta Book confidence ratingmb_confidence
One-page confidence summary across multiple ratingsmb_confidence_summary
Contribution-analysis claimmb_contribution_claim
Define a counterfactualmb_counterfactual
Disability-adjusted life years (DALYs) accumulatormb_daly
Vintage of bundled rubric and reference tablesmb_data_versions
Canonical 2x2 difference-in-differences estimatormb_did_2x2
Aggregate evaluation planmb_evaluation_plan
Aggregate evaluation reportmb_evaluation_report
Simple event-study coefficientsmb_event_study
Reference intra-class correlation valuesmb_icc_reference
Incremental cost-effectiveness ratio with dominance handlingmb_icer
Incremental net benefitmb_inb
Interrupted time series via segmented regressionmb_its
Convert a theory of change into a logframemb_logframe
Minimum detectable effect (MDE)mb_mde
Power for a two-sample testmb_power
Quality-adjusted life years (QALYs) accumulatormb_qaly
Tag and structure evaluation questionsmb_questions
Required sample size for a target powermb_sample_size
Expose internal lookup tablesmb_schedule_table
Explain the Maryland SMS rubricmb_sms_explain
Score a study against the Maryland Scientific Methods Scalemb_sms_rate
RACI-style stakeholder registermb_stakeholders
Stepped-wedge design effectmb_stepped_wedge
Build a Magenta Book theory of changemb_theory_of_change
Export an evaluation report to Excelmb_to_excel
Render an evaluation report as a LaTeX tablemb_to_latex
Export an evaluation report to Wordmb_to_word