ettbc (development version)
Added
predict_survival_unadjusted(),predict_survival_baseline_adjusted(), andpredict_survival_ipw(): fit pooled logistic regression models with restricted cubic spline time terms and arm-by-time interactions, then apply g-computation to produce marginal survival curves for each trial arm. All three functions now apply themax_monthfilter before model fitting, require both arms to be present (before and after filtering), and validateweight_colwhen supplied (#1).Added
compute_ipw_weights(): computes stabilized cumulative IPW weights for each participant-arm-month, truncated at the 99th percentile computed separately within each arm. CONTINUE-arm weight logic matches the SAScann17bimplementation: updates occur at every month in thetslm_lag11–13 compliance window (not only whenscrmammo == 1), using conditional uniform probabilities (1/3, 1/2, 1 at months 11, 12, 13 respectively), and stop after a breast-cancer diagnosis (#1).Added
fit_outcome_hr(): fits an IPW-weighted pooled logistic regression and returns the odds ratio (hazard ratio approximation) for the STOPBASE arm with a 95% Wald CI. Uses cluster-robust variance viasandwich::vcovCL()whensandwichis available (newcluster_id_colargument). Validates bothweight_colandcluster_id_colbefore fitting. AddedsandwichtoSuggests(#1).Added
bootstrap_ci(): nonparametric bootstrap for 95% percentile confidence intervals on the IPW-estimated survival difference. Failed iterations are counted; a warning is issued when the failure rate exceedsfail_threshold(default 10%). The caller’s RNG state is saved and restored on exit. Validates thatn_bootis a positive integer (#1).Added
false_positives(): computes false positive rates for histological evaluations, stratified by trial arm and screening round. Filters evaluations to within each arm’s observed follow-up and deduplicates repeat evaluations withinwindow_monthsper participant-arm (#1).Added
extract_screening_mammograms(),extract_any_mammograms(), andextract_diagnostic_mammograms(): template functions for extracting mammogram events from Medicare claims data by HCPCS code (#1).Added
splinesandclitoImportsinDESCRIPTION.Added
clone_censor(): implements the clone-censor step of the target trial emulation methodology. Creates two clones per participant (STOPBASE and CONTINUE arms) and applies the corresponding censoring rules (#1).Added
expand_to_long(): converts cloned data to one row per participant-arm-month for use in discrete-time survival analysis (#1).Added example synthetic datasets:
cohort,screening_mammograms, anddiagnostic_mammograms(#1).Added vignette article “Using ettbc: Emulating a Target Trial for Breast Cancer Screening” (#1).
Updated
DESCRIPTIONtitle and description to reflect the package purpose.
ettbc 0.0.0.9000
- Initial development version