View source: R/todo/survReport.R View source: R/survReport.r
| survReport | R Documentation | 
Generate a Survival Report with Kaplan-Meier Estimates
survReport(
  formula,
  data = NULL,
  subset = NULL,
  na.action = na.retain,
  ylab = NULL,
  what = c("S", "1-S"),
  conf = c("diffbands", "bands", "bars", "none"),
  cause = NULL,
  panel = "surv",
  subpanel = NULL,
  head = NULL,
  tail = NULL,
  h = 3,
  w = 4.5,
  multi = FALSE,
  markevent = TRUE,
  mfrow = NULL,
  y.n.risk = 0,
  mylim = NULL,
  bot = 2,
  aehaz = TRUE,
  times = NULL,
  append = FALSE,
  opts = NULL,
  ...
)
| formula | a formula with survival ( | 
| data | data.frame | 
| subset | optional subsetting criteria | 
| na.action | function for handling  | 
| ylab | character. Passed to  | 
| what | 
 | 
| conf | character. See  | 
| cause | character vector or list.  If a vector, every  | 
| panel | character string. Name of panel, which goes into file base names and figure labels for cross-referencing. | 
| subpanel | character string.  If calling  | 
| head | character string. Specifies initial text in the figure caption, otherwise a default is used. | 
| tail | optional character string. Specifies final text in the figure caption, e.g., what might have been put in a footnote in an ordinary text page. This appears just before any needles. | 
| h | numeric. Height of plots. | 
| w | numeric. Width of plots in inches. | 
| multi | logical.  If  | 
| markevent | logical.  Applies only if  | 
| mfrow | numeric 2-vector, used if  | 
| y.n.risk | used if  | 
| mylim | numeric 2-vector.  Used to force expansion of computed y-axis limits.  See  | 
| bot | number of spaces to reserve at bottom of plot for numbers at risk, if  | 
| aehaz | logical.  Set to  | 
| times | numeric vector. If specified, prints cumulative incidence probabilities at those times on the plots. | 
| append | logical. If  | 
| opts | list.  A list specifying arguments to  | 
| ... | ignored | 
## See tests directory test.Rnw for a live example
## Not run: 
  set.seed(1)
  n <- 400
  dat <- data.frame(t1=runif(n, 2, 5), t2=runif(n, 2, 5),
                    e1=rbinom(n, 1, .5), e2=rbinom(n, 1, .5),
                    treat=sample(c('a','b'), n, TRUE))
  dat <- upData(dat,
                labels=c(t1='Time to operation',
                         t2='Time to rehospitalization',
                         e1='Operation', e2='Hospitalization',
                         treat='Treatment')
                units=c(t1='year', t2='year'))
  survReport(Surv(t1, e1) + Surv(t2, e2) ~ treat, data=dat)
  dat <- upData(dat, labels=c(t1='Follow-up Time', t2='Time'),
                cause=factor(sample(c('death','MI','censor'), n, TRUE),
                             c('censor', 'MI', 'death')))
  survReport(Surv(t1, cause) ~ treat, cause='death', data=dat)
  survReport(Surv(t1, cause) + Surv(t2, cause) ~ treat,
             cause=list(c('death', 'MI'), 'death'), data=dat)
  # Two plots for t1, one plot for t2
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.