plot.frailtyPenal {frailtypack} | R Documentation |
Plot Method for a Shared frailty model.
Description
Plots estimated baseline survival and hazard functions from an object of class 'frailtyPenal'. Confidence bands are allowed.
Usage
## S3 method for class 'frailtyPenal'
plot(x, type.plot = "Hazard", conf.bands=TRUE,
pos.legend = "topright", cex.legend=0.7, main, color=2, median=TRUE, Xlab = "Time", Ylab
= "Hazard function", ...)
Arguments
x |
A shared frailty model, i.e. a |
type.plot |
a character string specifying the type of curve. Possible value are "Hazard", or "Survival". The default is "Hazard". Only the first letters are required, e.g "Haz", "Su" |
conf.bands |
Logical value. Determines whether confidence bands will be plotted. The default is to do so. |
pos.legend |
The location of the legend can be specified by setting this argument to a single keyword from the list '"bottomright"', '"bottom"', '"bottomleft"', '"left"', '"topleft"', '"top"', '"topright"', '"right"' and '"center"'. The default is '"topright"' |
cex.legend |
character expansion factor *relative* to current 'par("cex")'. Default is 0.7 |
main |
title of plot |
color |
color of the curve (integer) |
median |
Logical value. Determines whether survival median will be plotted. Default is TRUE. |
Xlab |
Label of x-axis. Default is '"Time"' |
Ylab |
Label of y-axis. Default is '"Hazard function"' |
... |
other unused arguments |
Value
Print a plot of a shared frailty model.
See Also
Examples
## Not run:
data(readmission)
###--- Shared frailty model ---###
modSha <- frailtyPenal(Surv(time,event)~as.factor(dukes)+cluster(id),
n.knots=10,kappa=10000,data=readmission,hazard="Splines")
plot(modSha,type="Survival",conf=FALSE)
###--- Cox proportional hazard model ---###
modCox <- frailtyPenal(Surv(time,event)~as.factor(dukes),n.knots=10,
kappa=10000,data=readmission,hazard="Splines")
plot(modCox)
#-- no confidence bands
plot(modSha,conf.bands=FALSE)
plot(modCox,conf.bands=FALSE)
## End(Not run)