Movatterモバイル変換


[0]ホーム

URL:


Title:Recurrent Event Regression
Version:1.4.7
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.
Depends:R (≥ 4.2.0)
License:GPL (≥ 3)
Encoding:UTF-8
LazyData:true
URL:https://github.com/stc04003/reReg
BugReports:https://github.com/stc04003/reReg/issues
Imports:BB, nleqslv, dfoptim, optimx, SQUAREM, survival, directlabels,ggplot2, MASS, methods, reda (≥ 0.5.0), scam, Rcpp, rootSolve
LinkingTo:Rcpp, RcppArmadillo
RoxygenNote:7.3.1
NeedsCompilation:yes
Packaged:2024-10-07 20:02:14 UTC; chiou
Author:Sy Han (Steven) Chiou [aut, cre], Chiung-Yu Huang [aut]
Maintainer:Sy Han (Steven) Chiou <schiou@smu.edu>
Repository:CRAN
Date/Publication:2024-10-07 20:30:02 UTC

reReg: Recurrent Event Regression

Description

The package offers a comprehensive collection of practical and easy-to-use tools for analyzingrecurrent 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 frailtydistribution.The package allows the users to specify different model forms for both the recurrent event processand the terminal event.The package also includes tools for visualization of recurrent events andsimulation from the regression models.

Author(s)

Maintainer: Sy Han (Steven) Chiouschiou@smu.edu

Authors:

References

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 EventProcesses under Informative Censoring.Statistica Sinica,30: 1773–1795.

See Also

Useful links:


Function used to combine baseline functions in one plot

Description

Combine different plots into one.

Usage

basebind(..., legend.title, legend.labels, control = list())

Arguments

...

ggplot objects created by plottingreReg objects.

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.

Examples

data(simDat)fm <- Recur(t.stop, id, event, status) ~ x1 + x2fit1 <- reReg(fm, subset = x1 == 0, data = simDat, B = 200)fit2 <- reReg(fm, subset = x1 == 1, data = simDat, B = 200)basebind(plot(fit1), plot(fit2))

Produce Event Plot or Mean Cumulative Function Plot

Description

Plot the event plot or the mean cumulative function (MCF) from anRecur object.

Usage

## 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(),  ...)

Arguments

x

an object of classRecur returned by theRecur() function.See?Recur for creatingRecur objects.

mcf

an optional logical value indicating whether the mean cumulative function (MCF) willbe plotted instead of the event plot. Whenmcf = TRUE,themcf is internally called. Seemcf for details.

event.result

an optional character string that is passed to theplotEvents() function as theresult argument. SeeplotEvents.This argument is used to specify whether the event plot is sorted by the subjects' terminal time.The available options are

increasing

sort the terminal time from in ascending order (default).This places longer terminal times on top.

decreasing

sort the terminal time from in descending order.This places shorter terminal times on top.

none

present the event plots as is, without sorting by the terminal times.

event.calendarTime

an optional logical value indicating whether to plot in calendar time.Whenevent.calendarTime = FALSE (default),the event plot will have patient time on the x-axis.

mcf.adjustRiskset

an optional logical value that is passed tothemcf() function as theadjustRiskset argument. This argument indicates whether risk set size will be adjusted.Ifmcf.adjustRiskset = TRUE, subjects leave the risk set after terminal timesas in the Nelson-Aalen estimator.Ifmcf.adjustRiskset = FALSE, subjects remain in the risk set after terminal time.

mcf.conf.int

an optional logical value that is passed tothemcf() function as theconf.int argument. Seemcf for details.

control

a list of control parameters. SeeDetails.

...

additional graphical parameters to be passed to methods.

Details

The argumentcontrol consists of options with argument defaults to a list withthe following values:

xlab

customizable x-label, default value is "Time".

ylab

customizable y-label, default value is "Subject" for event plot and"Cumulative mean" for MCF plot.

main

customizable title, the default value is "Recurrent event plot"whenmcf = FALSE and"Sample cumulative mean function plot" whenmcf = TRUE.

terminal.name

customizable label for terminal event,the default value is "Terminal event".

recurrent.name

customizable legend title for recurrent event,the default value is "Recurrent events".

recurrent.types

customizable label for recurrent event type,the default value isNULL.

alpha

between 0 and 1, controls the transparency of points.

Thexlab,ylab andmain parameters can be specifiedoutside of thecontrol list.

Value

Aggplot object.

References

Nelson, W. B. (1995) Confidence Limits for Recurrence Data-Applied to Costor Number of Product Repairs.Technometrics,37(2): 147–157.

See Also

Recur,plotEvents,mcf

Examples

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 typessimDat$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 timessimDat2 <- simDatsimDat2$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 plotsplot(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

Description

Plot the baseline cumulative rate function and the baseline cumulative hazard function(if applicable) for anreReg object.

Usage

## S3 method for class 'reReg'plot(  x,  baseline = c("both", "rate", "hazard"),  smooth = FALSE,  newdata = NULL,  frailty = NULL,  showName = FALSE,  control = list(),  ...)

Arguments

x

an object of classreReg, returned by thereReg function.

baseline

a character string specifying which baseline function to plot.

baseline = "both"

plot both the baseline cumulative rate andthe baseline cumulative hazard function (if applicable) in separate panelswithin the same display (default).

baseline = "rate"

plot the baseline cumulative rate function.

baseline = "hazard"

plot the baseline cumulative hazard function.

smooth

an optional logical value indicating whether to add a smooth curveobtained from a monotone increasing P-splines implemented in packagescam.

newdata

an optional data frame contains variables to include in the calculationof the cumulative rate function.If omitted, the baseline rate function will be plotted.

frailty

an optional vector to specify the shared frailty fornewdata.Ifnewdata is given andfrailty is not specified, the

showName

an optional logical value indicating whether to label the curveswhennewdata is specified.

control

a list of control parameters. SeeDetails.

...

additional graphical parameters to be passed to methods.

Details

The argumentcontrol consists of options with argument defaults to a listwith the following values:

xlab

customizable x-label, default value is "Time".

ylab

customizable y-label, default value is empty.

main

customizable title, default value are "Baseline cumulative rate andhazard function" whenbaseline = "both","Baseline cumulative rate function" whenbaseline = "rate",and "Baseline cumulative hazard function" whenbaseline = "hazard".

Value

Aggplot object.

See Also

reReg

Examples

data(simDat)fm <- Recur(t.start %to% t.stop, id, event, status) ~ x1 + x2fit <- reReg(fm, data = simDat, B = 0)plot(fit)plot(fit, xlab = "Time (days)", smooth = TRUE)## Predicted cumulative rate and hazard given covariatesnewdata <- expand.grid(x1 = 0:1, x2 = mean(simDat$x2))plot(fit, newdata = newdata, showName = TRUE)

Produce Event Plots

Description

Plot the event plot for anRecur object.The usage of the function is similar to that ofplot.Recur() but with more flexible options.

Usage

plotEvents(  formula,  data,  result = c("increasing", "decreasing", "asis"),  calendarTime = FALSE,  control = list(),  ...)

Arguments

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 functionRecur().

data

an optional data frame in which to interpret the variables occurring inthe "formula".

result

an optional character string specifying whether the event plot issorted by the subjects' terminal time. The available options are

increasing

sort the terminal time from in ascending order (default).This places longer terminal times on top.

decreasing

sort the terminal time from in descending order.This places shorter terminal times on top.

none

present the event plots as is, without sorting by the terminal times.

calendarTime

an optional logical value indicating whether to plot in calendar time.WhencalendarTime = FALSE (default), the event plot will have patient time on the x-axis.

control

a list of control parameters. SeeDetails.

...

graphical parameters to be passed to methods.These includexlab,ylab,main, and more. SeeDetails.

Details

The argumentcontrol consists of options with argument defaults to a list withthe following values:

xlab

customizable x-label, default value is "Time".

ylab

customizable y-label, default value is "Subject" for event plot and"Cumulative mean" for MCF plot.

main

customizable title, the default value is "Recurrent event plot"whenmcf = FALSE and"Sample cumulative mean function plot" whenmcf = TRUE.

terminal.name

customizable label for terminal event,the default value is "Terminal event".

recurrent.name

customizable legend title for recurrent event,the default value is "Recurrent events".

recurrent.types

customizable label for recurrent event type,the default value isNULL.

alpha

between 0 and 1, controls the transparency of points.

Thexlab,ylab andmain parameters can be specifiedoutside of thecontrol list.

Value

Aggplot object.

See Also

Recur,plot.Recur

Examples

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 x1plotEvents(Recur(t.start %to% t.stop, id, event, status) ~ x1, data = simDat)## For multiple recurrent eventssimDat$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)

Plot options for plotEvents

Description

This function provides the plotting options for theplotEvents() function.

Usage

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)

Arguments

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 eventdisplayed in the legend. The default value is "Terminal event".

recurrent.name

a character string indicating the label for the recurrent eventdisplayed 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 whenlegend.position is specified as one of"bottomright", "bottomleft","topleft", "topright".Otherwise, the argument is passed to theggplot theme environment.

base_size

a numerical value to specify the base font size, given in pts.This argument is passed to theggplot theme environment.The default value is 12.

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.Byggplot default, set to 90% of the resolution of the data.

bar.color

a numerical value or a character string specifiescolor for lines. Default to gray.

recurrent.color

a numerical value or a character stringspecifies color for recurrent events. Default to green.

recurrent.shape

a numerical value or a character stringspecifies shape for recurrent events. Default to circle.

recurrent.stroke

a numerical value or a character stringspecifies stroke for recurrent events. Default to circle.

terminal.color

a numerical value or a character stringspecifies color for terminal events. Default to red.

terminal.shape

a numerical value or a character stringspecifies shape for terminal events. Default to triangle.

terminal.stroke

a numerical value or a character stringspecifies stroke for terminal events. Default to triangle.

not.terminal.color

a numerical value or a character stringspecifies color for non-terminal events.Non-terminal events are not plotted at default.

not.terminal.shape

a numerical value or a character stringspecifies shape for terminal events.Non-terminal events are not plotted at default.

See Also

plotEvents


Plot the Baseline Cumulative Hazard Function for the Terminal Time

Description

Plot the baseline cumulative hazard function for anreReg object.The 95% confidence interval on the baseline cumulative rate function

Usage

plotHaz(  x,  newdata = NULL,  frailty = NULL,  showName = FALSE,  type = c("unrestricted", "bounded", "scaled"),  smooth = FALSE,  control = list(),  ...)

Arguments

x

an object of classreReg, returned by thereReg function.

newdata

an optional data frame contains variables to include in the calculationof the cumulative rate function.If omitted, the baseline rate function will be plotted.

frailty

an optional vector to specify the shared frailty fornewdata.Ifnewdata is given andfrailty is not specified, the

showName

an optional logical value indicating whether to label the curveswhennewdata is specified.

type

a character string specifying the type of rate function to be plotted.Options are "unrestricted", "scaled", "bounded". SeeDetails.

smooth

an optional logical value indicating whether to add a smooth curveobtained from a monotone increasing P-splines implemented in packagescam.

control

a list of control parameters.

...

graphical parameters to be passed to methods.These includexlab,ylab,main, and more. SeeDetails.

Details

The argumentcontrol consists of options with argumentdefaults to a list with the following values:

xlab

customizable x-label, default value is "Time".

ylab

customizable y-label, default value is empty.

main

customizable title, default value is "Baseline cumulative hazard function".

These arguments can also be passed down without specifying acontrol list.

Value

Aggplot object.

See Also

reRegplot.reReg

Examples

data(simDat)fm <- Recur(t.start %to% t.stop, id, event, status) ~ x1 + x2fit <- reReg(fm, data = simDat, model = "cox|cox", B = 0)## Plot both the baseline cumulative rate and hazard functionplot(fit)## Plot baseline cumulative hazard functionplotHaz(fit)plotHaz(fit, smooth = TRUE)

Plotting the Baseline Cumulative Rate Function for the Recurrent Event Process

Description

Plot the baseline cumulative rate function for anreReg object.

Usage

plotRate(  x,  newdata = NULL,  frailty = NULL,  showName = FALSE,  type = c("unrestricted", "bounded", "scaled"),  smooth = FALSE,  control = list(),  ...)

Arguments

x

an object of classreReg, usually returned by thereReg function.

newdata

an optional data frame contains variables to include in the calculationof the cumulative rate function.If omitted, the baseline rate function will be plotted.

frailty

an optional vector to specify the shared frailty fornewdata.Ifnewdata is given andfrailty is not specified, the

showName

an optional logical value indicating whether to label the curveswhennewdata is specified.

type

a character string specifying the type of rate function to be plotted.Options are "unrestricted", "scaled", "bounded". SeeDetails.

smooth

an optional logical value indicating whether to add a smooth curveobtained from a monotone increasing P-splines implemented in packagescam.

control

a list of control parameters.

...

graphical parameters to be passed to methods.These includexlab,ylab,main, and more. SeeDetails.

Details

TheplotRate() plots the estimated baseline cumulative rate function depending on the identifiability assumption.Whentype = "unrestricted" (default), the baseline cumulative rate functionis plotted under the assumptionE(Z) = 1.Whentype = "scaled", the baseline cumulative rate function is plottedunder the assumption\Lambda(\min(Y^\ast, \tau)) = 1.Whentype = "bounded", the baseline cumulative rate function is plottedunder the assumption\Lambda(\tau) = 1.See?reReg for the specification of the notations and underlying models.

The argumentcontrol consists of options with argument defaultsto a list with the following values:

xlab

customizable x-label, default value is "Time".

ylab

customizable y-label, default value is empty.

main

customizable title, default value is "Baseline cumulative rate function".

These arguments can also be specified outside of thecontrol list.

Value

Aggplot object.

See Also

reRegplot.reReg

Examples

data(simDat)fm <- Recur(t.start %to% t.stop, id, event, status) ~ x1 + x2fit <- reReg(fm, data = simDat, model = "cox|cox", B = 0)## Plot both the baseline cumulative rate and hazard functionplot(fit)## Plot baseline cumulative rate functionplotRate(fit)plotRate(fit, smooth = TRUE)

Fits Semiparametric Regression Models for Recurrent Event Data

Description

Fits a general (joint) semiparametric regression model for the recurrent event data,where the rate function of the underlying recurrent event process andthe 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.

Usage

reReg(  formula,  data,  subset,  model = "cox",  B = 0,  se = c("boot", "sand"),  control = list())

Arguments

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 functionRecur.

data

an optional data frame in which to interpret the variables occurringin the"formula".

subset

an optional logical vector specifying a subset of observations to be usedin 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 "|".SeeDetails.

B

a numeric value specifies the number of bootstraps for variance estimation.WhenB = 0, variance estimation will not be performed.

se

a character string specifying the method for the variance estimation. SeeDetails.

boot

nonparametric bootstrap approach

sand

resampling-based sandwich estimator

control

a list of control parameters. SeereReg.control for default values.

Details

Model specification:

Suppose the recurrent event process and the failure events areobserved in the time intervalt\in[0,\tau],for some constant\tau.We formulate the recurrent event rate function,\lambda(t),and the terminal event hazard function,h(t), in the form of

\lambda(t) = Z \lambda_0(te^{X^\top\alpha}) e^{X^\top\beta}, h(t) = Z h_0(te^{X^\top\eta})e^{X^\top\theta},

where\lambda_0(t) is the baseline rate function,h_0(t) is the baseline hazard function,X is an byp covariate matrix and\alpha,Z is an unobserved shared frailty variable, and(\alpha, \eta) and(\beta, \theta) correspond to the shape and size parameters,respectively.The model includes several popular semiparametric models as special cases,which can be specified via themodel argument with the rate functionand the hazard function separated by "|".For examples,Wang, Qin and Chiang (2001) (\alpha = \eta = \theta = 0)can be called withmodel = "cox";Huang and Wang (2004) (\alpha = \eta = 0)can be called withmodel = "cox|cox";Xu et al. (2017) (\alpha = \beta and\eta = \theta)can be called withmodel = "am|am";Xu et al. (2019) (\eta = \theta = 0) can be called withmodel = "gsc".Users can mix the models depending on the application. For example,model = "cox|ar" postulate a Cox proportional model for therecurrent event rate function and an accelerated rate model forthe terminal event hazard function (\alpha = \theta = 0).If only one model is specified without an "|",it is used for both the rate function and the hazard function.For example, specifyingmodel = "cox" is equivalent tomodel = "cox|cox".Some models that assumesZ = 1 and requires independentcensoring are also implemented inreReg;these includesmodel = "cox.LWYY" for Lin et al. (2000),model = "cox.GL" for Ghosh and Lin (2002),andmodel = "am.GL" for Ghosh and Lin (2003).Additionally, an improved estimation of the proportional rate model(Huang and Huang 2022) can be called bymodel = "cox.HH" withadditionalcontrol options to specify the underlying procedure.Seeonline vignettefor a detailed discussion of the implemented regression models.

Variance estimation:

The available methods for variance estimation are:

boot

performs nonparametric bootstrap.

sand

performs the efficient resampling-based variance estimation.

Improving proportional rate model:A common semiparametric regression model for recurrent event processunder the noninformative censoring assumption is the Cox-type proportional rate model(available inreReg() viamodel = "cox.LWYY").However, the construction of the pseudo-partial score function ignores thedependency among recurrent events and thus could be inefficient. To improve upon this popular method, Huang and Huang (2022) proposed to combinea 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 inreReg viamodel = "cox.HH"with additional control specifications.Seeonline vignettefor an illustration of this feature.

Control options:

Thecontrol list consists of the following parameters:

tol

absolute error tolerance.

init

a list contains initial guesses used for root search.

solver

the equation solver used for root search.The available options areBB::BBsolve,BB::dfsane,BB::BBoptim,optimx::optimr,dfoptim::hjk,dfoptim::mads,optim,andnleqslv::nleqslv.

eqType

a character string indicating whether the log-rank type estimating equation orthe Gehan-type estimating equation (when available) will be used.

boot.parallel

an logical value indicating whether parallel computationwill be applied whense = "boot" is called.

boot.parCl

an integer value specifying the number of CPU cores to be used whenparallel = TRUE. The default value is half the CPU cores on the current host.

cppl

A character string indicating either to improve the proportional rate model viathe generalized method of moments (cppl = "GMM") or empirical likelihood estimation (cppl = "EL").This option is only used whenmodel = "cox.HH".

cppl.wfun

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 whenmodel = "cox.HH".

trace

A logical variable denoting whether some of theintermediate results of iterations should be displayed to the user. Default isFALSE.

References

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 EventProcesses 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.

See Also

Recur,simGSC

Examples

data(simDat)## Nonparametric estimateplot(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 modelsummary(reReg(fm, data = simDat, model = "cox", B = 50))## Fit the joint Cox/Cox modelsummary(reReg(fm, data = simDat, model = "cox|cox", B = 50))## Fit the scale-change rate modelsummary(reReg(fm, data = simDat, model = "gsc", B = 50, se = "sand"))

Package options for reReg

Description

This function provides the fitting options for thereReg() function.

Usage

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)

Arguments

eqType

a character string indicating whether the log-rank type estimating equationor 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 viathe generalized method of moments (cppl = "GMM") or empirical likelihood estimation (cppl = "EL").This option is only used whenmodel = "cox.HH".

cppl.wfun

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 whenmodel = "cox.HH".

init

a list contains the initial guesses used for root search.

boot.parallel

an logical value indicating whether parallel computation will beapplied whense = "boot" is specified inreReg().

boot.parCl

an integer value specifying the number of CPU cores to be used whenparallel = TRUE. The default value is half the CPU cores on the current host.

maxit1,maxit2

max number of iteration used whenmodel = "cox.HH".

trace

a logical variable denoting whether some of theintermediate results of iterations should be displayed to the user. Default isFALSE.

numAdj

a positive numerical value specifying the small constant used in heuristic adjustment of the borrow strength method.

See Also

reReg


Create anreSurv Object

Description

Create a recurrent event survival object, used as a response variable inreReg.This function is deprecated in Version 1.1.6.A recurrent event object is now being created withRecur().See '?Recur()' for details.

Usage

reSurv(time1, time2, id, event, status, origin = 0)

Arguments

time1

when "time2" is provided, this vector is treated as the starting time for the gap time between two successive recurrent events.In the absence of "time2", this is the observation time of recurrence on calendar time scale, in which, the time corresponds to the time since entry/inclusion in the study.

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.event = 1 for recurrent times.

status

a binary vector used as the status indicator for the terminal event.status = 0 for censored times.

origin

a numerical vector indicating the time origin of subjects.Whenorigin is a scalar,reSurv assumes all subjects have the same origin.Otherwise,origin needs to be a numerical vector, with length equals to the number of subjects.In this case, each element corresponds to different origins for different subjects.This argument is only needed when "time2" is missing.

Examples

## 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)

Objects exported from other packages

Description

These objects are imported from other packages. Follow the linksbelow to see their documentation.

reda

%2%,%to%,check_Recur,is.Recur,mcf,Recur


Calculate Residuals for a ‘reReg’ Fit

Description

Calculates residuals for a joint frailty scale-change model fitted by 'reReg'.Under the recurrent event model, at each observation time,t,the residual is calculated as

\mbox{observed number of recurrent events at } t- \mbox{expected number of recurrent events at} t.

The expected number of recurrent events att is calculated by thecumulative rate function att.Under the failure time model, the residual is calculated as

\Delta - H(t),

where\Delta is the terminal event indicator andH(t) is the cumulative hazard function att.

Usage

## S3 method for class 'reReg'residuals(object, model = c("recurrent", "failure"), ...)

Arguments

object

an object of classreReg returned by thereReg() function.

model

a character string specifying whether the residuals will be calculatedunder the recurrent event model or the failure time model.

...

additional parameters for future development.


Simulated dataset for demonstration

Description

A simulated data frame with the following variables

id

subjects identification

t.start

start of the interval

t.stop

endpoint of the interval; when time origin is 0 this variable also marks the recurrence or terminal/censoring time

status

terminal event indicator; 1 if a terminal event is recorded

event

recurrent event indicator; 1 if a recurrent event is recorded

x1

baseline covariate generated from a standard uniform distribution

x2

baseline covariate generated from a standard uniform distribution (independent fromz1

Usage

data(simDat)

Format

A data frame with 874 rows and 7 variables.

Details

SeesimGSC for instruction on simulating recurrent event data fromscale-change models.


Function to generate simulated recurrent event data

Description

The functionsimGSC() generates simulated recurrent event data from eithera Cox-type model, an accelerated mean model, an accelerated rate model, or a generalized scale-change model.

Usage

simGSC(  n,  summary = FALSE,  para,  xmat,  censoring,  frailty,  tau,  origin,  Lam0,  Haz0)

Arguments

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 coefficientsin the joint scale-change model. The names of the list elements arealpha,beta,eta, andtheta, correspond to\alpha,\beta,\eta, and\thetain the joint scale-change model, respectively.SeeDetails forreReg.

xmat

an optional matrix specifying the design matrix.

censoring

a numeric variable specifying the censoring times for each of then observation.

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 thebaseline rate function of

\lambda_0(t) = \frac{2}{1 + t},

or equivalently,the cumulative rate function of

\Lambda_0(t) = 2\log(1 + t).

Haz0

is an optional function that specifies the baseline hazard function.When left-unspecified, the recurrent events are generated using the baseline hazard function

h_0(t) = \frac{1}{5(1 + t)},

or equivalently,the cumulative hazard function of

H_0(t) = \log(1 + t) / 5.

Details

The functionsimGSC() generates simulated recurrent event data overthe interval(0, \tau) based on the specification of the recurrent process andthe terminal events.Specifically, the rate function,\lambda(t), of the recurrent processcan be specified as one of the following model:

\lambda(t) = Z \lambda_0(te^{X^\top\alpha}) e^{X^\top\beta}, h(t) = Z h_0(te^{X^\top\eta})e^{X^\top\theta},

where\lambda_0(t) is the baseline rate function,h_0(t) is the baseline hazard function,X is an byp covariate matrix and\alpha,Z is an unobserved shared frailty variable, and(\alpha, \eta) and(\beta, \theta) correspond to the shape and size parameters of therate function and the hazard function, respectively.

Under the default settings, thesimGSC() function assumesp = 2and the regression parameters to be\alpha = \eta = (0, 0)^\top,and\beta = \theta = (1, 1)^\top.When thexmat argument is not specified, thesimGSC() functionassumesX_i is a two-dimensional vectorX_i = (X_{i1}, X_{i2}), i = 1, \ldots, n,whereX_{i1} is a Bernoulli variable with rate 0.5 andX_{i2} is a standard normal variable.With the defaultxmat, the censoring time $C$ is generated froman exponential distribution with mean\tau X_{i1} + Z^2\tau(1 - X_{i1}).Thus, the censoring distribution is covariate dependent andis informative whenZ is not a constant.When thefrailty argument is not specified, the frailty variableZ is generatedfrom a gamma distribution with a unit mean and a variance of 0.25.The default values fortau andorigin are 60 and 0, respectively.When argumentsLam0 andHaz0 are left unspecified,thesimGSC() function uses\Lambda_0(t) = 2\log(1 + t)andH_0(t) = \log(1 + t) / 5, respectively.This is equivalent to settingLam0 = function(x) 2 * log(1 + x) andHaz0 = function(x) log(1 + x) / 5.Overall, the default specifications generate the recurrent events and the terminal eventsfrom the model:

\lambda(t) = \displaystyle \frac{2Z}{1 + te^{-X_{i1} - X_{i2}}},h(t) = \displaystyle \frac{Z}{5(1 + te^{X_{i1} + X_{i2}})}, t\in[0, 60].

Seeonline vignettefor more examples.

See Also

reReg

Examples

set.seed(123)simGSC(100, summary = TRUE)

[8]ページ先頭

©2009-2025 Movatter.jp