mean_no: Non-parametric estimation of mean number of events

View source: R/mean_no.R

mean_noR Documentation

Non-parametric estimation of mean number of events

Description

Estimates the mean number of events using the non-parametric estimator described by Cook and Lawless (1997).

Usage

mean_no(
  formula,
  re_indicator,
  ce_indicator,
  cluster,
  data,
  re_control = list(),
  ce_control = list()
)

Arguments

formula

A formula passed to survfit.

re_indicator

The name of a variable indicating that these rows in the dataset belong to the risksets of the recurrent event process.

ce_indicator

The name of a variable indicating that these rows in the datasets belong to the riskset of the competing event process.

cluster

A character vector specifying the name of the variable that defines unique observations in the dataset passed to the function. This is only used for data checks

data

A data.frame in stacked format. The dataset needs to include one row for the competing event and one row for each risk episode of the recurrent event.

re_control

An optional list with arguments passed to survfit when computing risksets for the recurrent event.

ce_control

An optional list with arguments passed to survfit when computing risksets for the competing event.

Value

A data.frame including the estimated mean number of events expn at times t within strata strata.

Examples

library(survival)
mean_no(Surv(time  = start,
             time2 = stop,
             event = event,
             type  = 'counting') ~ pyridoxine + thiotepa,
        re_indicator = "re",
        ce_indicator = "ce",
        cluster = "id",
        data = bladder1_stacked)


JointFPM documentation built on Aug. 8, 2025, 7:44 p.m.