Learn R Programming

mets (version 1.2.3.1)

prob.exceed.recurrent: Estimation of probability of more that k events for recurrent events process

Description

Estimation of probability of more that k events for recurrent events process where there is terminal event, based on this also estimate of variance of recurrent events.

Usage

prob.exceed.recurrent(data, type, status = "status", death = "death",
  start = "start", stop = "stop", id = "id", times = NULL,
  exceed = NULL)

Arguments

data

data-frame

type

type of evnent (code) related to status

status

name of status

death

name of death indicator

start

start stop call of Hist() of prodlim

stop

start stop call of Hist() of prodlim

id

id

times

time at which to get probabilites P(N1(t) >= n)

exceed

n's for which which to compute probabilites P(N1(t) >= n)

...

Additional arguments to lower level funtions

Examples

Run this code
# NOT RUN {
### do not test to avoid dependence on prodlim 
library(prodlim)

########################################
## getting some rates to mimick 
########################################

data(base1cumhaz)
data(base4cumhaz)
data(drcumhaz)
dr <- drcumhaz
base1 <- base1cumhaz
base4 <- base4cumhaz

cor.mat <- corM <- rbind(c(1.0, 0.6, 0.9), c(0.6, 1.0, 0.5), c(0.9, 0.5, 1.0))
rr <- simRecurrent(1000,base1,cumhaz2=base4,death.cumhaz=dr)
dtable(rr,~death+status)

pp <- prob.exceed.recurrent(rr,1,status="status",death="death",start="entry",stop="time",id="id")
with(pp, matplot(times,prob,type="s"))
###
with(pp, matlines(times,se.lower,type="s"))
with(pp, matlines(times,se.upper,type="s"))
# }

Run the code above in your browser using DataLab