Computes G-estimator $$ \hat S(t,A=a) = n^{-1} \sum_i \hat S(t,A=a,Z_i) $$ for the Cox model based on phreg og the Fine-Gray model based on the cifreg function. Gives influence functions of these risk estimates and SE's are based on these. If first covariate is a factor then all contrast are computed, and if continuous then considered covariate values are given by Avalues.
survivalG(
x,
data,
time = NULL,
Avalues = c(0, 1),
varname = NULL,
same.data = TRUE,
id = NULL
)
phreg or cifreg object
data frame for risk averaging
for estimate
values to compare for first covariate A
if given then averages for this variable, default is first variable
assumes that same data is used for fitting of survival model and averaging.
might be given to link to data to iid decomposition of survival data, must be coded as 1,2,..,
data(bmt); bmt$time <- bmt$time+runif(408)*0.001
bmt$event <- (bmt$cause!=0)*1
dfactor(bmt) <- tcell.f~tcell
fg1 <- cifreg(Event(time,cause)~tcell.f+platelet+age,bmt,cause=1,
cox.prep=TRUE,propodds=NULL)
summary(survivalG(fg1,bmt,50))
#> risk:
#> Estimate Std.Err 2.5% 97.5% P-value
#> risk0 0.4332 0.02749 0.3793 0.4871 6.337e-56
#> risk1 0.2727 0.05865 0.1578 0.3877 3.320e-06
#>
#> Average Treatment effects (G-estimator) :
#> Estimate Std.Err 2.5% 97.5% P-value
#> ps0 -0.1604 0.06355 -0.285 -0.03589 0.01158
#>
#> Average Treatment effect ratio (G-estimator) :
#> Estimate Std.Err 2.5% 97.5% P-value
#> [ps0] 0.6296186 0.1392893 0.3566165 0.9026207 0.007835454
#>
ss <- phreg(Surv(time,event)~tcell.f+platelet+age,bmt)
summary(survivalG(ss,bmt,50))
#> risk:
#> Estimate Std.Err 2.5% 97.5% P-value
#> risk0 0.6539 0.02708 0.6008 0.7070 8.659e-129
#> risk1 0.5641 0.05974 0.4470 0.6811 3.639e-21
#>
#> Average Treatment effects (G-estimator) :
#> Estimate Std.Err 2.5% 97.5% P-value
#> ps0 -0.08981 0.06294 -0.2132 0.03354 0.1536
#>
#> Average Treatment effect ratio (G-estimator) :
#> Estimate Std.Err 2.5% 97.5% P-value
#> [ps0] 0.862643 0.09452564 0.6773762 1.04791 0.1461908
#>