Title: | Threshold Regression for Interval-Censored Data with a Cure Rate Option |
---|---|
Description: | Fit a threshold regression model for Interval Censored Data based on the first-hitting-time of a boundary by the sample path of a Wiener diffusion process. The threshold regression methodology is well suited to applications involving survival and time-to-event data. |
Authors: | Man-Hua Chen |
Maintainer: | Man-Hua Chen <[email protected]> |
License: | GPL-2 |
Version: | 1.0.4 |
Built: | 2024-12-14 06:41:10 UTC |
Source: | CRAN |
94 early breast cancer patients who had been treated with primary radiation therapy and adjuvant chemotherapy and with radiotherapy alone for the treatment. A patient due to monitored weekly or monthly for a clinically observable change in breast cancer status and may return with a changed status. For this case, we know the changed status is between ( ,
].
bcos
bcos
id: | subject recorded in the data set |
left: | breast cancer status return with a changed status after time
|
right: | breast cancer status return with a changed status after time
|
treatment: | Radiation = radiation therapy, RadChemo = radiation therapy with chemotherapy |
Finkelstein DM and Wolfe RA. (1985). A semiparametric model for regression analysis of interval-censored failure time data. Biometrics 41, 933-945.
Time to onset of grade IV VGE was collected by volunteers who underwent denitrogenation test procedures before being uncovered to a hypobaric environment. This data set contains with 238 subjects and several covariates were recorded periodically monitor for a changed status is between ( ,
].
hdsd
hdsd
id: | subject recorded in the data set |
Age: | recorded age (ranged from 20 to 54) |
Sex: | (males = 1; females = 0) |
TR360: | (ranged from 1.04 to 1.89) |
Noadyn: | (ambulatory, Noadyn=1; lower body adynamic, Noadyn=0) |
right: | return with a grade IV VGE changed status before time
|
left: | return with a grade IV VGE changed status after time
|
Conkin J, Bedahl SR and van Liew HD. (1992). A computerized data bank of decompression sickness incidence in altitude chambers. Aviation Space Environ. Med 63, 819-824.
Returns the hazard ratios at a selected time for specified scenarios of the threshold regression model.
## S3 method for class 'thregI' hr(object,var,timevalue,scenario)
## S3 method for class 'thregI' hr(object,var,timevalue,scenario)
object |
a thregI object. |
var |
specifies the categorical variable which is required for the hazard ratios. Transform this variable into factor variable that has been used in thregI(). The lower level of the factor variable of var is the reference level of hazard ratio. |
timevalue |
specifies the desired time at which the hazard ratios would like to be had. A vector is allowed for this argument. |
scenario |
specifies the values of all variables that considered in the thregI() except variable of var. |
#load the data "bcos" data("bcos", package="thregI") #transform the "treatment" variable into factor variable f.treatment bcos$f.treatment=factor(bcos$treatment) #fit the threshold regression model on the factor variable f.treatment fit<-thregI(Surv(left, right, type='interval2')~f.treatment|f.treatment,data=bcos) #hazard ratio of the radiation group vs. the radiation with chemotherapy at fifth month hr.thregI(fit, var = f.treatment, timevalue = 5)
#load the data "bcos" data("bcos", package="thregI") #transform the "treatment" variable into factor variable f.treatment bcos$f.treatment=factor(bcos$treatment) #fit the threshold regression model on the factor variable f.treatment fit<-thregI(Surv(left, right, type='interval2')~f.treatment|f.treatment,data=bcos) #hazard ratio of the radiation group vs. the radiation with chemotherapy at fifth month hr.thregI(fit, var = f.treatment, timevalue = 5)
Returns the hazard ratios at a selected time for specified scenarios of the threshold regression cure-rate model.
## S3 method for class 'thregIcure' hr(object,var,timevalue,scenario)
## S3 method for class 'thregIcure' hr(object,var,timevalue,scenario)
object |
a thregIcure object. |
var |
specifies the name of the variable which is required to be categorical for which the hazard ratios are to be calculated. The use of the var argument is similar to that in the hr.thregI(). |
timevalue |
specifies the desired time at which the hazard ratios would like to be had. A vector is allowed for this argument. |
scenario |
specifies the values of all variables that considered in the thregIcure function except variable of var. |
#load the data "hdsd" data("hdsd", package="thregI") #transform categorical variable Noadyn into factor variable f.noadyn hdsd$f.noadyn=factor(hdsd$Noadyn) #fit the threshold regression cure-rate model #the covariates are TR360, Noadyn, Sex and Age fit<-thregIcure(Surv(left, right, type='interval2')~f.noadyn|TR360|Sex+Age, data=hdsd) #calculate the hazard ratios for categorical variable Noadyn #specified scenario of TR360=1.5, Male, Age=30 at time one hr.thregIcure(fit, var = f.noadyn, timevalue = 1, scenario=TR360(1.5)+Sex(1)+Age(30))
#load the data "hdsd" data("hdsd", package="thregI") #transform categorical variable Noadyn into factor variable f.noadyn hdsd$f.noadyn=factor(hdsd$Noadyn) #fit the threshold regression cure-rate model #the covariates are TR360, Noadyn, Sex and Age fit<-thregIcure(Surv(left, right, type='interval2')~f.noadyn|TR360|Sex+Age, data=hdsd) #calculate the hazard ratios for categorical variable Noadyn #specified scenario of TR360=1.5, Male, Age=30 at time one hr.thregIcure(fit, var = f.noadyn, timevalue = 1, scenario=TR360(1.5)+Sex(1)+Age(30))
Display the graphs of the estimated survival, hazard or density function at different levels of a categorical variable which has been included in the threshold regression model by thregI(). There are three options, "sv", "hz" and "ds" are for survival, hazard and density function, respectively.
## S3 method for class 'thregI' plot(x,var,scenario,graph,nolegend=0,nocolor=0,...)
## S3 method for class 'thregI' plot(x,var,scenario,graph,nolegend=0,nocolor=0,...)
x |
a thregI object. |
var |
specifies the name of the variable which is required to be categorical. For each level of which (survival, hazard, density) the plots would be generated at given scenario specified by the scenario argument. |
scenario |
specifies a scenario for predicted plots. |
graph |
specifies the type of curves to be generated. The "sv" option is to plot survival function, the "hz" option is to plot hazard function and the "ds" option is to plot density function. |
nolegend |
set nolegend to be 1 when no need for legend. Users can add legends by themselves after set nolegend=1. |
nocolor |
set nocolor to be 1 if users would like to have all curves in black. |
... |
for future methods |
#load the data "bcos" data("bcos", package="thregI") # transform the "treatment" variable into factor variable f.treatment bcos$f.treatment=factor(bcos$treatment) # fit the threshold regression model on the factor variable f.treatment fit<-thregI(Surv(left, right, type='interval2')~f.treatment|f.treatment,data=bcos) # estimated survival function at all levels of a categorical variable plot.thregI(fit, var = f.treatment, graph = "sv", nocolor = 1) # estimated hazard function at all levels of a categorical variable plot.thregI(fit, var = f.treatment, graph = "hz", nocolor = 1) # estimated density function at all levels of a categorical variable plot.thregI(fit, var = f.treatment, graph = "ds", nocolor = 1)
#load the data "bcos" data("bcos", package="thregI") # transform the "treatment" variable into factor variable f.treatment bcos$f.treatment=factor(bcos$treatment) # fit the threshold regression model on the factor variable f.treatment fit<-thregI(Surv(left, right, type='interval2')~f.treatment|f.treatment,data=bcos) # estimated survival function at all levels of a categorical variable plot.thregI(fit, var = f.treatment, graph = "sv", nocolor = 1) # estimated hazard function at all levels of a categorical variable plot.thregI(fit, var = f.treatment, graph = "hz", nocolor = 1) # estimated density function at all levels of a categorical variable plot.thregI(fit, var = f.treatment, graph = "ds", nocolor = 1)
Display the graphs of the estimated survival, hazard or density function at different levels of a categorical variable which has been included in the threshold regression cure-rate model by thregIcure(). There are three options, "sv", "hz" and "ds" are for survival, hazard and density function, respectively.
## S3 method for class 'thregIcure' plot(x,var,scenario,graph,nolegend=0,nocolor=0,...)
## S3 method for class 'thregIcure' plot(x,var,scenario,graph,nolegend=0,nocolor=0,...)
x |
a thregIcure object. |
var |
specifies the name of the variable which is required to be categorical. The use of the var argument is the same as that in the plot.thregI(). |
scenario |
specifies a scenario for predicted plots. |
graph |
specifies the type of curves to be generated. The "hz" option is to plot hazard function accommodated a cure rate, the "sv" option is to plot survival function accommodated a cure rate and the "ds" option is to plot density function accommodated a cure rate. |
nolegend |
The use of the nolegend argument is the same as that in the plot.thregI(). |
nocolor |
The use of the nolegend argument is the same as that in the plot.thregI(). |
... |
for future methods |
#load the data "hdsd" data("hdsd", package="thregI") #transform categorical variable Noadyn into factor variable f.noadyn hdsd$f.noadyn=factor(hdsd$Noadyn) #fit the threshold regression cure-rate model #the covariates are TR360, Noadyn, Sex and Age fit<-thregIcure(Surv(left, right, type='interval2')~f.noadyn|TR360|Sex+Age, data=hdsd) #plot estimated hazard, survival and density function #subject is ambulatory (Noadyn1=1), TR360 = 1.5, male and 30 years old plot.thregIcure(fit, var=f.noadyn, scenario=TR360(1.5)+Sex(1)+Age(30), graph = "sv", nocolor = 1) plot.thregIcure(fit, var=f.noadyn, scenario=TR360(1.5)+Sex(1)+Age(30), graph = "hz", nocolor = 1) plot.thregIcure(fit, var=f.noadyn, scenario=TR360(1.5)+Sex(1)+Age(30), graph = "ds", nocolor = 1)
#load the data "hdsd" data("hdsd", package="thregI") #transform categorical variable Noadyn into factor variable f.noadyn hdsd$f.noadyn=factor(hdsd$Noadyn) #fit the threshold regression cure-rate model #the covariates are TR360, Noadyn, Sex and Age fit<-thregIcure(Surv(left, right, type='interval2')~f.noadyn|TR360|Sex+Age, data=hdsd) #plot estimated hazard, survival and density function #subject is ambulatory (Noadyn1=1), TR360 = 1.5, male and 30 years old plot.thregIcure(fit, var=f.noadyn, scenario=TR360(1.5)+Sex(1)+Age(30), graph = "sv", nocolor = 1) plot.thregIcure(fit, var=f.noadyn, scenario=TR360(1.5)+Sex(1)+Age(30), graph = "hz", nocolor = 1) plot.thregIcure(fit, var=f.noadyn, scenario=TR360(1.5)+Sex(1)+Age(30), graph = "ds", nocolor = 1)
Display the predicted values of threshold regression coefficients, density probability, survival probability, and hazard rate at the desired time and specified scenario; or, display the predicted values for all subjects corresponding to subjects scenario values at the desired time.
## S3 method for class 'thregI' predict(object,timevalue,scenario,...)
## S3 method for class 'thregI' predict(object,timevalue,scenario,...)
object |
a thregI object. |
timevalue |
specifies the desired time at which the predicted values of threshold regression coefficients, density probability, survival probability, and hazard rate. |
scenario |
specifies the values of all predictors considered in the thregI() and the dummy of the categorical variable of var. The predicted values at a specified time value for all subjects are calculated by the covariate values for each subject are used as their corresponding scenario values if ignore this argument. |
... |
for future methods |
#load the data "bcos" data("bcos", package="thregI") # transform the treatment variable into factor variable f.treatment bcos$f.treatment=factor(bcos$treatment) # fit the threshold regression model on the factor variable f.treatment fit<-thregI(Surv(left, right, type='interval2')~f.treatment|f.treatment,data=bcos) # calculate the predicted values for y0, mu, f, s and h # for the specified scenario that the treatment classification is 1 at time fifth month. predict.thregI(fit, timevalue = 5, scenario=f.treatmentRadiation(1))
#load the data "bcos" data("bcos", package="thregI") # transform the treatment variable into factor variable f.treatment bcos$f.treatment=factor(bcos$treatment) # fit the threshold regression model on the factor variable f.treatment fit<-thregI(Surv(left, right, type='interval2')~f.treatment|f.treatment,data=bcos) # calculate the predicted values for y0, mu, f, s and h # for the specified scenario that the treatment classification is 1 at time fifth month. predict.thregI(fit, timevalue = 5, scenario=f.treatmentRadiation(1))
Display the predicted values of threshold regression coefficients, non-cure rate, density probability, survival probability and hazard rate at the desired time and specified scenario; or, display the predicted values for all subjects corresponding to subjects scenario values at the desired time.
## S3 method for class 'thregIcure' predict(object,timevalue,scenario,...)
## S3 method for class 'thregIcure' predict(object,timevalue,scenario,...)
object |
a thregIcure object. |
timevalue |
specifies the desired time at which the predicted values of threshold regression coefficients, non-cure rate, density probability, survival probability, and hazard rate. |
scenario |
specifies the values of all predictors considered in the thregIcure() and the dummy of the categorical variable of var. The use of the scenario argument is the same as that in the predit.thregI(). |
... |
for future methods |
#load the data "hdsd" data("hdsd", package="thregI") # transform categorical variable Noadyn into factor variable f.noadyn hdsd$f.noadyn=factor(hdsd$Noadyn) # fit the threshold regression cure-rate model # the covariates are TR360, Noadyn, Sex and Age fit<-thregIcure(Surv(left, right, type='interval2')~f.noadyn|TR360|Sex+Age, data=hdsd) # calculate the predicted values # subject is ambulatory (Noadyn1=1), TR360 = 1.5, male and 30 years old # note that f.noadyn1 is the name of non-reference group predict.thregIcure(fit, timevalue = 1, scenario=f.noadyn1(1)+TR360(1.5)+Sex(1)+Age(30))
#load the data "hdsd" data("hdsd", package="thregI") # transform categorical variable Noadyn into factor variable f.noadyn hdsd$f.noadyn=factor(hdsd$Noadyn) # fit the threshold regression cure-rate model # the covariates are TR360, Noadyn, Sex and Age fit<-thregIcure(Surv(left, right, type='interval2')~f.noadyn|TR360|Sex+Age, data=hdsd) # calculate the predicted values # subject is ambulatory (Noadyn1=1), TR360 = 1.5, male and 30 years old # note that f.noadyn1 is the name of non-reference group predict.thregIcure(fit, timevalue = 1, scenario=f.noadyn1(1)+TR360(1.5)+Sex(1)+Age(30))
Produces a printed summary of a fitted thregI function
## S3 method for class 'thregI' print(x, digits=max(options()$digits - 4, 3), ...)
## S3 method for class 'thregI' print(x, digits=max(options()$digits - 4, 3), ...)
x |
the result of a call to |
digits |
significant digits to print |
... |
For future methods |
produces a printed summary of a fitted thregIcure function
## S3 method for class 'thregIcure' print(x, digits=max(options()$digits - 4, 3), ...)
## S3 method for class 'thregIcure' print(x, digits=max(options()$digits - 4, 3), ...)
x |
the result of a call to |
digits |
significant digits to print |
... |
For future methods |
Extend right-censored data of Xiao et al. (2015) into interval-censored data. Fit a threshold regression model for interval-censored data and calculate the prediction of the initial health status value and the drift value of the health process.
thregI(formula, data)
thregI(formula, data)
formula |
a formula object, which has the response on the left of a ~ operator, and the explaination variables on the right. The response must be a survival object as returned by the Surv(). The | operator on the left-hand side is used for the linear regression function of |
data |
a data frame must contains two time points ( |
Man-Hua Chen
Maintainer: Man-Hua Chen < [email protected] >
Xiao T, Whitmore GA, He X and Lee M-LT. (2015) The R Package threg to Implement Threshold Regression Models. Journal of Statistical Software 66, 1141-1156.
Xiao T. (2013) threg: Threshold Regression. R~package version 1.0.3, URL https://CRAN.R-project.org/package=threg.
#load the data "bcos" data("bcos", package="thregI") #transform the "treatment" variable into factor variable f.treatment bcos$f.treatment=factor(bcos$treatment) #fit the threshold regression model on the factor variable f.treatment fit<-thregI(Surv(left, right, type='interval2')~f.treatment|f.treatment, data=bcos) fit
#load the data "bcos" data("bcos", package="thregI") #transform the "treatment" variable into factor variable f.treatment bcos$f.treatment=factor(bcos$treatment) #fit the threshold regression model on the factor variable f.treatment fit<-thregI(Surv(left, right, type='interval2')~f.treatment|f.treatment, data=bcos) fit
Fit a threshold regression cure-rate model for interval-censored data and calculate the prediction of the initial health status value, the drift value of the health process and cure rate. Whether the accommodated cure rate exists by goodness-of-fit test compared with the 'thregI'.
thregIcure(formula, data)
thregIcure(formula, data)
formula |
a formula object, which has the similar format to that in the thregI(). There are two | operators, on the left-hand side | operator is used for the linear regression function of |
data |
a data frame has the same format as that in the thregI(). |
#load the data "hdsd" data("hdsd", package="thregI") #transform the Noadyn variable into factor variable f.noadyn hdsd$f.noadyn=factor(hdsd$Noadyn) #fit the threshold regression cure-rate model #the covariates are TR360, Noadyn, Sex and Age fit<-thregIcure(Surv(left, right, type='interval2')~f.noadyn+TR360|f.noadyn+TR360|f.noadyn+TR360+ Sex+Age, data=hdsd) fit #note that p-value of the goodness of fit test return by thregIcure function
#load the data "hdsd" data("hdsd", package="thregI") #transform the Noadyn variable into factor variable f.noadyn hdsd$f.noadyn=factor(hdsd$Noadyn) #fit the threshold regression cure-rate model #the covariates are TR360, Noadyn, Sex and Age fit<-thregIcure(Surv(left, right, type='interval2')~f.noadyn+TR360|f.noadyn+TR360|f.noadyn+TR360+ Sex+Age, data=hdsd) fit #note that p-value of the goodness of fit test return by thregIcure function