plot.fmm {frailtyMMpen} | R Documentation |
Plot the baseline hazard or the predicted hazard based on the new data
Description
Both the cumulative hazard and the survival curves can be plotted.
Usage
##S3 method for class "fmm"
Arguments
newdata |
The new data for prediction of hazard |
surv |
Plot survival curve instead of cumulative hazard, the default is |
... |
Further arguments pass to or from other methods |
object |
Object with class "fmm" |
Details
If parameter newdata
is given, the plot is based on the predicted hazard while if it is not given,
the plot is based on the baseline hazard. To construct the new data, please refer to the detailed description from
function predict.fmm
and the following example.
See Also
Examples
gam_re = frailtyMM(Surv(tstart, tstop, status) ~ sex + treat + cluster(id), cgd, frailty = "gamma")
# Plot the survival curve based on baseline hazard
plot(gam_re, surv = TRUE)
# Construct new data and plot the cumulative hazard based on new data
newre = c(1, 1, 2)
names(newre) = c(gam_re$coefname, "id")
plot(gam_re, newdata = newre)
[Package frailtyMMpen version 1.2.1 Index]