Description Usage Arguments Author(s) References See Also Examples
Plot the attributable fraction function obtained by the paf
function.
1 2 3 4 |
x |
an object of class |
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 |
Li Chen
Chen L, Lin DY, Zeng D. (2010). Attributable fraction functions for censored event times. Biometrika 97, 713-726.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.