R/restricted.mean.R
resmeanATE.Rd
Under the standard causal assumptions we can estimate the average treatment effect E(Y(1) - Y(0)). We need Consistency, ignorability ( Y(1), Y(0) indep A given X), and positivity.
resmeanATE(formula, data, model = "exp", outcome = c("rmst", "rmtl"), ...)
The first covariate in the specification of the competing risks regression model must be the treatment effect that is a factor. If the factor has more than two levels then it uses the mlogit for propensity score modelling. We consider the outcome mint(T;tau) or I(epsion==cause1)(t- min(T;t)) that gives years lost due to cause "cause" depending on the number of causes. The default model is the exp(X^ beta) and otherwise a linear model is used.
Estimates the ATE using the the standard binary double robust estimating equations that are IPCW censoring adjusted.
library(mets); data(bmt); bmt$event <- bmt$cause!=0; dfactor(bmt) <- tcell~tcell
out <- resmeanATE(Event(time,event)~tcell+platelet,data=bmt,time=40,treat.model=tcell~platelet)
summary(out)
#> n events
#> 408 241
#>
#> 408 clusters
#> coeffients:
#> Estimate Std.Err 2.5% 97.5% P-value
#> (Intercept) 2.852563 0.062496 2.730074 2.975052 0.0000
#> tcell1 0.021286 0.122983 -0.219757 0.262329 0.8626
#> platelet 0.303306 0.090772 0.125396 0.481215 0.0008
#>
#> exp(coeffients):
#> Estimate 2.5% 97.5%
#> (Intercept) 17.33214 15.33402 19.591
#> tcell1 1.02151 0.80271 1.300
#> platelet 1.35433 1.13360 1.618
#>
#> Average Treatment effects (G-formula) :
#> Estimate Std.Err 2.5% 97.5% P-value
#> treat0 19.25882 0.95918 17.37887 21.13877 0.0000
#> treat1 19.67316 2.22868 15.30502 24.04129 0.0000
#> treat:1-0 0.41434 2.41151 -4.31213 5.14081 0.8636
#>
#> Average Treatment effects (double robust) :
#> Estimate Std.Err 2.5% 97.5% P-value
#> treat0 19.3224 1.0515 17.2614 21.3834 0.0000
#> treat1 21.5582 3.8016 14.1072 29.0091 0.0000
#> treat:1-0 2.2358 4.1989 -5.9940 10.4655 0.5944
#>
#>
out1 <- resmeanATE(Event(time,cause)~tcell+platelet,data=bmt,cause=1,time=40,
treat.model=tcell~platelet)
summary(out1)
#> n events
#> 408 157
#>
#> 408 clusters
#> coeffients:
#> Estimate Std.Err 2.5% 97.5% P-value
#> (Intercept) 2.80626 0.06962 2.66981 2.94271 0.0000
#> tcell1 -0.37413 0.24769 -0.85960 0.11133 0.1309
#> platelet -0.49164 0.16493 -0.81490 -0.16837 0.0029
#>
#> exp(coeffients):
#> Estimate 2.5% 97.5%
#> (Intercept) 16.54790 14.43717 18.9672
#> tcell1 0.68788 0.42333 1.1178
#> platelet 0.61162 0.44268 0.8450
#>
#> Average Treatment effects (G-formula) :
#> Estimate Std.Err 2.5% 97.5% P-value
#> treat0 14.53165 0.95705 12.65587 16.40742 0.0000
#> treat1 9.99609 2.37815 5.33499 14.65718 0.0000
#> treat:1-0 -4.53556 2.57515 -9.58276 0.51164 0.0782
#>
#> Average Treatment effects (double robust) :
#> Estimate Std.Err 2.5% 97.5% P-value
#> treat0 14.5200247 0.9576900 12.6429868 16.3970625 0.0000
#> treat1 9.4568371 2.4051437 4.7428421 14.1708321 0.0001
#> treat:1-0 -5.0631876 2.5856762 -10.1310197 0.0046446 0.0502
#>
#>
ratioATE(out,out1,h=function(x) log(x))
#> $ratioG
#> Estimate Std.Err 2.5% 97.5% P-value
#> treat0 -0.2816 0.1075 -0.4924 -0.07093 0.00880
#> treat1 -0.6771 0.3183 -1.3008 -0.05328 0.03339
#> treat0.1 -0.3954 0.3363 -1.0545 0.26370 0.23966
#> treat1.1 0.3954 0.3363 -0.2637 1.05454 0.23966
#>
#> $ratioDR
#> Estimate Std.Err 2.5% 97.5% P-value
#> treat0 -0.2857 0.1097 -0.5008 -0.0707 0.009206
#> treat1 -0.8240 0.3669 -1.5430 -0.1050 0.024695
#> treat0.1 -0.5383 0.3894 -1.3014 0.2249 0.166831
#> treat1.1 0.5383 0.3894 -0.2249 1.3014 0.166831
#>