plot.paf: Plot method for 'paf' objects

Description Usage Arguments Author(s) References See Also Examples

View source: R/paf.R

Description

Plot the attributable fraction function obtained by the paf function.

Usage

1
2
3
4
## S3 method for class 'paf'
plot(x, conf.int = TRUE, lty = 1, col = 1, ylim =
NULL, xlab = "Time",
ylab = "Attributable Fraction Function", ...)

Arguments

x

an object of class paf which is retured by the paf function.

conf.int

determines whether confidence intervals will be plotted. The default is TRUE.

lty

an integer specifying line type.

col

an integer specifying color type.

ylim

a vector specifying the lower and upper boundaries for y values.

xlab

label given to the x-axis with "Time" as default.

ylab

label given to the y-axis with "Attributable Fraction Function" as default.

...

other arguments allowed for the general plot function.

Author(s)

Li Chen

References

Chen L, Lin DY, Zeng D. (2010). Attributable fraction functions for censored event times. Biometrika 97, 713-726.

See Also

par, paf.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# simulated data set from a Cox model
n = 1000
x1 = as.numeric(runif(n)>0.5)
x2 = x1 + rnorm(n)
t = exp(-x1 - 0.5 * x2) * rexp(n, rate = 0.1)
c = runif(n, 0, 3.4)
y = pmin(t, c)
delta = as.numeric(t<=c)
test = data.frame(time=y, status=delta, x1=x1, x2=x2)

# calculate the atrributable fraction function of x1 adjusting for x2
result=paf(Surv(time, status) ~ x1 + x2, data=test, cov=c('x1'))
# plot the attributable fraction function
plot(result)

paf documentation built on May 2, 2019, 8:29 a.m.

Related to plot.paf in paf...