Learn R Programming

survMisc (version 0.2)

tneSurv: Time, No. at risk, No. events

Description

Gives time, no. at risk and no. events for a Surv object describing right censored data.

Usage

tneSurv(s, onlyEvents = TRUE)

Arguments

s
A Surv object
onlyEvents
if TRUE shows only times at which at least one event occurred. Otherwise shows all times recorded (including those censored).

Value

  • A data frame with columns:
  • ttime
  • nno. at risk
  • eno. events

Examples

Run this code
df0 <- data.frame(t=c(1,1,2,3,5,8,13,21),
                  e=rep(c(0,1),4))
s1 <- Surv(df0$t,df0$e,type="right")
tneSurv(s1)

Run the code above in your browser using DataLab