weightedsurv0.1.0 package

Survival Analysis with Subject-Specific (Case Weights) and Time-Dependent Weighting

add_legends

Add legends to KM plot

add_median_annotation

Add median annotation to KM plot

add_risk_table

Add risk table annotation to KM plot

calculate_risk_event_counts

Calculate risk set and event counts at time points

check_km_curve

Check KM curve for validity

check_results

Check and Compare Statistical Test Results

ci_cox

Confidence interval for Cox model estimate

count_weighted

Weighted counting process

cox_rhogamma_resample

Resampling for Weighted Cox Model (rho, gamma)

cox_rhogamma

Weighted Cox Model with Rho-Gamma Weights

cox_score_rhogamma

Cox score with rho-gamma weights

create_baseline_table

Create Baseline Characteristics Table by Treatment Arm

cumulative_rmst_bands

Cumulative RMST bands for survival curves

df_counting

Weighted and Stratified Survival Analysis

extract_and_calc_weights

Extract and calculate weights for multiple schemes

extract_group_data

Extract time, event, and weight data for a group

find_cox_root

Root-finding for Cox score function

format_pval

Format p-value for display

get_censoring_and_events

Get censoring and event times and their indices

get_dfcounting

Get df_counting results

get_event_risk_matrices

Event and Risk Matrices for Survival Analysis

get_riskpoints

Get risk set counts at specified risk points

get_validated_weights

Get validated weights for a data frame

get_weights

Get weights for a weighting scheme

KM_diff

Kaplan-Meier Difference Between Groups

KM_estimates

Kaplan-Meier Survival Estimates and Variance

KM_plot_2sample_weighted_counting

Plot Weighted Kaplan-Meier Curves for Two Samples (Counting Process Fo...

km_quantile_table

Table of KM quantiles for two groups

km_quantile

Kaplan-Meier quantile and confidence interval

kmq_calculations

Kaplan-Meier quantile calculation

N_rhogamma

Weighted event count for Cox model

plot_km_confint_polygon

Plot confidence interval polygon for KM curve

plot_km_curves_counting

Plot KM curves for two groups with optional confidence intervals and c...

plot_km

Plot Kaplan-Meier curves

plot_weight_schemes

Plot weight schemes for survival analysis

plot_weighted_km

Plot weighted Kaplan-Meier curves

plotKM.band_subgroups

Plot Kaplan-Meier Survival Difference Curves with Subgroups and Confid...

resampling_survival

Resampling Survival Curves for Confidence Bands

risk_weighted

Weighted risk set

safe_run

Safe execution wrapper

score_calculation

Score calculation for weighted Cox model

validate_input

Validate required columns in a data frame

validate_scheme_params

Validate weighting scheme parameters

weightedsurv-package

Weighted Survival Analysis Tools

wlr_cumulative

Weighted log-rank cumulative statistics

wlr_dhat_estimates

Weighted Log-Rank and Difference Estimate at a Specified Time

wt.rg.S

Compute Time-Dependent Weights for Survival Analysis

Provides survival analysis functions with support for time-dependent and subject-specific (e.g., propensity score) weighting. Implements weighted estimation for Cox models, Kaplan-Meier survival curves, and treatment differences with point-wise and simultaneous confidence bands. Includes restricted mean survival time (RMST) comparisons evaluated across all potential truncation times with both point-wise and simultaneous confidence bands. See Cole, S. R. & Hernán, M. A. (2004) <doi:10.1016/j.cmpb.2003.10.004> for methodological background.

  • Maintainer: Larry Leon
  • License: MIT + file LICENSE
  • Last published: 2025-12-22