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,
outcome = c("rmst", "rmst-cause"),
model = "exp",
...
)
formula with 'Event' outcome
data-frame
"rmst"=E( min(T, t) | X) , or "rmst-cause"=E( I(epsilon==cause) ( t - mint(T,t)) ) | X)
possible exp model for relevant mean model that is exp(X^t beta)
Additional arguments to pass to binregATE
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".
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.8636723 0.0756680 2.7153658 3.0119789 0.0000
#> tcell1 0.0184348 0.1981783 -0.3699875 0.4068572 0.9259
#> platelet 0.2754744 0.1452178 -0.0091473 0.5600960 0.0578
#>
#> exp(coeffients):
#> Estimate 2.5% 97.5%
#> (Intercept) 17.52577 15.11014 20.3276
#> tcell1 1.01861 0.69074 1.5021
#> platelet 1.31716 0.99089 1.7508
#>
#> Average Treatment effects (G-formula) :
#> Estimate Std.Err 2.5% 97.5% P-value
#> treat0 19.26958 1.05137 17.20893 21.33022 0.0000
#> treat1 19.62810 3.43062 12.90420 26.35201 0.0000
#> treat:1-0 0.35853 3.87931 -7.24479 7.96184 0.9264
#>
#> Average Treatment effects (double robust) :
#> Estimate Std.Err 2.5% 97.5% P-value
#> treat0 19.3249 1.0516 17.2638 21.3860 0.0000
#> treat1 21.5607 3.8014 14.1101 29.0114 0.0000
#> treat:1-0 2.2358 4.1989 -5.9938 10.4654 0.5944
#>
#>
out1 <- resmeanATE(Event(time,cause)~tcell+platelet,data=bmt,cause=1,outcome="rmst-cause",
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.807116 0.069703 2.670500 2.943731 0.0000
#> tcell1 -0.376926 0.247934 -0.862868 0.109016 0.1284
#> platelet -0.494282 0.165197 -0.818061 -0.170502 0.0028
#>
#> exp(coeffients):
#> Estimate 2.5% 97.5%
#> (Intercept) 16.56208 14.44720 18.9866
#> tcell1 0.68597 0.42195 1.1152
#> platelet 0.61001 0.44129 0.8432
#>
#> Average Treatment effects (G-formula) :
#> Estimate Std.Err 2.5% 97.5% P-value
#> treat0 14.53571 0.95674 12.66054 16.41088 0.0000
#> treat1 9.97101 2.37567 5.31478 14.62725 0.0000
#> treat:1-0 -4.56470 2.57160 -9.60494 0.47555 0.0759
#>
#> Average Treatment effects (double robust) :
#> Estimate Std.Err 2.5% 97.5% P-value
#> treat0 14.5208537 0.9577145 12.6437679 16.3979396 0.0000
#> treat1 9.4568371 2.4051437 4.7428421 14.1708321 0.0001
#> treat:1-0 -5.0640166 2.5856852 -10.1318665 0.0038333 0.0502
#>
#>