Skip to contents

pharmhand 0.4.3.9000

  • Safety hierarchy tables now retain treatment groups with zero events using names_expand = TRUE.
  • Improved robustness in AE comparisons by short-circuiting when denominators are zero.
  • Efficacy baseline calculations now use accessor helpers (get_filtered_data, get_trt_var) instead of direct slot access.
  • Added input validation for treatment variables in laboratory tables to prevent unsafe glue syntax.
  • Bayesian meta-analysis warmup parameter now requires a positive integer (>= 1) for consistency with brms.
  • Standardized on rlang::sym across all table creator functions.
  • Added footnotes property to ClinicalTable class and updated reporting engine to populate it.
  • Fixed ph_abort() to properly concatenate multiple arguments before passing to rlang::abort().
  • Documentation and test suite improvements, including explicit skip guards for mmrm and cmdstanr dependencies.

pharmhand 0.4.2.9000

  • Validation helpers now reject NA consistently across assertion functions.
  • Reporting engine refactor: title/footnotes helper, ADaMData coercion, empty gt styling.
  • Export improvements: preserve ClinicalTable styling, HTML title handling.
  • Safety/efficacy robustness: NNH bounds ordering, warnings on empty filters, Treatment column guard, case-insensitive DISCONTINUED matching.
  • Added .format_n_over_n formatting helper for n/N display.
  • Test refactors for clarity and maintainability.

pharmhand 0.4.1.9000

Code Quality Improvements

Messaging and Helpers

  • Added ph_abort() for consistent error handling with abort messaging
  • Added ph_inform() for informational messages
  • Added ph_warn() for warning messages
  • Added get_subject_n() for extracting subject counts from ADaM datasets
  • Added get_summary_label() for generating standardized summary labels
  • Added || operator (grapes-or-or-grapes) for flexible default value handling

Cleanup and Maintenance

  • Removed .tldr/ directory and cache files (TLDR code analysis cache)
  • Deprecated safe_pct() function (removed man page)
  • Removed 11 old imputation test problem files from tests/testthat/_problems/
  • Added .tldr/ and vignettes/safety-tables_files/ to .gitignore
  • Updated README files and pkgdown configuration
  • Updated vignettes for baseline, efficacy, and safety tables

pharmhand 0.4.0.9000

Phase 3: Quality Assessment

Risk of Bias Assessment (RoB 2)

  • Added RoB2Result S7 class for storing RoB 2 assessment results.
  • Added assess_rob2() for single-study risk of bias assessment using Cochrane RoB 2 tool.
  • Added assess_rob2_batch() for batch processing multiple studies from a data frame.
  • Added rob2_summary() for creating summary tables of RoB 2 assessments.
  • Implements all 5 RoB 2 domains: randomization, deviations, missing data, measurement, selection.
  • Automatic overall judgment calculation following RoB 2 algorithm.
  • Reference: IQWiG Allgemeine Methoden Section 10.1.4.

Risk of Bias Assessment (ROBINS-I)

  • Added ROBINSIResult S7 class for storing ROBINS-I assessment results.
  • Added assess_robins_i() for single-study risk of bias assessment using ROBINS-I tool.
  • Added assess_robins_i_batch() for batch processing multiple studies from a data frame.
  • Added robins_i_summary() for creating summary tables of ROBINS-I assessments.
  • Implements all 7 ROBINS-I domains: confounding, participant selection, classification of interventions, deviations, missing data, outcome measurement, selection of reported result.
  • Supports 5-level judgments: Low, Moderate, Serious, Critical, No information.
  • Reference: IQWiG Allgemeine Methoden Section 10.1.4.

Risk of Bias Visualization

  • Added create_rob_traffic_light_plot() for traffic light visualization of domain-level judgments.
  • Added create_rob_summary_plot() for stacked bar plot summaries of bias assessments.
  • Added save_rob_plot() for exporting plots to PNG, SVG, PDF and other formats.
  • Added rob_data_to_tidy() for converting assessment results to tidy data frames.
  • Supports both RoB 2 and ROBINS-I assessment results.
  • Uses standard risk of bias color scheme (green/yellow/red/gray).

Bias-Adjusted Meta-Analysis

IQWiG Evidence Grading

  • Added grade_evidence() for assessing evidence certainty using IQWiG methodology.
  • Added assess_evidence_domains() for evaluating individual evidence domains.
  • Added format_evidence_grade() for German (Beleg/Hinweis/Anhaltspunkt) or English output.
  • Implements IQWiG 3.1.4 evidence grading: Beleg (Proof), Hinweis (Indication), Anhaltspunkt (Hint), Kein Beleg (No proof).
  • Evaluates: study limitations, inconsistency, imprecision, indirectness, publication bias.
  • Integrates with RoB 2 assessments for study quality evaluation.

Evidence Summary Tables

pharmhand 0.3.4.9000

Fixes and maintenance

  • Fixed create_clinical_table() to accept AnalysisResults objects (uses @stats).
  • Improved Bayesian meta-analysis test performance and stability.
  • Cleaned up documentation/signature mismatches and R CMD check issues.

Major Architecture Improvements

Package-Wide Defaults System

  • New defaults infrastructure: Added centralized default parameter system via ph_default() function
    • Default values for common parameters (e.g., trt_var = "TRT01P", autofit = TRUE, conf_level = 0.95)
    • Users can override via options: options(pharmhand.trt_var = "ARM")
    • Reduces boilerplate across 40+ functions
    • Improves consistency and maintainability

Code Reusability Improvements

  • New create_clinical_table() factory function: Reduces boilerplate for table creation
    • Consolidates repeated pattern of creating flextable + wrapping in ClinicalTable
    • Used across 25+ table creation functions
    • ~200 lines of duplicate code eliminated
  • Extracted estimate_tau2() helper: Eliminates duplication in meta-analysis functions

Enhanced User Experience

  • Automatic data.frame coercion: User-facing functions now accept data.frames directly
    • create_demographics_table() automatically wraps data.frames in ADaMData
    • Eliminates need for users to manually create S7 objects
    • Backward compatible with existing ADaMData inputs
  • Improved error messages: Context-rich error reporting throughout
    • Error messages now show what was received vs. what was expected
    • Available values suggested when appropriate (e.g., treatment arms)
    • Missing column errors show available columns for easier debugging
  • New workflow helpers: High-level convenience functions for common tasks

API Consistency

  • Standardized parameter names: Using ph_default() across the package
    • trt_var (not treatment_var) for treatment variable
    • conf_level (not ci_level or confidence_level) for confidence level
    • autofit consistently for table formatting
    • Reduces cognitive load for users
  • Consistent return types: All create_*_table() functions return ClinicalTable objects
    • Fixed inconsistencies where some returned bare flextables
    • Enables consistent downstream processing

Breaking Changes

Source File Reorganization

  • Efficacy module split: R/efficacy_tables.R has been split into focused modules:
    • R/efficacy_primary.R - Primary endpoint tables (create_primary_endpoint_table())
    • R/efficacy_cfb.R - Change from baseline tables
    • R/efficacy_lab.R - Laboratory tables
    • R/efficacy_tte.R - Time-to-event tables
    • R/efficacy_responder.R - Responder analysis tables
    • R/efficacy_subgroup.R - Subgroup analysis tables
  • Safety module split: R/safety_tables.R has been split into focused modules:
    • R/safety_summary.R - AE summary tables (create_ae_summary_table())
    • R/safety_comparison.R - AE comparison tables
    • R/safety_hierarchy.R - SOC/PT hierarchy tables
    • R/safety_tte.R - Safety time-to-event analysis
    • R/safety_exposure.R - Exposure-adjusted analysis
  • Migration guidance: Users who previously sourced these files directly should:

Bug Fixes

Robustness Improvements

  • Fixed create_primary_endpoint_table() to handle empty data or all-NA values gracefully, returning “-” instead of NaN/Inf
  • Fixed create_responder_analysis_table() to compute response rate in separate mutate step, avoiding fragile self-reference in summarise
  • Fixed create_tte_summary_table() to correctly extract landmark survival estimates for each treatment stratum instead of using first stratum for all
  • Fixed create_tte_summary_table() to use dynamic CI column names based on conf_level instead of hardcoded “lower .95”/“upper .95”
  • Fixed create_league_table() to use NMA result’s stored confidence level when available
  • Fixed leave_one_out() to read ci_level from correct slot (_level instead of @metadata$conf_level)

Input Validation

Code Quality

  • Changed stop() to ph_abort() in example script for consistent error handling
  • Fixed vignette code fence indentation mismatch in efficacy-tables.Rmd
  • Added := import from rlang to fix undefined global function warning
  • Fixed create_mean_plot() n calculation to count non-missing values
  • Added guards for CI computation when n <= 1 to avoid Inf values

Plotting Fixes

  • Fixed create_efficacy_waterfall_plot() to compute category counts in separate mutate step, avoiding fragile self-reference in summarise
  • Fixed create_forest_plot() Cox model CI column extraction to use positional indexing instead of fragile name construction
  • Fixed create_km_plot() risk table grid background by explicitly setting panel.grid.major/minor to element_blank()
  • Fixed safe_pct() division by zero in safety_summary.R by adding helper function applied to 9 locations

Bayesian Meta-Analysis Fixes

  • Fixed bayesian_meta_analysis() to use brms::neff_ratio() instead of non-exported brms::ess_bulk()/brms::ess_tail()
  • Fixed bayesian_meta_analysis() to compute BFMI from nuts_params energy values
  • Fixed bayesian_meta_analysis() to use brms::nuts_params() for divergent transitions instead of accessing internal fit$fit@sim$divergent__
  • Added tryCatch wrapper around brms::brm() calls for better error handling
  • Changed all brms tests to use cores = 1 to avoid parallel rstan issues in CI
  • Added bayesplot to Suggests, removed direct rstan dependency
  • Fixed roxygen documentation to avoid \describe{} block Rd parsing issues
  • Added brms test caching helper to speed up test suite

Documentation

  • Added @title tags and completed @return documentation in meta_bias.R
  • Added within-study variation warning documentation in assess_transitivity()
  • Split long @return lines in safety_tte.R
  • Added description field to meta-analysis vignette
  • Updated brms section in meta-analysis vignette with installation guidance

Test Improvements

  • Refactored test-plotting_forest.R, test-efficacy_tte.R, and test-efficacy_subgroup.R to use shared test fixtures
  • Included documentation examples to exported functions in efficacy and safety modules
  • Updated test-meta_bayesian.R with 8-study test data and adapt_delta = 0.99 to prevent divergent transitions
  • Seeded RNG in 11 tests in test-pro-analysis.R
  • Applied set.seed() to test-efficacy_tte.R before sample() call
  • Removed duplicate tests in test-efficacy_responder.R and test-efficacy_subgroup.R

pharmhand 0.3.0.9000

Major Changes

Test Suite Reorganization

  • One-test-file-per-source-file convention: Reorganized test files to follow R testing best practices.
    • Split test-efficacy_tables.R into test-efficacy_cfb.R, test-efficacy_lab.R, test-efficacy_primary.R, test-efficacy_responder.R, test-efficacy_subgroup.R, and test-efficacy_tte.R
    • Split test-meta-analysis.R into test-meta_core.R, test-meta_bayesian.R, test-meta_bias.R, test-meta_indirect.R, test-meta_network.R, and test-meta_plots.R
    • Split test-plotting.R into test-plotting_survival.R, test-plotting_efficacy.R, and test-plotting_forest.R
    • Renamed test-safety_tables.R to test-safety_summary.R and extracted test-safety_comparison.R and test-safety_hierarchy.R

New Test Coverage

  • Added comprehensive tests for Configuration API (test-config_api.R)
  • Added comprehensive tests for Configuration Classes (test-config_classes.R)

Bug Fixes

Test Data Improvements

  • Fixed test data in safety TTE tests to use larger sample sizes (20+ subjects per arm) to avoid Cox model convergence issues
  • Fixed test data to avoid duplicate landmark timepoints in TTE summary tests
  • Fixed test data for subgroup analysis to have adequate subjects per subgroup (25+)
  • Fixed S7 class checks from expect_s3_class() to S7::S7_inherits() for proper S7 class validation
  • Fixed error message regex patterns to match actual function outputs

Source Code Fixes

  • Fixed km_summary matrix conversion in efficacy_tte.R to preserve column names for single treatment arms
  • Fixed pct column warning in safety_summary.R by using proper dplyr::mutate() instead of for-loop assignment
  • Fixed survfit n.censor matrix handling in plotting_survival.R by converting to vector
  • Fixed min() returning -Inf in pro_analysis.R when no events present
  • Fixed S7 class checking in config_api.R to use S7::S7_inherits() instead of inherits()

Test Cleanup

  • Removed tests for unimplemented maic() and stc() functions
  • Fixed missing registry variable in config API tests
  • Changed REML tests to use DerSimonian-Laird method to avoid convergence warnings
  • Replaced any(is.na()) with anyNA() per jarl recommendations

Code Quality

  • All tests pass (1874 tests)
  • No warnings or skipped tests
  • lintr clean (line length compliance)
  • jarl check clean
  • devtools::check() passes with 0 errors, 0 warnings, 0 notes

pharmhand 0.2.3.9000

Documentation

pharmhand 0.2.2.9000

Phase 2: Evidence Synthesis

Meta-Analysis Functions

  • Added meta_analysis() for fixed-effect and random-effects meta-analysis with support for multiple tau² estimators (DerSimonian-Laird, REML, Paule-Mandel, ML) and optional Knapp-Hartung adjustment.

  • Added calculate_heterogeneity() for comprehensive heterogeneity assessment including Q, I², τ², and H² statistics with interpretation.

  • Added leave_one_out() for sensitivity analysis identifying influential studies.

  • Added create_meta_forest_plot() for meta-analysis forest plots with study weights, heterogeneity statistics, and prediction intervals.

  • Added create_funnel_plot() for publication bias visualization.

  • Added eggers_test() for statistical assessment of funnel plot asymmetry.

  • Added trim_and_fill() for Duval & Tweedie publication bias adjustment.

Indirect Comparison

Network Meta-Analysis

Bayesian Analysis

  • Added bayesian_meta_analysis() interface for Bayesian meta-analysis using brms when available, with automatic fallback to frequentist methods.

Phase 1 Completion

PRO Analysis

Visualization

Safety Analysis

Subgroup Analysis

  • Added assess_iceman() for ICEMAN criteria assessment of subgroup credibility.

S7 Classes

  • Added comprehensive tests for MultiArmStudy S7 class.

Documentation

  • Added extensive test coverage for meta-analysis functions.
  • Added tests for PRO analysis functions.

pharmhand 0.2.1.9000

Improvements

Plotting

Documentation

Code Quality

  • Added Newcombe-Wilson reference citation for binary difference in proportions CI calculation.
  • Removed unused comparison_results stub from AE comparison function.

Tests

  • Added test for NNH calculation when risk difference is negative (treatment beneficial).

pharmhand 0.2.0.9000

Code Quality

  • Refactored duplicated palette resolution logic into .resolve_palette() helper.
  • Added warning when log-log plot drops data points with non-finite values.
  • Expanded PH assumption disable comment with rationale for time-to-first AE.
  • Added clarifying comments in floor/ceiling detection and event conversion.
  • Added documentation note about CI construction methods for non-inferiority binary endpoints.
  • Removed redundant @keywords internal from exported ancova_adjust_continuous().

Tests

  • Made color palette test assertions order-agnostic with expect_setequal().
  • Added edge case tests for calculate_exposure_adjusted_rate() (zero events, small exposure, large counts).

pharmhand 0.1.21.9000

Bug Fixes

  • Fixed ComparisonResult defaults from integer(0) to numeric(0) for consistency with S7 class.
  • Fixed line length lint errors in test_non_inferiority() documentation.

Documentation

Plotting

  • Added show_censor support to create_loglog_plot() and passed through from create_km_plot(type = "loglog").
  • Updated documentation to clarify that censor marks are supported on log-log plots while median lines, CI bands, risk tables, and landmarks are intentionally omitted.
  • Added test for log-log plot censor marks.

pharmhand 0.1.20.9000

Improvements

pharmhand 0.1.19.9000

Improvements

pharmhand 0.1.18.9000

Improvements

pharmhand 0.1.17.9000

Improvements

pharmhand 0.1.16.9000

Improvements

pharmhand 0.1.15.9000

Improvements

pharmhand 0.1.14.9000

Documentation

pharmhand 0.1.13.9000

Improvements

pharmhand 0.1.12.9000

Improvements

  • Added log-log survival plots for PH diagnostics via create_loglog_plot() and create_km_plot(type = "loglog").

pharmhand 0.1.11.9000

Improvements

pharmhand 0.1.10.9000

Improvements

pharmhand 0.1.9.9000

Improvements

  • Added NNH (Number Needed to Harm) to AE comparison tables with estimability handling.

pharmhand 0.1.8.9000

Breaking Changes

  • build_time_to_event() in the safety report example no longer assumes a 100-day default duration. Supply default_duration when TRTDURD cannot be derived from TRTSDT/TRTEDT.

pharmhand 0.1.7.9000

Improvements

  • Standardized NA display via pharmhand.na_string across reporting themes and clinical table styling.

pharmhand 0.1.6.9000

Documentation

  • Documented fixed-column handling for the Module 4 table template.

pharmhand 0.1.5.9000

Documentation

  • Clarified IQWiG flextable theme formatting and decimal separator behavior.

pharmhand 0.1.4.9000

Documentation

  • Finalized IQWiG-compliant CI formatter documentation.

pharmhand 0.1.3.9000

Improvements

  • Added validation for default_duration in the safety report example.

Documentation

  • Clarified palette resolution for create_km_plot() and CI formatting guidance.
  • Added a note on comparison-table entry points in the safety tables vignette.
  • Fixed the pkgdown badge URL in the README.

Maintenance

  • Updated compliance tests to use flextable’s public header removal API.

pharmhand 0.1.1.9000

Bug Fixes

Improvements

  • theme_iqwig() and theme_gba() now apply the decimal_separator parameter to numeric columns (was declared but unused).
  • SingleArmStudy now has a treatment_var property for consistency with TwoArmStudy and MultiArmStudy.

Documentation

  • Updated G-BA citation to 2024 reference.
  • Added missing adae and adrs datasets to README examples.

Maintenance

  • Added notes/ to .gitignore.
  • Fixed lintr line-length violations.

pharmhand 0.1.0.9000

Breaking Changes

Improvements

Documentation

  • Added README.Rmd with rendered demo table and KM plot figures.
  • Improved pkgdown site with sandstone theme and dark mode support.
  • Simplified Articles dropdown to flat list.
  • Added description to baseline-tables vignette.
  • Fixed dev status badges visibility with development: mode: unreleased.

Maintenance

  • Cleaned up _pkgdown.yml by removing redundant defaults.
  • Simplified extra.scss to only flextable dark mode fixes.
  • Updated example scripts and vignettes for function rename.

pharmhand 0.0.18.9000

New Features

  • Add to_gba_template() to export ClinicalTable/ClinicalReport objects in G-BA Module 4 format.

Tests

  • Add coverage for G-BA template export.

pharmhand 0.0.17.9000

New Features

Tests

  • Add coverage for Module 4 table creation.

pharmhand 0.0.16.9000

New Features

  • Add check_gba_compliance() for pre-export validation of G-BA Module 4 tables.
  • Mark IQWiG and G-BA flextable themes with a pharmhand_theme attribute.

Tests

  • Add coverage for G-BA compliance checks.

pharmhand 0.0.15.9000

Breaking Changes

  • Remove fmt_pvalue() format preset. Use format_pvalue() for IQWiG-compliant p-value formatting.

New Features

Tests

  • Add coverage for IQWiG formatting and theme functions.

Maintenance

  • Remove duplicate formatting helpers to avoid shadowing.

pharmhand 0.0.14.9000

Breaking Changes

  • Endpoint classes unified: PrimaryEndpoint, SecondaryEndpoint, and SafetyEndpoint have been replaced with a single Endpoint class. Use the category property (“primary”, “secondary”, “safety”, “exploratory”) instead.

  • Study class renamed: OneArmStudy is now SingleArmStudy for clarity.

  • New property name: TwoArmStudy@group_var is now TwoArmStudy@treatment_var.

New Features

  • Study base class: New abstract Study class provides common properties for all study types.

  • MultiArmStudy: New class for studies with 3+ treatment arms.

  • StudySet: New class for collections of studies (meta-analysis, NMA).

  • Statistical result classes: New StatResult hierarchy with ComparisonResult, MetaResult, and EvidenceGrade for type-safe results.

Documentation

  • Added notes/ARCHITECTURE_DECISIONS.md documenting class hierarchy and naming conventions.

pharmhand 0.0.13.9000

Fixes

  • Make chef integration resilient to missing stratification columns
  • Add data.table guardrails and endpoints validation for chef pipeline usage

Maintenance

  • Add internal ph_inform helper for consistent messaging
  • Scope custom translation keys to requested locale in list_translation_keys()

pharmhand 0.0.12.9000

Maintenance

  • Wrap add_translation assignment to satisfy lintr line-length limits

pharmhand 0.0.11.9000

Fixes

  • Avoid Rplot.pdf during tests by building plots instead of printing

Documentation

Maintenance

  • Relax R version requirement to >= 4.1.0
  • Consolidate development artifacts under notes/ and exclude the directory in .Rbuildignore
  • Use paste0() for missing-translation warnings

pharmhand 0.0.10.9000

Fixes

  • Enforce unique ADSL USUBJID when joining subgroup variables
  • Standardize data frame validation in lab summary, shift, and subgroup tables

Documentation

  • Clarify Love plot threshold override for BalanceAssessment inputs
  • Clarify multi-level categorical SMD return semantics

Tests

  • Add coverage for duplicate ADSL USUBJID checks in subgroup analysis

Maintenance

  • Use modifyList for translation merges
  • Drop explicit tidyselect import (dplyr re-exports used)

pharmhand 0.0.9.9000

Fixes

  • NNT CI crossing zero now returns non-estimable bounds
  • NA handling in assert_character_scalar
  • Translations merge precedence
  • ClinicalContent validation now uses assert_true for clearer errors

Documentation

  • Logit/raw SMD method documentation
  • Hommel method in adjust_method

Tests

  • calculate_nnt coverage

pharmhand 0.0.8.9000

Breaking changes

  • Removed save_as_pdf() and PDF output for ClinicalTable format_content.

Fixes

  • AE comparison multi-arm columns
  • Zebra striping order
  • Subgroup vars from adsl
  • Required column validation for primary/CFB tables

Improvements

  • continuous_threshold parameter + multi-arm warning
  • Love plot annotation placement
  • Rounded KM y labels/pt constant
  • Clarified errors/ph_abort consistency

pharmhand 0.0.7.9000

Maintenance

  • Removed cli and scales from Imports and replaced with base R helpers
  • Moved data.table and patchwork to Suggests (optional for chef integration and risk tables)
  • Removed unused Suggests: yaml, checkmate, webshot2
  • Updated example report scripts to use base R messaging

pharmhand 0.0.6.9000

New features

pharmhand 0.0.5.9000

New features

pharmhand 0.0.4.9000

New features

  • Unified treatment variable API across safety and efficacy tables:
  • Added create_ae_comparison_table() for adverse event comparisons with risk metrics:
    • Accessible via create_ae_table(type = "comparison")
    • Calculates risk difference (RD) and risk ratio (RR) with confidence intervals
    • Supports grouping by SOC, PT, or overall
    • Configurable reference group and incidence threshold filtering
    • Chi-square or Fisher’s exact test for p-values

pharmhand 0.0.3.9000

New features

pharmhand 0.0.2.9000

Documentation

  • Vignettes now display all generated tables using flextable rendering

  • Large tables (SOC/PT, lab shift, medical history, conmeds) are collapsible with <details> tags

  • Added dark mode support for pkgdown site tables via CSS overrides for flextable compatibility

  • Fixed format_spec() roxygen documentation

Bug fixes

  • Fixed vignette data loading to use correct pharmaverseadam dataset names (adtte_onco, adrs_onco)

  • Fixed treatment variable usage (ARM vs TRT01P) for oncology datasets

pharmhand 0.0.1.9000

New features

Reporting

Formatting

chef integration

  • run_chef_pipeline() executes chef pipelines

  • chef_to_analysis_results() converts chef output

pharmhand 0.0.0.9000

New features

  • Initial package release
  • S7 class system for clinical content (ADaMData, ClinicalTable, ClinicalPlot, ClinicalReport, StudyResult)
  • ADaM dataset handling with population filters
  • Safety tables: AE overview, SOC/PT summaries, severity, relationship, SAEs, deaths
  • Efficacy tables: primary endpoints, subgroup analyses
  • Word document generation via officer/flextable
  • Integration with chef package for HTA/AMNOG analyses

Documentation

  • Added package documentation and examples