plot.fmm {frailtyMMpen} | R Documentation |
Both the cumulative hazard and the survival curves can be plotted.
##S3 method for class "fmm"
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" |
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.
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)