# ateRobust: Average Treatment Effects (ATE) for survival outcome (with... In bozenne/riskRegressionLight: Light version of the package riskRegression

## Description

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).

## Usage

 ```1 2 3``` ```ateRobust(data, times, cause, type, formula.event, formula.censor, formula.treatment, fitter = "coxph", product.limit = NULL, se = TRUE, augment.cens = TRUE, na.rm = FALSE) ```

## Arguments

 `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 `"survival"` uses a cox model for modeling the survival, otherwise when set to `"competing.risks"` uses a Cause Specific Cox model for modeling the absolute risk of the event. `formula.event` [formula] Cox model for the event of interest (outcome model). Typically `Surv(time,event)~treatment`. `formula.censor` [formula] Cox model for the censoring (censoring model). Typically `Surv(time,event==0)~treatment`. `formula.treatment` [formula] Logistic regression for the treatment (propensity score model). Typically `treatment~1`. `fitter` [character] Routine to fit the Cox regression models. If `coxph` use `survival::coxph` else use `rms::cph`. `product.limit` [logical] If `TRUE` the survival is computed using the product limit method. Otherwise the exponential approximation is used (i.e. exp(-cumulative hazard)). `se` [logical] If `TRUE` compute and add the standard errors relative to the G-formula and IPTW method to the output. `augment.cens` [logical] If `TRUE` add an censoring model augmentation term to the estimating equation `na.rm` [logical] If `TRUE` ignore observations whose influence function is NA.

## Details

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) ```