
mcf(object, ...)
"mcf"(object, data, subset, na.action, level = 0.95, ...)
"mcf"(object, newdata, groupName, groupLevels, level = 0.95, na.action, control = list(), ...)
environment(formula)
, usually the environment from which
the function is called.NA
s. The default is set by the
na.action setting of options
.
The "factory-fresh" default is na.omit
.
Other possible values inlcude na.fail
,
na.exclude
, and na.pass
.
help(na.fail)
for details.newdata
, such as "gender"
for "male" and "female". The default value is "group".newdata
, such as "treatment" and "control".
The default values are capital letters starting from "A".grid
, length.out
, from
and to
.
The time grid can be directly specified via element grid
.
A dense time grid is suggested.
Element length.out
represents the length of grid points.
The dafault value is 1,000.
Element from
means the starting point of grid with default 0.
Element to
represnts the endpoint of grid
with the right boundary knot as default.
When grid
is missing, the grid will be generated
by seq
(from package base)
with arguments from
, to
and length.out
.sampleMcf-class
or rateRegMcf-class
object.
Their slots include
level
: Confidence level specified.
MCF
: Mean cumulative function at each time point.
multiGroup
: A logical value indicating whether MCF
is estimated for different specified group.
newdata
: Given dataset used to estimate MCF.
rateReg
.
formula
: Sample MCF from data. rateReg
: Estimated MCF from a fitted model.
formula
object with Survr
object as response,
the covariate specified at the right hand side of the formula
should be either 1 or any one factor variable in the data.
The former computes the overall sample MCF.
The latter computes the sample MCF for each level of
the factor variable specified, respectively.
The sample MCF is also called Nelson-Aalen nonparametric estimator
(Nelson, 2003) and computed on each time point from sample data.
The point estimate of sample MCF at each time point does not
assume any particular underlying model. The variance
of estimated MCF (ReliaWiki, 2012) at each time point is estimated
and the approximate confidence intervals are provided as well,
which are constructed based on the asymptotic normality
of log mean cumulative function.For rateReg-class
object,
mcf
estimates the baseline MCF and its confidence interval
at each time grid if argument newdata
is not specified.
Otherwise, mcf
estimates MCF and its confidence interval
for the given newdata based on Delta-method.
ReliaWiki. (2012, March 19). Recurrent Event Data Analysis. Retrieved November 23, 2015, from http://reliawiki.org/index.php/Recurrent_Event_Data_Analysis
rateReg
for model fitting;
plotMcf
for plotting MCF.
library(reda)
## sample MCF
sampleMcf <- mcf(Survr(ID, time, event) ~ group,
data = simuDat, subset = ID %in% 1:10)
## plot sample MCF
plotMcf(sampleMcf, lty = c(1, 3), col = c("orange", "navy"),
mark.time = TRUE) + ggplot2::xlab("Days") + ggplot2::theme_bw()
## For estimated MCF from a fitted model,
## see examples given in function rateReg.
Run the code above in your browser using DataLab