# recurrent.marginal.mean: Estimates marginal mean of recurrent events In timereg: Flexible Regression Models for Survival Data

## Description

Fitting two aalen models for death and recurent events these are combined to prducte the estimator

\int_0^t S(u) dR(u)

the mean number of recurrent events, here

S(u)

is the probability of survival, and

dR(u)

is the probability of an event among survivors.

## Usage

 1 recurrent.marginal.mean(recurrent, death) 

## Arguments

 recurrent aalen model for recurrent events death aalen model for recurrent events

## Details

IID versions used for Ghosh & Lin (2000) variance. See also mets package for quick version of this for large data mets:::recurrent.marginal, these two version should give the same when there are no ties.

Thomas Scheike

## References

Ghosh and Lin (2002) Nonparametric Analysis of Recurrent events and death, Biometrics, 554–562.

## Examples

  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ### get some data using mets simulaitons library(mets) data(base1cumhaz) data(base4cumhaz) data(drcumhaz) dr <- drcumhaz base1 <- base1cumhaz base4 <- base4cumhaz rr <- simRecurrent(100,base1,death.cumhaz=dr) rr$x <- rnorm(nrow(rr)) rr$strata <- floor((rr\$id-0.01)/50) drename(rr) <- start+stop~entry+time ar <- aalen(Surv(start,stop,status)~+1+cluster(id),data=rr,resample.iid=1 ,max.clust=NULL) ad <- aalen(Surv(start,stop,death)~+1+cluster(id),data=rr,resample.iid=1, ,max.clust=NULL) mm <- recurrent.marginal.mean(ar,ad) with(mm,plot(times,mu,type="s")) with(mm,lines(times,mu+1.96*se.mu,type="s",lty=2)) with(mm,lines(times,mu-1.96*se.mu,type="s",lty=2)) 

timereg documentation built on Oct. 13, 2021, 5:06 p.m.