Title: | Nelson-Aalen Estimator of the Cumulative Hazard in Multistate Models |
---|---|
Description: | Computes the Nelson-Aalen estimator of the cumulative transition hazard for arbitrary Markov multistate models <ISBN:978-0-387-68560-1>. |
Authors: | Arthur Allignol |
Maintainer: | Arthur Allignol <[email protected]> |
License: | MIT + file LICENSE |
Version: | 2.0.1 |
Built: | 2024-11-07 03:10:42 UTC |
Source: | https://github.com/cran/mvna |
Outcomes of pregnancies exposed to coumarin derivatives. The aim is to investigate whether exposition to coumarin derivatives increases the probability of spontaneous abortions. Apart from spontaneous abortion, pregnancy may end in induced abortion or live birth. Moreover, data are left-truncated as women usually enter the study several weeks after conception.
data(abortion)
data(abortion)
A data frame with 1186 observations on the following 5 variables.
id
Identification number
entry
Entry times into the cohort
exit
Event times
group
Group. 0: control, 1: exposed to coumarin derivatives
cause
Cause of failure. 1: induced abortion, 2: life birth, 3: spontaneous abortion
Meiester, R. and Schaefer, C (2008). Statistical methods for estimating the probability of spontaneous abortion in observational studies – Analyzing pregnancies exposed to coumarin derivatives. Reproductive Toxicology, 26, 31–35
data(abortion)
data(abortion)
Lines method for mvna
objects.
## S3 method for class 'mvna' lines(x, tr.choice, col = 1, lty, conf.int = FALSE, level = 0.95, var.type = c("aalen", "greenwood"), ci.fun = c("log", "linear", "arcsin"), ci.col = col, ci.lty = 3, ...)
## S3 method for class 'mvna' lines(x, tr.choice, col = 1, lty, conf.int = FALSE, level = 0.95, var.type = c("aalen", "greenwood"), ci.fun = c("log", "linear", "arcsin"), ci.col = col, ci.lty = 3, ...)
x |
An object of class |
tr.choice |
A character vector of the form |
col |
A vector of colours. Default is black. |
lty |
A vector of line types. Default is 1:number of transitions. |
conf.int |
Logical. Indicates whether to display pointwise
confidence interval. Default is |
level |
Level of the confidence interval. Default is 0.95. |
var.type |
Specifies the variance estimator that should be used to compute the confidence interval. One of "aalen" or "greenwood". Default is "aalen". |
ci.fun |
Specifies the transformation applied to the confidence interval. Choices are "linear", "log", "arcsin". Default is "log". |
ci.col |
Colours of the confidence interval lines. By default,
|
ci.lty |
Line types for the confidence intervals. Default is 3. |
... |
Further arguments for |
No value returned.
Arthur Allignol, [email protected]
data(sir.adm) ## data set transformation data(sir.adm) id <- sir.adm$id from <- sir.adm$pneu to <- ifelse(sir.adm$status==0,"cens",sir.adm$status+1) times <- sir.adm$time dat.sir <- data.frame(id,from,to,time=times) ## Possible transitions tra <- matrix(ncol=4,nrow=4,FALSE) tra[1:2,3:4] <- TRUE na.pneu <- mvna(dat.sir,c("0","1","2","3"), tra,"cens") plot(na.pneu, tr.choice = c("0 2"), conf.int = TRUE, col = 1, lty = 1, legend = FALSE) lines(na.pneu, tr.choice = c("1 2"), conf.int = TRUE, col = 2, lty = 1)
data(sir.adm) ## data set transformation data(sir.adm) id <- sir.adm$id from <- sir.adm$pneu to <- ifelse(sir.adm$status==0,"cens",sir.adm$status+1) times <- sir.adm$time dat.sir <- data.frame(id,from,to,time=times) ## Possible transitions tra <- matrix(ncol=4,nrow=4,FALSE) tra[1:2,3:4] <- TRUE na.pneu <- mvna(dat.sir,c("0","1","2","3"), tra,"cens") plot(na.pneu, tr.choice = c("0 2"), conf.int = TRUE, col = 1, lty = 1, legend = FALSE) lines(na.pneu, tr.choice = c("1 2"), conf.int = TRUE, col = 2, lty = 1)
This function computes the multivariate Nelson-Aalen estimator of the cumulative transition hazards in multistate models, that is, for each possible transition, it computes an estimate of the cumulative hazard.
mvna(data, state.names, tra, cens.name)
mvna(data, state.names, tra, cens.name)
data |
A data.frame of the form data.frame(id,from,to,time) or (id,from,to,entry,exit)
This data.frame is transition-oriented, i.e. it contains one row per transition, and possibly several rows per patient. Specifying an entry and exit time permits to take into account left-truncation. |
state.names |
A vector of character giving the states names. |
tra |
A quadratic matrix of logical values describing the possible transitions within the multistate model. |
cens.name |
A character giving the code for censored
observations in the column |
This functions computes the Nelson-Aalen estimator as described in Anderson et al. (1993), along with the two variance estimators described in eq. (4.1.6) and (4.1.7) of Andersen et al. (1993) at each transition time.
Returns a list named after the possible transitions, e.g. if we define a multistate model with two possible transitions: from state 0 to state 1, and from state 0 to state 2, the returned list will have two parts named "0 1" and "0 2". Each part contains a data.frame with columns:
na |
Nelson-Aalen estimates at each transition times. |
var.aalen |
Variance estimator given in eq. (4.1.6) of Andersen et al. (1993). |
var.greenwood |
Variance estimator given in eq. (4.1.7) of Andersen et al. (1993). |
time |
The transition times. |
The list also contains:
time |
All the event times. |
n.risk |
A matrix giving the number at individual at risk in the transient states just before an event. |
n.event |
An array which gives the number of transitions at each event times. |
n.cens |
A matrix giving the number a censored observations at each event times. |
state.names |
The same as in the function call. |
cens.name |
The same as in the function call. |
trans |
A data frame, with columns |
The variance estimator (4.1.6) may overestimate the true variance, and the one defined eq. (4.1.7) may underestimate the true variance (see Klein (1991) and Andersen et al. (example IV.1.1, 1993)), especially with small sample set. Klein (1991) recommends the use of the variance estimator of eq. (4.1.6, "aalen") because he found it to be less biased.
Arthur Allignol, [email protected]
Andersen, P.K., Borgan, O., Gill, R.D. and Keiding, N. (1993). Statistical models based on counting processes. Springer Series in Statistics. New York, NY: Springer.
Beyersmann J, Allignol A, Schumacher M: Competing Risks and Multistate Models with R (Use R!), Springer Verlag, 2012 (Use R!)
Klein, J.P. Small sample moments of some estimators of the variance of the Kaplan-Meier and Nelson-Aalen estimators. Scandinavian Journal of Statistics, 18:333–340, 1991.
data(sir.cont) # Modification for patients entering and leaving a state # at the same date sir.cont <- sir.cont[order(sir.cont$id, sir.cont$time), ] for (i in 2:nrow(sir.cont)) { if (sir.cont$id[i]==sir.cont$id[i-1]) { if (sir.cont$time[i]==sir.cont$time[i-1]) { sir.cont$time[i-1] <- sir.cont$time[i-1] - 0.5 } } } # Matrix of logical giving the possible transitions tra <- matrix(ncol=3,nrow=3,FALSE) tra[1, 2:3] <- TRUE tra[2, c(1, 3)] <- TRUE # Computation of the Nelson-Aalen estimates na <- mvna(sir.cont,c("0","1","2"),tra,"cens") # plot if (require(lattice)) xyplot(na) ### example with left-truncation data(abortion) # Data set modification in order to be used by mvna names(abortion) <- c("id", "entry", "exit", "from", "to") abortion$to <- abortion$to + 1 ## computation of the matrix giving the possible transitions tra <- matrix(FALSE, nrow = 5, ncol = 5) tra[1:2, 3:5] <- TRUE na.abortion <- mvna(abortion, as.character(0:4), tra, NULL) plot(na.abortion, tr.choice = c("0 4", "1 4"), curvlab = c("Control", "Exposed"), bty = "n", legend.pos = "topleft")
data(sir.cont) # Modification for patients entering and leaving a state # at the same date sir.cont <- sir.cont[order(sir.cont$id, sir.cont$time), ] for (i in 2:nrow(sir.cont)) { if (sir.cont$id[i]==sir.cont$id[i-1]) { if (sir.cont$time[i]==sir.cont$time[i-1]) { sir.cont$time[i-1] <- sir.cont$time[i-1] - 0.5 } } } # Matrix of logical giving the possible transitions tra <- matrix(ncol=3,nrow=3,FALSE) tra[1, 2:3] <- TRUE tra[2, c(1, 3)] <- TRUE # Computation of the Nelson-Aalen estimates na <- mvna(sir.cont,c("0","1","2"),tra,"cens") # plot if (require(lattice)) xyplot(na) ### example with left-truncation data(abortion) # Data set modification in order to be used by mvna names(abortion) <- c("id", "entry", "exit", "from", "to") abortion$to <- abortion$to + 1 ## computation of the matrix giving the possible transitions tra <- matrix(FALSE, nrow = 5, ncol = 5) tra[1:2, 3:5] <- TRUE na.abortion <- mvna(abortion, as.character(0:4), tra, NULL) plot(na.abortion, tr.choice = c("0 4", "1 4"), curvlab = c("Control", "Exposed"), bty = "n", legend.pos = "topleft")
Plot method for an object of class mvna
. This function plots
estimates of the cumulative transition hazards in one panel.
## S3 method for class 'mvna' plot(x, tr.choice, xlab = "Time", ylab = "Cumulative Hazard", col = 1, lty, xlim, ylim, conf.int = FALSE, level = 0.95, var.type = c("aalen", "greenwood"), ci.fun = c("log", "linear", "arcsin"), ci.col = col, ci.lty = 3, legend = TRUE, legend.pos, curvlab, legend.bty = "n", ...)
## S3 method for class 'mvna' plot(x, tr.choice, xlab = "Time", ylab = "Cumulative Hazard", col = 1, lty, xlim, ylim, conf.int = FALSE, level = 0.95, var.type = c("aalen", "greenwood"), ci.fun = c("log", "linear", "arcsin"), ci.col = col, ci.lty = 3, legend = TRUE, legend.pos, curvlab, legend.bty = "n", ...)
x |
An object of class |
tr.choice |
A character vector of the form |
xlab |
x-axis label. Default is "Time". |
ylab |
y-axis label. Default is "Cumulative Hazard". |
col |
Vector of colour. Default is black. |
lty |
Vector of line type. Default is 1:number of transitions |
xlim |
Limits of x-axis for the plot |
ylim |
Limits of y-axis for the plot |
conf.int |
Logical. Whether to display pointwise confidence intervals. Default is FALSE. |
level |
Level of the pointwise confidence intervals. Default is 0.95. |
var.type |
A character vector specifying the variance that should be used to compute the pointwise confidence intervals. Choices are "aalen" or "greenwood". Default is "aalen". |
ci.fun |
One of "log", "linear" or "arcsin". Indicates which transformation to apply to the confidence intervals. |
ci.col |
Colour for the confidence intervals. By default, the
colour specified by |
ci.lty |
Line type for the confidence intervals. Default is 3. |
legend |
A logical specifying if a legend should be added |
legend.pos |
A vector giving the legend's position. See
|
curvlab |
A character or expression vector to appear in the legend. Default is the name of the transitions. |
legend.bty |
Box type for the legend. |
... |
Further arguments for plot method. |
This plot method permits to draw several cumulative transition hazards on the same panel.
No value returned
Arthur Allignol [email protected]
data(sir.cont) # Modification for patients entering and leaving a state # at the same date sir.cont <- sir.cont[order(sir.cont$id, sir.cont$time), ] for (i in 2:nrow(sir.cont)) { if (sir.cont$id[i]==sir.cont$id[i-1]) { if (sir.cont$time[i]==sir.cont$time[i-1]) { sir.cont$time[i-1] <- sir.cont$time[i-1] - 0.5 } } } tra <- matrix(ncol=3,nrow=3,FALSE) tra[1, 2:3] <- TRUE tra[2, c(1, 3)] <- TRUE na.cont <- mvna(sir.cont,c("0","1","2"),tra,"cens") plot(na.cont, tr.choice=c("0 2", "1 2"))
data(sir.cont) # Modification for patients entering and leaving a state # at the same date sir.cont <- sir.cont[order(sir.cont$id, sir.cont$time), ] for (i in 2:nrow(sir.cont)) { if (sir.cont$id[i]==sir.cont$id[i-1]) { if (sir.cont$time[i]==sir.cont$time[i-1]) { sir.cont$time[i-1] <- sir.cont$time[i-1] - 0.5 } } } tra <- matrix(ncol=3,nrow=3,FALSE) tra[1, 2:3] <- TRUE tra[2, c(1, 3)] <- TRUE na.cont <- mvna(sir.cont,c("0","1","2"),tra,"cens") plot(na.cont, tr.choice=c("0 2", "1 2"))
This function gives the Nelson-Aalen estimates at time-points specified by the user.
## S3 method for class 'mvna' predict(object, times, tr.choice, level = 0.95, var.type = c("aalen", "greenwood"), ci.fun = c("log", "linear", "arcsin"), ...)
## S3 method for class 'mvna' predict(object, times, tr.choice, level = 0.95, var.type = c("aalen", "greenwood"), ci.fun = c("log", "linear", "arcsin"), ...)
object |
An object of class |
times |
Time-points at which one wants the estimates |
tr.choice |
A vector of character giving for which transitions one wants estimates. By default, the function will give the Nelson-Aalen estimates for all transitions. |
level |
Level of the pointwise confidence intervals. Default is 0.95. |
var.type |
Variance estimator displayed and used to compute the pointwise confidence intervals. One of "aalen" or "greenwood". Default is "aalen". |
ci.fun |
Which transformation to apply for the confidence intervals. Choices are "linear", "log" or "arcsin". Default is "log". |
... |
Other arguments to predict |
Returns a list named after the possible transitions, e.g. if we define a multistate model with two possible transitions: from state 0 to state 1, and from state 0 to state 2, the returned list will have two parts named "0 1" and "0 2". Each part contains a data.frame with columns:
times |
Time points specified by the user. |
na |
Nelson-Aalen estimates at the specified times. |
var.aalen or var.greenwood |
Depending on what was specified in
|
lower |
Lower bound of the pointwise confidence intervals. |
upper |
Upper bound. |
Arthur Allignol, [email protected]
Andersen, P.K., Borgan, O., Gill, R.D. and Keiding, N. (1993). Statistical models based on counting processes. Springer Series in Statistics. New York, NY: Springer.
data(sir.cont) # Modification for patients entering and leaving a state # at the same date sir.cont <- sir.cont[order(sir.cont$id, sir.cont$time), ] for (i in 2:nrow(sir.cont)) { if (sir.cont$id[i]==sir.cont$id[i-1]) { if (sir.cont$time[i]==sir.cont$time[i-1]) { sir.cont$time[i-1] <- sir.cont$time[i-1] - 0.5 } } } # Matrix of logical giving the possible transitions tra <- matrix(ncol=3,nrow=3,FALSE) tra[1, 2:3] <- TRUE tra[2, c(1, 3)] <- TRUE # Computation of the Nelson-Aalen estimates na <- mvna(sir.cont,c("0","1","2"),tra,"cens") # Using predict predict(na,times=c(1,5,10,15))
data(sir.cont) # Modification for patients entering and leaving a state # at the same date sir.cont <- sir.cont[order(sir.cont$id, sir.cont$time), ] for (i in 2:nrow(sir.cont)) { if (sir.cont$id[i]==sir.cont$id[i-1]) { if (sir.cont$time[i]==sir.cont$time[i-1]) { sir.cont$time[i-1] <- sir.cont$time[i-1] - 0.5 } } } # Matrix of logical giving the possible transitions tra <- matrix(ncol=3,nrow=3,FALSE) tra[1, 2:3] <- TRUE tra[2, c(1, 3)] <- TRUE # Computation of the Nelson-Aalen estimates na <- mvna(sir.cont,c("0","1","2"),tra,"cens") # Using predict predict(na,times=c(1,5,10,15))
Print method for an object of class mvna
. It prints estimates of
the cumulative hazard along with estimates of the variance described
in eq. (4.1.6) and (4.1.7) of Andersen et al. (1993) at several
time points obtained with the quantile
function.
## S3 method for class 'mvna' print(x, ...)
## S3 method for class 'mvna' print(x, ...)
x |
An object of class |
... |
Other arguments for print method |
No value returned.
Arthur Allignol, [email protected]
Pneumonia status on admission for intensive care unit (ICU) patients, a random sample from the SIR-3 study.
data(sir.adm)
data(sir.adm)
The data contains 747 rows and 4 variables:
Randomly generated patient id
Pneumonia indicator. 0: No pneumonia, 1: Pneumonia
Status indicator. 0: censored observation, 1: discharged, 2: dead
Follow-up time in day
Age at inclusion
Sex. F
for female and M
for male
Beyersmann, J., Gastmeier, P., Grundmann, H., Baerwolff, S., Geffers, C., Behnke, M., Rueden, H., and Schumacher, M. Use of multistate models to assess prolongation of intensive care unit stay due to nosocomial infection. Infection Control and Hospital Epidemiology, 27:493-499, 2006.
# data set transformation data(sir.adm) id <- sir.adm$id from <- sir.adm$pneu to <- ifelse(sir.adm$status==0,"cens",sir.adm$status+1) times <- sir.adm$time dat.sir <- data.frame(id,from,to,time=times) # Possible transitions tra <- matrix(ncol=4,nrow=4,FALSE) tra[1:2,3:4] <- TRUE na.pneu <- mvna(dat.sir,c("0","1","2","3"), tra,"cens") if(require("lattice")) { xyplot(na.pneu,tr.choice=c("0 2","1 2","0 3","1 3"), aspect=1,strip=strip.custom(bg="white", factor.levels=c("No pneumonia on admission -- Discharge", "Pneumonia on admission -- Discharge", "No pneumonia on admission -- Death", "Pneumonia on admission -- Death"), par.strip.text=list(cex=0.9)), scales=list(alternating=1),xlab="Days", ylab="Nelson-Aalen esimates") }
# data set transformation data(sir.adm) id <- sir.adm$id from <- sir.adm$pneu to <- ifelse(sir.adm$status==0,"cens",sir.adm$status+1) times <- sir.adm$time dat.sir <- data.frame(id,from,to,time=times) # Possible transitions tra <- matrix(ncol=4,nrow=4,FALSE) tra[1:2,3:4] <- TRUE na.pneu <- mvna(dat.sir,c("0","1","2","3"), tra,"cens") if(require("lattice")) { xyplot(na.pneu,tr.choice=c("0 2","1 2","0 3","1 3"), aspect=1,strip=strip.custom(bg="white", factor.levels=c("No pneumonia on admission -- Discharge", "Pneumonia on admission -- Discharge", "No pneumonia on admission -- Death", "Pneumonia on admission -- Death"), par.strip.text=list(cex=0.9)), scales=list(alternating=1),xlab="Days", ylab="Nelson-Aalen esimates") }
Time-dependent ventilation status for intensive care unit (ICU) patients, a random sample from the SIR-3 study.
data(sir.cont)
data(sir.cont)
A data frame with 1141 rows and 6 columns:
Randomly generated patient id
State from which a transition occurs
State to which a transition occurs
Time when a transition occurs
Age at inclusion
Sex. F
for female and M
for male
The possible states are:
0: No ventilation
1: Ventilation
2: End of stay.
And cens
stands for censored observations.
This data frame consists in a random sample of the SIR-3 cohort data. It focuses on the effect of ventilation on the length of stay (combined endpoint discharge/death). Ventilation status is considered as a transcient state in an illness-death model.
The data frame is directly formated to be used with the mvna
function, i.e., it is transition-oriented with one row per transition.
Beyersmann, J., Gastmeier, P., Grundmann, H., Baerwolff, S., Geffers, C., Behnke, M., Rueden, H., and Schumacher, M. Use of multistate models to assess prolongation of intensive care unit stay due to nosocomial infection. Infection Control and Hospital Epidemiology, 27:493-499, 2006.
data(sir.cont) # Matrix of possible transitions tra <- matrix(ncol=3,nrow=3,FALSE) tra[1, 2:3] <- TRUE tra[2, c(1, 3)] <- TRUE # Modification for patients entering and leaving a state # at the same date sir.cont <- sir.cont[order(sir.cont$id, sir.cont$time), ] for (i in 2:nrow(sir.cont)) { if (sir.cont$id[i]==sir.cont$id[i-1]) { if (sir.cont$time[i]==sir.cont$time[i-1]) { sir.cont$time[i-1] <- sir.cont$time[i-1] - 0.5 } } } # Computation of the Nelson-Aalen estimates na.cont <- mvna(sir.cont,c("0","1","2"),tra,"cens") if (require("lattice")) { xyplot(na.cont,tr.choice=c("0 2","1 2"),aspect=1, strip=strip.custom(bg="white", factor.levels=c("No ventilation -- Discharge/Death", "Ventilation -- Discharge/Death"), par.strip.text=list(cex=0.9)), scales=list(alternating=1),xlab="Days", ylab="Nelson-Aalen estimates") }
data(sir.cont) # Matrix of possible transitions tra <- matrix(ncol=3,nrow=3,FALSE) tra[1, 2:3] <- TRUE tra[2, c(1, 3)] <- TRUE # Modification for patients entering and leaving a state # at the same date sir.cont <- sir.cont[order(sir.cont$id, sir.cont$time), ] for (i in 2:nrow(sir.cont)) { if (sir.cont$id[i]==sir.cont$id[i-1]) { if (sir.cont$time[i]==sir.cont$time[i-1]) { sir.cont$time[i-1] <- sir.cont$time[i-1] - 0.5 } } } # Computation of the Nelson-Aalen estimates na.cont <- mvna(sir.cont,c("0","1","2"),tra,"cens") if (require("lattice")) { xyplot(na.cont,tr.choice=c("0 2","1 2"),aspect=1, strip=strip.custom(bg="white", factor.levels=c("No ventilation -- Discharge/Death", "Ventilation -- Discharge/Death"), par.strip.text=list(cex=0.9)), scales=list(alternating=1),xlab="Days", ylab="Nelson-Aalen estimates") }
Summary method for mvna
objects. The function returns a list
containing the cumulative transition hazards, variance and other
informations.
## S3 method for class 'mvna' summary(object, level = 0.95, var.type = c("aalen", "greenwood"), ci.fun = c("log", "linear", "arcsin"), ...) ## S3 method for class 'mvna' print.summary(x, ...)
## S3 method for class 'mvna' summary(object, level = 0.95, var.type = c("aalen", "greenwood"), ci.fun = c("log", "linear", "arcsin"), ...) ## S3 method for class 'mvna' print.summary(x, ...)
object |
An object of class |
level |
Level of the pointwise confidence interval. Default is 0.95. |
var.type |
Which of the "aalen" or "greenwood" variance estimator should be displayed and used to compute the pointwise confidence intervals. Default is "aalen". |
ci.fun |
Which transformation to apply to the confidence intervals. One of "linear", "log", "arcsin". Default is "log". |
... |
Further arguments. |
x |
An object of class |
Returns an object of class mvna
which is a list of data frames
named after the possible transitions. Each data frame contains the
following columns:
time |
Event times at which the cumulative hazards are estimated. |
na |
Estimated cumulative transition hazards. |
var.aalen or var.greenwood |
Variance estimates. The name depends
on the |
lower |
Lower bound of the pointwise confidence interval. |
upper |
Upper bound. |
n.risk |
Number of individuals at risk of experiencing an event
just before |
n.event |
Number of transitions at time |
Arthur Allignol, [email protected]
data(sir.adm) ## data set transformation data(sir.adm) id <- sir.adm$id from <- sir.adm$pneu to <- ifelse(sir.adm$status==0,"cens",sir.adm$status+1) times <- sir.adm$time dat.sir <- data.frame(id,from,to,time=times) ## Possible transitions tra <- matrix(ncol=4,nrow=4,FALSE) tra[1:2,3:4] <- TRUE na.pneu <- mvna(dat.sir,c("0","1","2","3"), tra,"cens") summ.na.pneu <- summary(na.pneu) ## cumulative hazard for 0 -> 2 transition: summ.na.pneu$"0 2"$na
data(sir.adm) ## data set transformation data(sir.adm) id <- sir.adm$id from <- sir.adm$pneu to <- ifelse(sir.adm$status==0,"cens",sir.adm$status+1) times <- sir.adm$time dat.sir <- data.frame(id,from,to,time=times) ## Possible transitions tra <- matrix(ncol=4,nrow=4,FALSE) tra[1:2,3:4] <- TRUE na.pneu <- mvna(dat.sir,c("0","1","2","3"), tra,"cens") summ.na.pneu <- summary(na.pneu) ## cumulative hazard for 0 -> 2 transition: summ.na.pneu$"0 2"$na
xyplot function for objects of class mvna
. Estimates of the
cumulative hazards are plotted as a function of time for all the
transitions specified by the user. The function can also plot
several types of pointwise confidence interval (see Andersen et
al. (1993) p.208).
## S3 method for class 'mvna' xyplot(x, data = NULL, xlab = "Time", ylab = "Cumulative Hazard", tr.choice = "all", conf.int = TRUE, var.type = c("aalen", "greenwood"), ci.fun = c("log", "linear", "arcsin"), level = 0.95, col = c(1, 1, 1), lty = c(1, 3, 3), ci.type = c(1, 2), ...)
## S3 method for class 'mvna' xyplot(x, data = NULL, xlab = "Time", ylab = "Cumulative Hazard", tr.choice = "all", conf.int = TRUE, var.type = c("aalen", "greenwood"), ci.fun = c("log", "linear", "arcsin"), level = 0.95, col = c(1, 1, 1), lty = c(1, 3, 3), ci.type = c(1, 2), ...)
x |
An object of class |
data |
Useless. |
xlab |
x-axis label. Default is "Time". |
ylab |
y-axis label. Default is "Cumulative Hazard" |
tr.choice |
A character vector of the form |
conf.int |
A logical whether plot pointwise confidence interval. Default is TRUE |
var.type |
One of "aalen" or "greenwood". Specifies which variance estimator is used to compute the confidence intervals. |
ci.fun |
One of "log", "linear" or "arcsin". Indicates the transformation applied to the pointwise confidence intervals. Default is "log". |
level |
Level of the confidence interval. Default is 0.95. |
col |
Vector of colour for the plot. Default is black. |
lty |
Vector of line type. Default is |
ci.type |
DEPRECATED |
... |
Other arguments for xyplot. |
An object of class trellis
.
These plots are highly customizable, see
Lattice
and xyplot
. For
example, if one want to change strip background color and the title of
each strip, it can be added 'strip=strip.custom(bg="a
color",factor.levels="a title","another title")'. One can use
'aspect="1"' to get the size of the panels isometric.
Arthur Allignol, [email protected]
Andersen, P.K., Borgan, O., Gill, R.D. and Keiding, N. (1993). Statistical models based on counting processes. Springer Series in Statistics. New York, NY: Springer.
Deepayan Sarkar (2006). lattice: Lattice Graphics. R package version 0.13-8.
xyplot
, mvna
, sir.adm
,sir.cont