Kaplan Meier plot

Share:

Description

Plot empirical survival functions using the Kaplan Meier estimate.

Usage

1
kmplotmlx(r, index = 1, level = NULL)

Arguments

r

a data frame with a column id, a column time, a column with values and possibly a column group.

index

an integer: index=k means that the survival function for the k-th event is displayed. Default is index=1.

level

a number between 0 and 1: confidence interval level.

Details

See http://simulx.webpopix.org/mlxr/kmplotmlx/ for more details.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## Not run: 
tteModel1 <- inlineModel("
  [LONGITUDINAL]
  input = {beta,lambda}  
  EQUATION:
  h=(beta/lambda)*(t/lambda)^(beta-1)
  DEFINITION:
  e = {type=event, maxEventNumber=1, rightCensoringTime=70, hazard=h}
  ")

  p1   <- c(beta=2.5,lambda=50)
  e    <- list(name='e', time=0)
  res1 <- simulx(model=tteModel1, parameter=p1, output=e, group=list(size=100))
  pl1  <- kmplotmlx(res1$e,level=0.95)
  print(pl1)

  p2   <- c(beta=2,lambda=45)
  g1   <- list(size=50, parameter=p1)
  g2   <- list(size=100, parameter=p2)
  res2 <- simulx(model=tteModel1, output=e, group=list(g1,g2))
  pl2  <- kmplotmlx(res2$e)
  print(pl2)

## End(Not run)