plot.thregIcure: plot survival, hazard and density curves

Description Usage Arguments Examples

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

1
2
3
## 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
#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)

thregI documentation built on May 2, 2019, 6:27 a.m.