hr.thregI {thregI} | R Documentation |
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)
[Package thregI version 1.0.4 Index]