View source: R/lines.resMexhaz.R
lines.resMexhaz | R Documentation |
Function for adding to an already existing graphical window
various quantities calculated from a mexhaz
model.
## S3 method for class 'resMexhaz' lines(x, conf.int = TRUE, lty.pe = "solid", lty.ci = "blank", col.ci = "blue", alpha.col.ci = 0.25, ...)
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 |
... |
additional parameters that are directly passed to the
|
adjsurv
, riskfunc
,
plot.resMexhaz
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 for two different values of age RR_Modbs2a <- 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") RR_Modbs2b <- 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_Modbs2a) lines(RR_Modbs2a, col.ci="green") abline(h=1, lty="dashed")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.