km_ratio_greenwood: Weighted KM survival ratio S1(t0)/S0(t0) with a...

View source: R/km_ratio.R

km_ratio_greenwoodR Documentation

Weighted KM survival ratio S1(t0)/S0(t0) with a Greenwood-based CI

Description

Wald CI on the log scale, with ⁠se(log S) = se(S) / S⁠ for each arm and se(S) from Greenwood's formula.

Usage

km_ratio_greenwood(time, status, A, t0, alpha = 0.05, weights = NULL)

Arguments

time

Event/censoring time.

status

Event indicator (1 = event, 0 = censored).

A

Treatment indicator (0/1; numeric, logical, character, or factor).

t0

Time at which to evaluate the survival ratio.

alpha

Significance level for the confidence interval (default 0.05).

weights

Optional case weights (e.g. SBW), passed to survival::survfit(). The weights are treated as fixed and known, so with estimated weights such as SBW, se_log and the CI ignore the uncertainty from estimating them; use boot_km_ratio() for inference.

Value

A list with S0, S1, ratio (= S1(t0)/S0(t0)), log_ratio, se_log, ci_ratio, and ci_log.


sbwadjust documentation built on Oct. 10, 2026, 5:08 p.m.