plot.resMexhaz {mexhaz} | R Documentation |
Plot method for a resMexhaz object
Description
Function for plotting various quantities calculated from a
mexhaz
model.
Usage
## S3 method for class 'resMexhaz'
plot(x, conf.int = TRUE, lty.pe = "solid", lty.ci =
"blank", col.ci = "blue", alpha.col.ci = 0.25, ylim = NULL, ...)
Arguments
x |
an object of class |
conf.int |
logical value allowing the user to decide whether to plot the confidence limits of the survival (or hazard). |
lty.pe |
type of line used for drawing the hazard/survival estimate. |
lty.ci |
type of line used for drawing the confidence limits. |
col.ci |
color used to fill in the polygon defined by the confidence limits. |
alpha.col.ci |
parameter used internally by the |
ylim |
when set to |
... |
additional parameters that are directly passed to the
|
See Also
adjsurv
, riskfunc
,
lines.resMexhaz
Examples
data(simdatn1)
## Fit of a fixed-effect hazard model, with the baseline hazard
## described by a linear B-spline with two knots at 1 and 5 year and with
## effects of age (agecr), deprivation index (depindex) and sex (IsexH)
Mod_bs2 <- mexhaz(formula=Surv(time=timesurv,
event=vstat)~agecr+depindex+IsexH, data=simdatn1, base="exp.bs",
degree=2, knots=c(1,5), verbose=0)
## Relative risk (ratio of cumulative incidence curves) for men versus
## women
RR_Modbs2 <- riskfunc(Mod_bs2, time.pts=seq(0,10, by=0.1),
data=data.frame(agecr=0.1, IsexH=1, depindex=0),
data.0=data.frame(agecr=0.1, IsexH=0, depindex=0), conf.int="delta",
type="rr")
plot(RR_Modbs2)
abline(h=1, lty="dashed")