Description Usage Arguments Details See Also Examples
Compute the average treatment effect using different methods: G-formula based on (cause-specific) Cox regression, inverse probability of treatment weighting (IPTW) combined with inverse probability of censoring weighting (IPCW), augmented inverse probability weighting (AIPTW, AIPCW).
1 2 3 |
data |
[data.frame or data.table] Data set in which to evaluate the ATE. |
times |
[numeric] Time point at which to evaluate average treatment effects. |
cause |
[numeric/character] The cause of interest. Defaults to the first cause. |
type |
[character] When set to |
formula.event |
[formula] Cox model for the event of interest (outcome model).
Typically |
formula.censor |
[formula] Cox model for the censoring (censoring model).
Typically |
formula.treatment |
[formula] Logistic regression for the treatment (propensity score model).
Typically |
fitter |
[character] Routine to fit the Cox regression models.
If |
product.limit |
[logical] If |
se |
[logical] If |
augment.cens |
[logical] If |
na.rm |
[logical] If |
The standard errors/confindence intervals/p-values output by ateRobust do not account for the uncertainty related to the estimation of the parameters of the censoring model (only relevant for IPCW/AIPCW estimators). Note that for the AIPTW, this uncertainty is neglectable (i.e. o_p(n^-1/2)) in correctly specified models.
ate
for the g-formula result in case of more than 2 treatments
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | library(survival)
library(lava)
library(data.table)
library(prodlim)
set.seed(10)
# survival outcome, binary treatment X1
ds <- sampleData(101,outcome="survival")
out <- ateRobust(data = ds, type = "survival",
formula.event = Surv(time, event) ~ X1+X6,
formula.censor = Surv(time, event==0) ~ X6,
formula.treatment = X1 ~ X6+X2+X7, times = 1)
out
dt.out=as.data.table(out)
dt.out
# competing risk outcome, binary treatment X1
dc=sampleData(101,outcome="competing.risks")
x=ateRobust(data = dc, type = "competing.risks",
formula.event = list(Hist(time, event) ~ X1+X6,Hist(time, event) ~ X6),
formula.censor = Surv(time, event==0) ~ X6,
formula.treatment = X1 ~ X6+X2+X7, times = 1,cause=1,
product.limit = FALSE)
## compare with g-formula
fit= CSC(list(Hist(time, event) ~ X1+X6,Hist(time, event) ~ X6),data=dc)
ate(fit,data = dc,treatment="X1",times=1,cause=1)
x
as.data.table(x)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.