Title: | Recurrent Event Regression |
---|---|
Description: | A comprehensive collection of practical and easy-to-use tools for regression analysis of recurrent events, with or without the presence of a (possibly) informative terminal event described in Chiou et al. (2023) <doi:10.18637/jss.v105.i05>. The modeling framework is based on a joint frailty scale-change model, that includes models described in Wang et al. (2001) <doi:10.1198/016214501753209031>, Huang and Wang (2004) <doi:10.1198/016214504000001033>, Xu et al. (2017) <doi:10.1080/01621459.2016.1173557>, and Xu et al. (2019) <doi:10.5705/SS.202018.0224> as special cases. The implemented estimating procedure does not require any parametric assumption on the frailty distribution. The package also allows the users to specify different model forms for both the recurrent event process and the terminal event. |
Authors: | Sy Han (Steven) Chiou [aut, cre], Chiung-Yu Huang [aut] |
Maintainer: | Sy Han (Steven) Chiou <[email protected]> |
License: | GPL (>= 3) |
Version: | 1.4.7 |
Built: | 2024-11-02 05:43:24 UTC |
Source: | https://github.com/stc04003/rereg |
The package offers a comprehensive collection of practical and easy-to-use tools for analyzing recurrent event data, with or without the presence of a (possibly) correlated terminal event. The modeling framework is based on a joint frailty scale-change model, that encompasses many existing models, including the popular Cox-type models, as special cases and accommodates informative censoring through a subject-specific frailty. The implemented estimating procedure does not require any parametric assumption on the frailty distribution. The package allows the users to specify different model forms for both the recurrent event process and the terminal event. The package also includes tools for visualization of recurrent events and simulation from the regression models.
Maintainer: Sy Han (Steven) Chiou [email protected]
Authors:
Chiung-Yu Huang [email protected]
Chiou, S.H., Xu, G., Yan, J. and Huang, C.-Y. (2023). Regression Modeling for Recurrent Events Possibly with an Informative Terminal Event Using R Package reReg. Journal of Statistical Software, 105(5): 1–34.
Lin, D., Wei, L., Yang, I. and Ying, Z. (2000). Semiparametric Regression for the Mean and Rate Functions of Recurrent Events. Journal of the Royal Statistical Society: Series B (Methodological), 62: 711–730.
Wang, M.-C., Qin, J., and Chiang, C.-T. (2001). Analyzing Recurrent Event Data with Informative Censoring. Journal of the American Statistical Association, 96(455): 1057–1065.
Ghosh, D. and Lin, D.Y. (2002). Marginal Regression Models for Recurrent and Terminal Events. Statistica Sinica: 663–688.
Ghosh, D. and Lin, D.Y. (2003). Semiparametric Analysis of Recurrent Events Data in the Presence of Dependent Censoring. Biometrics, 59: 877–885.
Huang, C.-Y. and Wang, M.-C. (2004). Joint Modeling and Estimation for Recurrent Event Processes and Failure Time Data. Journal of the American Statistical Association, 99(468): 1153–1165.
Xu, G., Chiou, S.H., Huang, C.-Y., Wang, M.-C. and Yan, J. (2017). Joint Scale-change Models for Recurrent Events and Failure Time. Journal of the American Statistical Association, 112(518): 796–805.
Xu, G., Chiou, S.H., Yan, J., Marr, K., and Huang, C.-Y. (2019). Generalized Scale-Change Models for Recurrent Event Processes under Informative Censoring. Statistica Sinica, 30: 1773–1795.
Useful links:
Combine different plots into one.
basebind(..., legend.title, legend.labels, control = list())
basebind(..., legend.title, legend.labels, control = list())
... |
|
legend.title |
an optional character string to specify the legend title. |
legend.labels |
an optional character string to specify the legend labels. |
control |
a list of control parameters. |
data(simDat) fm <- Recur(t.stop, id, event, status) ~ x1 + x2 fit1 <- reReg(fm, subset = x1 == 0, data = simDat, B = 200) fit2 <- reReg(fm, subset = x1 == 1, data = simDat, B = 200) basebind(plot(fit1), plot(fit2))
data(simDat) fm <- Recur(t.stop, id, event, status) ~ x1 + x2 fit1 <- reReg(fm, subset = x1 == 0, data = simDat, B = 200) fit2 <- reReg(fm, subset = x1 == 1, data = simDat, B = 200) basebind(plot(fit1), plot(fit2))
Plot the event plot or the mean cumulative function (MCF) from an Recur
object.
## S3 method for class 'Recur' plot( x, mcf = FALSE, event.result = c("increasing", "decreasing", "asis"), event.calendarTime = FALSE, mcf.adjustRiskset = TRUE, mcf.conf.int = FALSE, control = list(), ... )
## S3 method for class 'Recur' plot( x, mcf = FALSE, event.result = c("increasing", "decreasing", "asis"), event.calendarTime = FALSE, mcf.adjustRiskset = TRUE, mcf.conf.int = FALSE, control = list(), ... )
x |
an object of class |
mcf |
an optional logical value indicating whether the mean cumulative function (MCF) will
be plotted instead of the event plot. When |
event.result |
an optional character string that is passed to the
|
event.calendarTime |
an optional logical value indicating whether to plot in calendar time.
When |
mcf.adjustRiskset |
an optional logical value that is passed to
the |
mcf.conf.int |
an optional logical value that is passed to
the |
control |
a list of control parameters. See Details. |
... |
additional graphical parameters to be passed to methods. |
The argument control
consists of options with argument defaults to a list with
the following values:
customizable x-label, default value is "Time".
customizable y-label, default value is "Subject" for event plot and "Cumulative mean" for MCF plot.
customizable title, the default value is "Recurrent event plot"
when mcf = FALSE
and
"Sample cumulative mean function plot" when mcf = TRUE
.
customizable label for terminal event, the default value is "Terminal event".
customizable legend title for recurrent event, the default value is "Recurrent events".
customizable label for recurrent event type,
the default value is NULL
.
between 0 and 1, controls the transparency of points.
The xlab
, ylab
and main
parameters can be specified
outside of the control
list.
A ggplot
object.
Nelson, W. B. (1995) Confidence Limits for Recurrence Data-Applied to Cost or Number of Product Repairs. Technometrics, 37(2): 147–157.
data(simDat) reObj <- with(simDat, Recur(t.start %to% t.stop, id, event, status)) ## Event plots: plot(reObj) plot(reObj, event.result = "decreasing") ## With (hypothetical) multiple event types simDat$event2 <- with(simDat, ifelse(t.stop > 10 & event > 0, 2, event)) reObj2 <- with(simDat, Recur(t.start %to% t.stop, id, event2, status)) plot(reObj2) ## With (hypothetical) calendar times simDat2 <- simDat simDat2$t.start <- as.Date(simDat2$t.start + simDat2$x2 * 5, origin = "20-01-01") simDat2$t.stop <- as.Date(simDat2$t.stop + simDat2$x2 * 5, origin = "20-01-01") reObj3 <- with(simDat2, Recur(t.start %to% t.stop, id, event, status)) plot(reObj3, event.calendarTime = TRUE) ## MCF plots plot(reObj, mcf = TRUE) plot(reObj, mcf = TRUE, mcf.adjustRiskset = FALSE) library(reReg) data(simDat) reObj <- with(simDat, Recur(t.start %to% t.stop, id, event, status)) summary(reObj)
data(simDat) reObj <- with(simDat, Recur(t.start %to% t.stop, id, event, status)) ## Event plots: plot(reObj) plot(reObj, event.result = "decreasing") ## With (hypothetical) multiple event types simDat$event2 <- with(simDat, ifelse(t.stop > 10 & event > 0, 2, event)) reObj2 <- with(simDat, Recur(t.start %to% t.stop, id, event2, status)) plot(reObj2) ## With (hypothetical) calendar times simDat2 <- simDat simDat2$t.start <- as.Date(simDat2$t.start + simDat2$x2 * 5, origin = "20-01-01") simDat2$t.stop <- as.Date(simDat2$t.stop + simDat2$x2 * 5, origin = "20-01-01") reObj3 <- with(simDat2, Recur(t.start %to% t.stop, id, event, status)) plot(reObj3, event.calendarTime = TRUE) ## MCF plots plot(reObj, mcf = TRUE) plot(reObj, mcf = TRUE, mcf.adjustRiskset = FALSE) library(reReg) data(simDat) reObj <- with(simDat, Recur(t.start %to% t.stop, id, event, status)) summary(reObj)
Plot the baseline cumulative rate function and the baseline cumulative hazard function
(if applicable) for an reReg
object.
## S3 method for class 'reReg' plot( x, baseline = c("both", "rate", "hazard"), smooth = FALSE, newdata = NULL, frailty = NULL, showName = FALSE, control = list(), ... )
## S3 method for class 'reReg' plot( x, baseline = c("both", "rate", "hazard"), smooth = FALSE, newdata = NULL, frailty = NULL, showName = FALSE, control = list(), ... )
x |
an object of class |
baseline |
a character string specifying which baseline function to plot.
|
smooth |
an optional logical value indicating whether to add a smooth curve
obtained from a monotone increasing P-splines implemented in package |
newdata |
an optional data frame contains variables to include in the calculation of the cumulative rate function. If omitted, the baseline rate function will be plotted. |
frailty |
an optional vector to specify the shared frailty for |
showName |
an optional logical value indicating whether to label the curves
when |
control |
a list of control parameters. See Details. |
... |
additional graphical parameters to be passed to methods. |
The argument control
consists of options with argument defaults to a list
with the following values:
customizable x-label, default value is "Time".
customizable y-label, default value is empty.
customizable title, default value are "Baseline cumulative rate and
hazard function" when baseline = "both"
,
"Baseline cumulative rate function" when baseline = "rate"
,
and "Baseline cumulative hazard function" when baseline = "hazard"
.
A ggplot
object.
data(simDat) fm <- Recur(t.start %to% t.stop, id, event, status) ~ x1 + x2 fit <- reReg(fm, data = simDat, B = 0) plot(fit) plot(fit, xlab = "Time (days)", smooth = TRUE) ## Predicted cumulative rate and hazard given covariates newdata <- expand.grid(x1 = 0:1, x2 = mean(simDat$x2)) plot(fit, newdata = newdata, showName = TRUE)
data(simDat) fm <- Recur(t.start %to% t.stop, id, event, status) ~ x1 + x2 fit <- reReg(fm, data = simDat, B = 0) plot(fit) plot(fit, xlab = "Time (days)", smooth = TRUE) ## Predicted cumulative rate and hazard given covariates newdata <- expand.grid(x1 = 0:1, x2 = mean(simDat$x2)) plot(fit, newdata = newdata, showName = TRUE)
Plot the event plot for an Recur
object.
The usage of the function is similar to that of plot.Recur()
but with more flexible options.
plotEvents( formula, data, result = c("increasing", "decreasing", "asis"), calendarTime = FALSE, control = list(), ... )
plotEvents( formula, data, result = c("increasing", "decreasing", "asis"), calendarTime = FALSE, control = list(), ... )
formula |
a formula object, with the response on the left of a "~" operator,
and the predictors on the right.
The response must be a recurrent event survival object as returned by function |
data |
an optional data frame in which to interpret the variables occurring in
the " |
result |
an optional character string specifying whether the event plot is sorted by the subjects' terminal time. The available options are
|
calendarTime |
an optional logical value indicating whether to plot in calendar time.
When |
control |
a list of control parameters. See Details. |
... |
graphical parameters to be passed to methods.
These include |
The argument control
consists of options with argument defaults to a list with
the following values:
customizable x-label, default value is "Time".
customizable y-label, default value is "Subject" for event plot and "Cumulative mean" for MCF plot.
customizable title, the default value is "Recurrent event plot"
when mcf = FALSE
and
"Sample cumulative mean function plot" when mcf = TRUE
.
customizable label for terminal event, the default value is "Terminal event".
customizable legend title for recurrent event, the default value is "Recurrent events".
customizable label for recurrent event type,
the default value is NULL
.
between 0 and 1, controls the transparency of points.
The xlab
, ylab
and main
parameters can be specified
outside of the control
list.
A ggplot
object.
data(simDat) plotEvents(Recur(t.start %to% t.stop, id, event, status) ~ 1, data = simDat, xlab = "Time in days", ylab = "Subjects arranged by terminal time") ## Separate plots by x1 plotEvents(Recur(t.start %to% t.stop, id, event, status) ~ x1, data = simDat) ## For multiple recurrent events simDat$x3 <- ifelse(simDat$x2 < 0, "x2 < 0", "x2 > 0") simDat$event <- simDat$event * sample(1:3, nrow(simDat), TRUE) plotEvents(Recur(t.start %to% t.stop, id, event, status) ~ x1 + x3, data = simDat)
data(simDat) plotEvents(Recur(t.start %to% t.stop, id, event, status) ~ 1, data = simDat, xlab = "Time in days", ylab = "Subjects arranged by terminal time") ## Separate plots by x1 plotEvents(Recur(t.start %to% t.stop, id, event, status) ~ x1, data = simDat) ## For multiple recurrent events simDat$x3 <- ifelse(simDat$x2 < 0, "x2 < 0", "x2 > 0") simDat$event <- simDat$event * sample(1:3, nrow(simDat), TRUE) plotEvents(Recur(t.start %to% t.stop, id, event, status) ~ x1 + x3, data = simDat)
This function provides the plotting options for the plotEvents()
function.
plotEvents.control( xlab = NULL, ylab = NULL, main = NULL, terminal.name = NULL, recurrent.name = NULL, recurrent.type = NULL, legend.position = NULL, base_size = 12, cex = NULL, alpha = 0.7, width = NULL, bar.color = NULL, recurrent.color = NULL, recurrent.shape = NULL, recurrent.stroke = NULL, terminal.color = NULL, terminal.shape = NULL, terminal.stroke = NULL, not.terminal.color = NULL, not.terminal.shape = NULL )
plotEvents.control( xlab = NULL, ylab = NULL, main = NULL, terminal.name = NULL, recurrent.name = NULL, recurrent.type = NULL, legend.position = NULL, base_size = 12, cex = NULL, alpha = 0.7, width = NULL, bar.color = NULL, recurrent.color = NULL, recurrent.shape = NULL, recurrent.stroke = NULL, terminal.color = NULL, terminal.shape = NULL, terminal.stroke = NULL, not.terminal.color = NULL, not.terminal.shape = NULL )
xlab |
a character string indicating the label for the x axis. The default value is "Time". |
ylab |
a character string indicating the label for the y axis. The default value is "Subject". |
main |
a character string indicating the title of the plot. |
terminal.name |
a character string indicating the label for the terminal event displayed in the legend. The default value is "Terminal event". |
recurrent.name |
a character string indicating the label for the recurrent event displayed in the legend. The default value is "Recurrent events". |
recurrent.type |
a factor indicating the labels for the different recurrent event types. This option is only available when there are more than one types of recurrent events. The default value is "Recurrent events 1", "Recurrent events 2", .... |
legend.position |
a character string specifies the position of the legend.
The available options are "none", "left", "right", "bottom", "top",
"bottomright", "bottomleft","topleft", "topright",
or a two-element numeric vector specifies the coordinate of the legend.
The legend is placed inside of the plotting region when
|
base_size |
a numerical value to specify the base font size, given in pts.
This argument is passed to the |
cex |
a numerical value specifies the size of the points. |
alpha |
a numerical value specifies the transparency of the points. |
width |
a numerical value specifies the width of the event plot.
By |
bar.color |
a numerical value or a character string specifies color for lines. Default to gray. |
recurrent.color |
a numerical value or a character string specifies color for recurrent events. Default to green. |
recurrent.shape |
a numerical value or a character string specifies shape for recurrent events. Default to circle. |
recurrent.stroke |
a numerical value or a character string specifies stroke for recurrent events. Default to circle. |
terminal.color |
a numerical value or a character string specifies color for terminal events. Default to red. |
terminal.shape |
a numerical value or a character string specifies shape for terminal events. Default to triangle. |
terminal.stroke |
a numerical value or a character string specifies stroke for terminal events. Default to triangle. |
not.terminal.color |
a numerical value or a character string specifies color for non-terminal events. Non-terminal events are not plotted at default. |
not.terminal.shape |
a numerical value or a character string specifies shape for terminal events. Non-terminal events are not plotted at default. |
Plot the baseline cumulative hazard function for an reReg
object.
The 95% confidence interval on the baseline cumulative rate function
plotHaz( x, newdata = NULL, frailty = NULL, showName = FALSE, type = c("unrestricted", "bounded", "scaled"), smooth = FALSE, control = list(), ... )
plotHaz( x, newdata = NULL, frailty = NULL, showName = FALSE, type = c("unrestricted", "bounded", "scaled"), smooth = FALSE, control = list(), ... )
x |
an object of class |
newdata |
an optional data frame contains variables to include in the calculation of the cumulative rate function. If omitted, the baseline rate function will be plotted. |
frailty |
an optional vector to specify the shared frailty for |
showName |
an optional logical value indicating whether to label the curves
when |
type |
a character string specifying the type of rate function to be plotted. Options are "unrestricted", "scaled", "bounded". See Details. |
smooth |
an optional logical value indicating whether to add a smooth curve
obtained from a monotone increasing P-splines implemented in package |
control |
a list of control parameters. |
... |
graphical parameters to be passed to methods.
These include |
The argument control
consists of options with argument
defaults to a list with the following values:
customizable x-label, default value is "Time".
customizable y-label, default value is empty.
customizable title, default value is "Baseline cumulative hazard function".
These arguments can also be passed down without specifying a control
list.
A ggplot
object.
data(simDat) fm <- Recur(t.start %to% t.stop, id, event, status) ~ x1 + x2 fit <- reReg(fm, data = simDat, model = "cox|cox", B = 0) ## Plot both the baseline cumulative rate and hazard function plot(fit) ## Plot baseline cumulative hazard function plotHaz(fit) plotHaz(fit, smooth = TRUE)
data(simDat) fm <- Recur(t.start %to% t.stop, id, event, status) ~ x1 + x2 fit <- reReg(fm, data = simDat, model = "cox|cox", B = 0) ## Plot both the baseline cumulative rate and hazard function plot(fit) ## Plot baseline cumulative hazard function plotHaz(fit) plotHaz(fit, smooth = TRUE)
Plot the baseline cumulative rate function for an reReg
object.
plotRate( x, newdata = NULL, frailty = NULL, showName = FALSE, type = c("unrestricted", "bounded", "scaled"), smooth = FALSE, control = list(), ... )
plotRate( x, newdata = NULL, frailty = NULL, showName = FALSE, type = c("unrestricted", "bounded", "scaled"), smooth = FALSE, control = list(), ... )
x |
an object of class |
newdata |
an optional data frame contains variables to include in the calculation of the cumulative rate function. If omitted, the baseline rate function will be plotted. |
frailty |
an optional vector to specify the shared frailty for |
showName |
an optional logical value indicating whether to label the curves
when |
type |
a character string specifying the type of rate function to be plotted. Options are "unrestricted", "scaled", "bounded". See Details. |
smooth |
an optional logical value indicating whether to add a smooth curve
obtained from a monotone increasing P-splines implemented in package |
control |
a list of control parameters. |
... |
graphical parameters to be passed to methods.
These include |
The plotRate()
plots the estimated baseline cumulative rate function
depending on the identifiability assumption.
When type = "unrestricted"
(default), the baseline cumulative rate function
is plotted under the assumption .
When
type = "scaled"
, the baseline cumulative rate function is plotted
under the assumption .
When
type = "bounded"
, the baseline cumulative rate function is plotted
under the assumption .
See
?reReg
for the specification of the notations and underlying models.
The argument control
consists of options with argument defaults
to a list with the following values:
customizable x-label, default value is "Time".
customizable y-label, default value is empty.
customizable title, default value is "Baseline cumulative rate function".
These arguments can also be specified outside of the control
list.
A ggplot
object.
data(simDat) fm <- Recur(t.start %to% t.stop, id, event, status) ~ x1 + x2 fit <- reReg(fm, data = simDat, model = "cox|cox", B = 0) ## Plot both the baseline cumulative rate and hazard function plot(fit) ## Plot baseline cumulative rate function plotRate(fit) plotRate(fit, smooth = TRUE)
data(simDat) fm <- Recur(t.start %to% t.stop, id, event, status) ~ x1 + x2 fit <- reReg(fm, data = simDat, model = "cox|cox", B = 0) ## Plot both the baseline cumulative rate and hazard function plot(fit) ## Plot baseline cumulative rate function plotRate(fit) plotRate(fit, smooth = TRUE)
Fits a general (joint) semiparametric regression model for the recurrent event data, where the rate function of the underlying recurrent event process and the hazard function of the terminal event can be specified as a Cox-type model, an accelerated mean model, an accelerated rate model, or a generalized scale-change model. See details for model specifications.
reReg( formula, data, subset, model = "cox", B = 0, se = c("boot", "sand"), control = list() )
reReg( formula, data, subset, model = "cox", B = 0, se = c("boot", "sand"), control = list() )
formula |
a formula object, with the response on the left of a "~" operator,
and the predictors on the right.
The response must be a recurrent event survival object as returned by function |
data |
an optional data frame in which to interpret the variables occurring
in the |
subset |
an optional logical vector specifying a subset of observations to be used in the fitting process. |
model |
a character string specifying the underlying model.
The available functional form for the rate function and the hazard function include a Cox-type model,
an accelerated mean model, an accelerated rate model, or a generalized scale-change model,
and can be specified via "cox", "am", "ar", or "gsc", respectively.
The rate function and hazard function separated by " |
B |
a numeric value specifies the number of bootstraps for variance estimation.
When |
se |
a character string specifying the method for the variance estimation. See Details.
|
control |
a list of control parameters. See |
Model specification:
Suppose the recurrent event process and the failure events are
observed in the time interval ,
for some constant
.
We formulate the recurrent event rate function,
,
and the terminal event hazard function,
,
in the form of
where is the baseline rate function,
is the baseline hazard function,
is a
by
covariate matrix and
,
is an unobserved shared frailty variable, and
and
correspond to the shape and size parameters,
respectively.
The model includes several popular semiparametric models as special cases,
which can be specified via the
model
argument with the rate function
and the hazard function separated by "|
".
For examples,
Wang, Qin and Chiang (2001) ()
can be called with
model = "cox"
;
Huang and Wang (2004) ()
can be called with
model = "cox|cox"
;
Xu et al. (2017) ( and
)
can be called with
model = "am|am"
;
Xu et al. (2019) () can be called with
model = "gsc"
.
Users can mix the models depending on the application. For example,
model = "cox|ar"
postulate a Cox proportional model for the
recurrent event rate function and an accelerated rate model for
the terminal event hazard function ().
If only one model is specified without an "
|
",
it is used for both the rate function and the hazard function.
For example, specifying model = "cox"
is equivalent to model = "cox|cox"
.
Some models that assumes Z = 1
and requires independent
censoring are also implemented in reReg
;
these includes model = "cox.LWYY"
for Lin et al. (2000),
model = "cox.GL"
for Ghosh and Lin (2002),
and model = "am.GL"
for Ghosh and Lin (2003).
Additionally, an improved estimation of the proportional rate model
(Huang and Huang 2022) can be called by model = "cox.HH"
with
additional control
options to specify the underlying procedure.
See online vignette
for a detailed discussion of the implemented regression models.
Variance estimation:
The available methods for variance estimation are:
performs nonparametric bootstrap.
performs the efficient resampling-based variance estimation.
Improving proportional rate model:
A common semiparametric regression model for recurrent event process
under the noninformative censoring assumption is the Cox-type proportional rate model
(available in reReg()
via model = "cox.LWYY"
).
However, the construction of the pseudo-partial score function ignores the
dependency among recurrent events and thus could be inefficient.
To improve upon this popular method, Huang and Huang (2022) proposed to combine
a system of weighted pseudo-partial score equations via the generalized method of moments (GMM)
and empirical likelihood (EL) estimation.
The proposed GMM and EL procedures are available in reReg
via model = "cox.HH"
with additional control specifications.
See online vignette
for an illustration of this feature.
Control options:
The control
list consists of the following parameters:
absolute error tolerance.
a list contains initial guesses used for root search.
the equation solver used for root search.
The available options are BB::BBsolve
, BB::dfsane
, BB::BBoptim
,
optimx::optimr
, dfoptim::hjk
, dfoptim::mads
, optim
,
and nleqslv::nleqslv
.
a character string indicating whether the log-rank type estimating equation or the Gehan-type estimating equation (when available) will be used.
an logical value indicating whether parallel computation
will be applied when se = "boot"
is called.
an integer value specifying the number of CPU cores to be used when
parallel = TRUE
. The default value is half the CPU cores on the current host.
A character string indicating either to improve the proportional rate model via
the generalized method of moments (cppl = "GMM"
) or empirical likelihood estimation (cppl = "EL"
).
This option is only used when model = "cox.HH"
.
A list of (up to two) weight functions to be combined with the weighted pseudo-partial likelihood scores.
Available options are "Gehan"
and "cumbase"
,
which correspond to the Gehan's weight and the cumulative baseline hazard function, respectively.
Alternatively, the weight functions can be specified with function formulas.
This option is only used when model = "cox.HH"
.
A logical variable denoting whether some of the
intermediate results of iterations should be displayed to the user. Default is FALSE
.
Chiou, S.H., Xu, G., Yan, J. and Huang, C.-Y. (2023). Regression Modeling for Recurrent Events Possibly with an Informative Terminal Event Using R Package reReg. Journal of Statistical Software, 105(5): 1–34.
Lin, D., Wei, L., Yang, I. and Ying, Z. (2000). Semiparametric Regression for the Mean and Rate Functions of Recurrent Events. Journal of the Royal Statistical Society: Series B (Methodological), 62: 711–730.
Wang, M.-C., Qin, J., and Chiang, C.-T. (2001). Analyzing Recurrent Event Data with Informative Censoring. Journal of the American Statistical Association, 96(455): 1057–1065.
Ghosh, D. and Lin, D.Y. (2002). Marginal Regression Models for Recurrent and Terminal Events. Statistica Sinica: 663–688.
Ghosh, D. and Lin, D.Y. (2003). Semiparametric Analysis of Recurrent Events Data in the Presence of Dependent Censoring. Biometrics, 59: 877–885.
Huang, C.-Y. and Wang, M.-C. (2004). Joint Modeling and Estimation for Recurrent Event Processes and Failure Time Data. Journal of the American Statistical Association, 99(468): 1153–1165.
Xu, G., Chiou, S.H., Huang, C.-Y., Wang, M.-C. and Yan, J. (2017). Joint Scale-change Models for Recurrent Events and Failure Time. Journal of the American Statistical Association, 112(518): 796–805.
Xu, G., Chiou, S.H., Yan, J., Marr, K., and Huang, C.-Y. (2019). Generalized Scale-Change Models for Recurrent Event Processes under Informative Censoring. Statistica Sinica, 30: 1773–1795.
Huang, M.-Y. and Huang, C.-Y. (2022). Improved semiparametric estimation of the proportional rate model with recurrent event data. Biometrics, 79 3: 1686–1700.
data(simDat) ## Nonparametric estimate plot(reReg(Recur(t.start %to% t.stop, id, event, status) ~ 1, data = simDat, B = 50)) fm <- Recur(t.start %to% t.stop, id, event, status) ~ x1 + x2 ## Fit the Cox rate model summary(reReg(fm, data = simDat, model = "cox", B = 50)) ## Fit the joint Cox/Cox model summary(reReg(fm, data = simDat, model = "cox|cox", B = 50)) ## Fit the scale-change rate model summary(reReg(fm, data = simDat, model = "gsc", B = 50, se = "sand"))
data(simDat) ## Nonparametric estimate plot(reReg(Recur(t.start %to% t.stop, id, event, status) ~ 1, data = simDat, B = 50)) fm <- Recur(t.start %to% t.stop, id, event, status) ~ x1 + x2 ## Fit the Cox rate model summary(reReg(fm, data = simDat, model = "cox", B = 50)) ## Fit the joint Cox/Cox model summary(reReg(fm, data = simDat, model = "cox|cox", B = 50)) ## Fit the scale-change rate model summary(reReg(fm, data = simDat, model = "gsc", B = 50, se = "sand"))
This function provides the fitting options for the reReg()
function.
reReg.control( eqType = c("logrank", "gehan", "gehan_s"), solver = c("BB::dfsane", "BB::BBsolve", "BB::BBoptim", "optimx::optimr", "dfoptim::hjk", "dfoptim::mads", "optim", "nleqslv::nleqslv"), tol = 1e-07, cppl = NULL, cppl.wfun = list(NULL, NULL), init = list(alpha = 0, beta = 0, eta = 0, theta = 0), boot.parallel = FALSE, boot.parCl = NULL, maxit1 = 100, maxit2 = 10, trace = FALSE, numAdj = 1e-07 )
reReg.control( eqType = c("logrank", "gehan", "gehan_s"), solver = c("BB::dfsane", "BB::BBsolve", "BB::BBoptim", "optimx::optimr", "dfoptim::hjk", "dfoptim::mads", "optim", "nleqslv::nleqslv"), tol = 1e-07, cppl = NULL, cppl.wfun = list(NULL, NULL), init = list(alpha = 0, beta = 0, eta = 0, theta = 0), boot.parallel = FALSE, boot.parCl = NULL, maxit1 = 100, maxit2 = 10, trace = FALSE, numAdj = 1e-07 )
eqType |
a character string indicating whether the log-rank type estimating equation or the Gehan-type estimating equation (when available) will be used. |
solver |
a character string specifying the equation solver to be used for root search. |
tol |
a positive numerical value specifying the absolute error tolerance in root search. |
cppl |
a character string indicating either to improve the proportional rate model via
the generalized method of moments ( |
cppl.wfun |
a list of (up to two) weight functions to be combined with the weighted pseudo-partial likelihood scores.
Available options are |
init |
a list contains the initial guesses used for root search. |
boot.parallel |
an logical value indicating whether parallel computation will be
applied when |
boot.parCl |
an integer value specifying the number of CPU cores to be used when
|
maxit1 , maxit2
|
max number of iteration used when |
trace |
a logical variable denoting whether some of the
intermediate results of iterations should be displayed to the user. Default is |
numAdj |
a positive numerical value specifying the small constant used in heuristic adjustment of the borrow strength method. |
Calculates residuals for a joint frailty scale-change model fitted by 'reReg'.
Under the recurrent event model, at each observation time, ,
the residual is calculated as
The expected number of recurrent events at is calculated by the
cumulative rate function at
.
Under the failure time model, the residual is calculated as
where is the terminal event indicator and
is the cumulative hazard function at
.
## S3 method for class 'reReg' residuals(object, model = c("recurrent", "failure"), ...)
## S3 method for class 'reReg' residuals(object, model = c("recurrent", "failure"), ...)
object |
an object of class |
model |
a character string specifying whether the residuals will be calculated under the recurrent event model or the failure time model. |
... |
additional parameters for future development. |
reSurv
ObjectCreate a recurrent event survival object, used as a response variable in reReg
.
This function is deprecated in Version 1.1.6.
A recurrent event object is now being created with Recur()
.
See '?Recur()' for details.
reSurv(time1, time2, id, event, status, origin = 0)
reSurv(time1, time2, id, event, status, origin = 0)
time1 |
when " |
time2 |
an optional vector for ending time for the gap time between two successive recurrent events. |
id |
subject's id. |
event |
a binary vector used as the recurrent event indicator. |
status |
a binary vector used as the status indicator for the terminal event. |
origin |
a numerical vector indicating the time origin of subjects.
When |
## Not run: data(simDat) ## being deprecated in Verson 1.1.7 with(dat, reSurv(Time, id, event, status)) ## Use Recur() instead with(dat, Recur(Time, id, event, status)) ## End(Not run)
## Not run: data(simDat) ## being deprecated in Verson 1.1.7 with(dat, reSurv(Time, id, event, status)) ## Use Recur() instead with(dat, Recur(Time, id, event, status)) ## End(Not run)
A simulated data frame with the following variables
subjects identification
start of the interval
endpoint of the interval; when time origin is 0 this variable also marks the recurrence or terminal/censoring time
terminal event indicator; 1 if a terminal event is recorded
recurrent event indicator; 1 if a recurrent event is recorded
baseline covariate generated from a standard uniform distribution
baseline covariate generated from a standard uniform distribution (independent from z1
data(simDat)
data(simDat)
A data frame with 874 rows and 7 variables.
See simGSC
for instruction on simulating recurrent event data from
scale-change models.
The function simGSC()
generates simulated recurrent event data from either
a Cox-type model, an accelerated mean model, an accelerated rate model, or a generalized scale-change model.
simGSC( n, summary = FALSE, para, xmat, censoring, frailty, tau, origin, Lam0, Haz0 )
simGSC( n, summary = FALSE, para, xmat, censoring, frailty, tau, origin, Lam0, Haz0 )
n |
number of observation. |
summary |
a logical value indicating whether a brief data summary will be printed. |
para |
a list of numerical vectors for the regression coefficients
in the joint scale-change model.
The names of the list elements are |
xmat |
an optional matrix specifying the design matrix. |
censoring |
a numeric variable specifying the censoring times for each of the
|
frailty |
a numeric variable specifying the frailty variable. |
tau |
a numeric value specifying the maximum observation time. |
origin |
a numeric value specifying the time origin. |
Lam0 |
is an optional function that specifies the baseline cumulative rate function. When left-unspecified, the recurrent events are generated using the baseline rate function of
or equivalently, the cumulative rate function of
|
Haz0 |
is an optional function that specifies the baseline hazard function. When left-unspecified, the recurrent events are generated using the baseline hazard function
or equivalently, the cumulative hazard function of
|
The function simGSC()
generates simulated recurrent event data over
the interval based on the specification of the recurrent process and
the terminal events.
Specifically, the rate function,
, of the recurrent process
can be specified as one of the following model:
where is the baseline rate function,
is the baseline hazard function,
is a
by
covariate matrix and
,
is an unobserved shared frailty variable, and
and
correspond to the shape and size parameters of the
rate function and the hazard function, respectively.
Under the default settings, the simGSC()
function assumes
and the regression parameters to be
,
and
.
When the
xmat
argument is not specified, the simGSC()
function
assumes is a two-dimensional vector
,
where
is a Bernoulli variable with rate 0.5 and
is a standard normal variable.
With the default
xmat
, the censoring time $C$ is generated from
an exponential distribution with mean .
Thus, the censoring distribution is covariate dependent and
is informative when
is not a constant.
When the
frailty
argument is not specified, the frailty variable is generated
from a gamma distribution with a unit mean and a variance of 0.25.
The default values for
tau
and origin
are 60 and 0, respectively.
When arguments Lam0
and Haz0
are left unspecified,
the simGSC()
function uses
and
, respectively.
This is equivalent to setting
Lam0 = function(x) 2 * log(1 + x)
and Haz0 = function(x) log(1 + x) / 5
.
Overall, the default specifications generate the recurrent events and the terminal events
from the model:
See online vignette for more examples.
set.seed(123) simGSC(100, summary = TRUE)
set.seed(123) simGSC(100, summary = TRUE)