Description Usage Arguments Examples

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.

1 2 |

`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 |

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

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.