aalen_johansen: Aalen-Johansen Point Estimator

View source: R/aalen_johansen.R

aalen_johansenR Documentation

Aalen-Johansen Point Estimator

Description

Computes nonparametric estimates of transition probabilities using the Aalen-Johansen estimator via Nelson-Aalen cumulative hazard increments and product-integral construction.

Usage

aalen_johansen(msdata, s = 0)

Arguments

msdata

An msdata object from prepare_data.

s

Legacy numeric starting-time argument. Only 0 is accepted.

Details

The Aalen-Johansen estimator generalizes the Kaplan-Meier estimator to multistate models. RFmstate exposes it as a descriptive, covariate-free calendar-time population benchmark from the recorded common baseline.

The estimator uses calendar-time risk sets and is separate from the package's clock-reset semi-Markov forest solver. It is a covariate-free descriptive benchmark from the common baseline. Observed competing exits are transitions, not external censoring. No clipping or row normalization is applied.

Value

An object of class "aj_estimate" containing:

time

Numeric vector of unique event times.

trans_prob

List of calendar-time product-integral point-estimate matrices from the recorded common baseline at each event time.

state_occ

Matrix of state occupation probabilities over time. Rows are time points, columns are states.

cum_hazard

List of Nelson-Aalen cumulative hazard matrices.

hazard_inc

List of hazard increment matrices at each event time.

n_risk

Matrix of at-risk counts over time.

n_events

Data frame of event counts per transition.

structure

The multistate structure used.

s

The starting time.

time_scale

Calendar time from the common study origin.

uncertainty

Statement that no validated variance or confidence interval is returned.

Limitations

Only the recorded common baseline s = 0 is supported. The function does not support left truncation, general conditional P(s,t) for s > 0, covariate adjustment, or validated variance/confidence bands. The point estimate should not be described as the covariate-free form of the clock-reset forest model.

Examples

ms <- clinical_states()
dat <- sim_clinical_data(n = 200, structure = ms, seed = 42)
msdata <- prepare_data(
  data = dat, id = "ID", structure = ms,
  time_map = list(
    Responded = "time_Responded",
    Unresponded = "time_Unresponded",
    Stabilized = "time_Stabilized",
    Progressed = "time_Progressed",
    Death = "time_Death"
  ),
  censor_col = "time_censored",
  covariates = c("age", "sex", "BMI", "treatment")
)
aj <- aalen_johansen(msdata)
print(aj)


RFmstate documentation built on Sept. 10, 2026, 1:09 a.m.