mcf: Mean cumulative function of recurrent event data

View source: R/mcf.R

mcfR Documentation

Mean cumulative function of recurrent event data

Description

Nonparametric (Nelson-Aalen type) estimate of the mean cumulative function, i.e. the expected number of events experienced by a subject up to each calendar time, optionally by group.

Usage

mcf(formula, data)

## S3 method for class 'mcf'
print(x, ...)

Arguments

formula

a formula object with a Survr() object as the response on the left of the ~ operator and a grouping term (or 1) on the right.

data

a data frame in which to interpret the variables named in the formula.

x

an mcf object.

...

further arguments passed to print.data.frame().

Details

Calendar times are reconstructed as the within-subject cumulative sums of the gap times of the Survr() response. At each distinct event calendar time t the estimate increases by dN(t)/Y(t), where dN(t) is the number of events observed at t and Y(t) the number of subjects still under observation (total observation time \ge t).

Value

An object of class mcf: a data frame with columns group, time, n.event, n.risk and mcf, with print and autoplot methods.

References

Lawless, J.F. and Nadeau, C. (1995). Some Simple Robust Methods for the Analysis of Recurrent Events. Technometrics 37, 158–168.

See Also

autoplot.mcf(), survfitr()

Examples

data(MMC)
m <- mcf(Survr(id, time, event) ~ group, data = MMC)
m
autoplot(m)

survrec documentation built on Sept. 22, 2026, 9:07 a.m.