Debian Codegraph @

man/Cuminc.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/Cuminc.R
3 \name{Cuminc}
4 \alias{Cuminc}
5 \alias{print.Cuminc}
6 \title{Calculate nonparametric cumulative incidence functions and associated
7 standard errors}
8 \usage{
9 Cuminc(time, status, data, group, na.status = c("remove", "extra"), ...)
10 }
11 \arguments{
12 \item{time}{Either 1) a numeric vector containing the failure times or 2) a
13 string containing the column name indicating these failure times}
14
15 \item{status}{Either 1) a numeric, factor or character vector containing the
16 failure codes or 2) a string containing the column name indicating these
17 failure codes}
18
19 \item{data}{When appropriate, a data frame containing \code{time},
20 \code{status} and/or \code{group} variables}
21
22 \item{group}{Optionally, name of column in data indicating a grouping
23 variable; cumulative incidence functions are calculated for each value or
24 level of \code{group}. If missing no groups are considered}
25
26 \item{na.status}{One of \code{"remove"} (default) or \code{"extra"},
27 indicating whether subjects with missing cause of failure should be removed
28 or whether missing cause of failure should be treated as a separate cause of
29 failure}
30
31 \item{...}{Allows extra arguments for future extensions, but for now just
32 used for backwards compatibility (e.g. allowing use of defunct \code{failcodes}
33 argument in reverse dependencies).}
34 }
35 \value{
36 An object of class \code{"Cuminc"}, which is a data frame containing
37 the estimated failure-free probabilities and cumulative incidences and their
38 standard errors. The names of the dataframe are \code{time}, \code{Surv},
39 \code{seSurv}, and \code{cuminc} and \code{secuminc} followed by the values
40 or levels of the \code{failcodes}. If \code{group} was specified, a
41 \code{group} variable is included with the same name and values/levels as
42 the original grouping variable, and with estimated cumulative incidences
43 (SE) for each value/level of \code{group}.
44
45 Cuminc is now simply a wrapper around survfit of the survival package with
46 type=\code{"mstate"}, only maintained for backward compatibility. The
47 survfit object is kept as attribute (\code{attr("survfit")}), and the print,
48 plot and summary functions are simply print, plot and summary applied to the
49 survfit object. Subsetting the \code{"Cuminc"} object results in subsetting
50 the data frame, not in subsetting the survfit object.
51 }
52 \description{
53 This function computes nonparametric cumulative incidence functions and
54 associated standard errors for each value of a group variable.
55 }
56 \details{
57 The estimated cumulative incidences are as described in Putter, Fiocco &
58 Geskus (2007); the standard errors are the square roots of the Greenwood
59 variance estimators, see eg. Andersen, Borgan, Gill & Keiding (1993), de
60 Wreede, Fiocco & Putter (2009), and they correspond to the variances in eg.
61 Marubini & Valsecchi (1995). In case of no censoring, the estimated
62 cumulative incidences and variances reduce to simple binomial frequencies
63 and their variances.
64 }
65 \examples{
66
67 ### These data were used in Putter, Fiocco & Geskus (2007)
68 data(aidssi)
69 ci <- Cuminc(time=aidssi$time, status=aidssi$status)
70 head(ci); tail(ci)
71 ci <- Cuminc(time="time", status="status", data=aidssi, group="ccr5")
72 head(ci); tail(ci)
73
74 ### Some fake data
75 fake <- data.frame(surv=c(seq(2,10,by=2),seq(1,13,by=3),seq(1,9,by=2),seq(1,13,by=3)),
76 stat=rep(0:3,5),Tstage=c(1:4,rep(1:4,rep(4,4))))
77 fake$stat[fake$stat==0 & fake$Tstage==2] <- 3
78 fake$stat[fake$stat==3 & fake$Tstage==1] <- 2
79 fake
80 Cuminc(time="surv", status="stat", data=fake)
81 # If we remove all entries with status=0,
82 # we should get binomial sample probabilities and corresponding SEs
83 fake0 <- fake[fake$stat!=0,]
84 Cuminc(time="surv", status="stat", data=fake0)
85
86 }
87 \references{
88 Andersen PK, Borgan O, Gill RD, Keiding N (1993).
89 \emph{Statistical Models Based on Counting Processes}. Springer, New York.
90
91 Marubini E, Valsecchi MG (1995). \emph{Analysing Survival Data from Clinical
92 Trials and Observational Studies}. Wiley, New York.
93
94 Putter H, Fiocco M, Geskus RB (2007). Tutorial in biostatistics: Competing
95 risks and multi-state models. \emph{Statistics in Medicine} \bold{26},
96 2389--2430.
97
98 de Wreede L, Fiocco M, Putter H (2009). The mstate package for estimation
99 and prediction in non- and semi-parametric multi-state models. Submitted.
100 }
101 \author{
102 Hein Putter \email{[email protected]}
103 }
104 \keyword{survival}