Package 'thregI'

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

Help Index


Breast Cosmesis Data

Description

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 ( LL, RR ].

Usage

bcos

Format

id: subject recorded in the data set
left: breast cancer status return with a changed status after time LL
right: breast cancer status return with a changed status after time RR
treatment: Radiation = radiation therapy, RadChemo = radiation therapy with chemotherapy

References

Finkelstein DM and Wolfe RA. (1985). A semiparametric model for regression analysis of interval-censored failure time data. Biometrics 41, 933-945.


NASAs Hypobaric Decompression Sickness Data

Description

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 ( LL, RR ].

Usage

hdsd

Format

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 RR
left: return with a grade IV VGE changed status after time LL

References

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.


perform hazard ratio for threshold regression model

Description

Returns the hazard ratios at a selected time for specified scenarios of the threshold regression model.

Usage

## S3 method for class 'thregI'
hr(object,var,timevalue,scenario)

Arguments

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.

Examples

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

perform hazard ratio for threshold regression cure-rate model

Description

Returns the hazard ratios at a selected time for specified scenarios of the threshold regression cure-rate model.

Usage

## S3 method for class 'thregIcure'
hr(object,var,timevalue,scenario)

Arguments

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.

Examples

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

plot survival, hazard and density curves

Description

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.

Usage

## S3 method for class 'thregI'
plot(x,var,scenario,graph,nolegend=0,nocolor=0,...)

Arguments

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

Examples

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

plot survival, hazard and density curves

Description

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.

Usage

## S3 method for class 'thregIcure'
plot(x,var,scenario,graph,nolegend=0,nocolor=0,...)

Arguments

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

Examples

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

predict the initial health status value and the drift value of the health process

Description

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.

Usage

## S3 method for class 'thregI'
predict(object,timevalue,scenario,...)

Arguments

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

Examples

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

predict the initial health status value, the drift value of the health process and cure rate

Description

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.

Usage

## S3 method for class 'thregIcure'
predict(object,timevalue,scenario,...)

Arguments

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

Examples

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

print method for thregI objects

Description

Produces a printed summary of a fitted thregI function

Usage

## S3 method for class 'thregI'
print(x, digits=max(options()$digits - 4, 3), ...)

Arguments

x

the result of a call to thregI

digits

significant digits to print

...

For future methods


print method for thregIcure objects

Description

produces a printed summary of a fitted thregIcure function

Usage

## S3 method for class 'thregIcure'
print(x, digits=max(options()$digits - 4, 3), ...)

Arguments

x

the result of a call to thregIcure

digits

significant digits to print

...

For future methods


fit threshold regression for interval-censored data

Description

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.

Usage

thregI(formula, data)

Arguments

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 lny0ln{y_0} and right-hand side is for specifing explaination variables of μ\mu. A constant lny0ln{y_0} or μ\mu is allowed, let 0 or 1 as a placeholder on the left or right of the | operator.

data

a data frame must contains two time points (LL and RR) in which to through the Surv() of R package survival by type = interval2 and interpret the variables named in the formula.

Author(s)

Man-Hua Chen

Maintainer: Man-Hua Chen < [email protected] >

References

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.

Examples

#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 threshold regression cure-rate model for interval-censored data

Description

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

Usage

thregIcure(formula, data)

Arguments

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 lny0ln{y_0} and specifing explaination variables of μ\mu. On the right of right-hand side | operator is used for specifing explaination variables of logit(p)logit (p). A constant lny0ln{y_0}, μ\mu or logit(p)logit (p) is allowed.

data

a data frame has the same format as that in the thregI().

Examples

#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