lines.resMexhaz: Lines method for a resMexhaz object

View source: R/lines.resMexhaz.R

lines.resMexhazR Documentation

Lines method for a resMexhaz object

Description

Function for adding to an already existing graphical window various quantities calculated from a mexhaz model.

Usage

## S3 method for class 'resMexhaz'
lines(x, conf.int = TRUE, lty.pe = "solid", lty.ci =
"blank", col.ci = "blue", alpha.col.ci = 0.25, ...)

Arguments

x

an object of class resMexhaz, corresponding to various predictions based on a survival model fitted with the mexhaz function. Predictions can be obtained for multiple times for one vector of covariables ("multitime") or for several vectors of covariables at one time point ("multiobs"). The plot() function only applies to the "multitime" type of predictions.

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 rgb() function to set the color transparency.

...

additional parameters that are directly passed to the lines function. These parameters will apply simultaneously to the point estimate and confidence limit curves.

See Also

adjsurv, riskfunc, plot.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 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")


mexhaz documentation built on Oct. 31, 2022, 5:08 p.m.