Skip to contents

Data Preparation

Create counting-process datasets for survival analysis

df_counting()
Weighted and Stratified Survival Analysis
get_dfcounting()
Get df_counting results
extract_group_data()
Extract time, event, and weight data for a group
get_event_risk_matrices()
Event and Risk Matrices for Survival Analysis
get_censoring_and_events()
Get censoring and event times and their indices
calculate_risk_event_counts()
Calculate risk set and event counts at time points
count_weighted()
Weighted counting process
risk_weighted()
Weighted risk set

Weighted Cox Models

Fit weighted Cox proportional hazards models with resampling inference

cox_rhogamma()
Weighted Cox Model with Rho-Gamma Weights
cox_rhogamma_resample()
Resampling for Weighted Cox Model (rho, gamma)
cox_score_rhogamma()
Cox score with rho-gamma weights
find_cox_root()
Root-finding for Cox score function
ci_cox()
Confidence interval for Cox model estimate
score_calculation()
Score calculation for weighted Cox model
N_rhogamma()
Weighted event count for Cox model

Weighted Log-Rank Tests

Weighted log-rank statistics and diagnostics

wlr_dhat_estimates()
Weighted Log-Rank and Difference Estimate at a Specified Time
wlr_cumulative()
Weighted log-rank cumulative statistics
check_results()
Check and Compare Statistical Test Results

Kaplan-Meier Estimation

Weighted KM curves, survival differences, and confidence bands

KM_diff()
Kaplan-Meier Difference Between Groups
KM_estimates()
Kaplan-Meier Survival Estimates and Variance
resampling_survival()
Resampling Survival Curves for Confidence Bands
km_quantile()
Kaplan-Meier quantile and confidence interval
km_quantile_table()
Table of KM quantiles for two groups
kmq_calculations()
Kaplan-Meier quantile calculation
check_km_curve()
Check KM curve for validity

KM Plotting

Plot weighted Kaplan-Meier curves with risk tables and annotations

plot_weighted_km()
Plot weighted Kaplan-Meier curves
plot_km()
Plot Kaplan-Meier curves
plotKM.band_subgroups()
Plot Kaplan-Meier Survival Difference Curves with Subgroups and Confidence Bands
plot_km_curves_counting()
Plot KM curves for two groups with optional confidence intervals and censoring marks
plot_km_confint_polygon()
Plot confidence interval polygon for KM curve
KM_plot_2sample_weighted_counting()
Plot Weighted Kaplan-Meier Curves for Two Samples (Counting Process Format)
add_risk_table()
Add risk table annotation to KM plot
add_legends()
Add legends to KM plot
add_median_annotation()
Add median annotation to KM plot
get_riskpoints()
Get risk set counts at specified risk points

RMST

Restricted Mean Survival Time calculations with confidence bands

cumulative_rmst_bands()
Cumulative RMST bands for survival curves

Weighting Schemes

Weight function computation, validation, and visualization

wt.rg.S()
Compute Time-Dependent Weights for Survival Analysis
get_weights()
Get weights for a weighting scheme
get_validated_weights()
Get validated weights for a data frame
extract_and_calc_weights()
Extract and calculate weights for multiple schemes
validate_scheme_params()
Validate weighting scheme parameters
plot_weight_schemes()
Plot weight schemes for survival analysis

Baseline Tables

Publication-ready baseline characteristics tables

create_baseline_table()
Create Baseline Characteristics Table by Treatment Arm

Utilities

Input validation and formatting helpers

validate_input()
Validate required columns in a data frame
format_pval()
Format p-value for display
safe_run()
Safe execution wrapper