Learn R Programming

survMisc (version 0.4.6)

mean.Surv: Mean for Surv object

Description

Mean for Surv object

Usage

## S3 method for class 'Surv':
mean(x, alpha = 0.05, method = c("Efron", "Gill", "Brown"),
  tMax = NULL, by = 1, dfm = FALSE, ...)

Arguments

x
A Surv object
alpha
Significance level $\alpha$
method
If the last observation is censored at time $t_k$, one of the following values for $\hat{S}$, the Kaplan-Meier estimate of survival time from then until tMax is used: [object Object],[object Object],.,[object Object]
tMax
If the last observation is censored at time $t_k$, an estimate of $\hat{S}$ will be generated from $t_k$ to tMax. If tMax=NULL a value of $2 \times t_{max}$, twice the longest time recorded, is used.
by
Increments (units of time) between $t_k$ and tMax
dfm
If TRUE, will return the dataframe used to calculate the statistics
...
Additional arguments

Value

  • A list with the following elements:
  • meanMean of the Surv object
  • varianceThe variance
  • CIThe confidence level (from $alpha$ above)
  • upperUpper value for confidence interval
  • lowerLower value for the confidence interval
  • If the last observation is censored at time $t_k$, two values are returned, one calculated up to $t_k$, the other to tMax.

Examples

Run this code
data(bmt, package="KMsurv")
b1 <- bmt[bmt$group==1, ] # ALL patients
s1 <- Surv(time=b1$t2, event=b1$d3)
mean(s1)
mean(Surv(time=c(6, 14, 21, 44, 62), event=c(1, 1, 0, 1, 1)))
mean(Surv(time=c(6, 14, 21, 44, 62), event=c(1, 1, 0, 1, 0)))

Run the code above in your browser using DataLab