Fits Ghosh-Lin IPCW Cox-type model
formula with 'Event' outcome
data frame
of interest (1 default)
codes for death (terminating event, 2 default)
code of censoring (0 default)
for stratified Cox model without covariates
weights for score equations
offsets for model
censoring weights for time argument, default is to calculate these with a Kaplan-Meier estimator, should then give G_c(T_i-)
weights for composite outcome, so when cause=c(1,3), we might have wcomp=c(1,2).
of augmentation when augmentation model is given
Additional arguments to lower level funtions
For Cox type model : $$ E(dN_1(t)|X) = \mu_0(t)dt exp(X^T \beta) $$ by solving Cox-type IPCW weighted score equations $$ \int (Z - E(t)) w(t) dN_1(t) $$ where $$w(t) = G(t) (I(T_i \wedge t < C_i)/G_c(T_i \wedge t))$$ and $$E(t) = S_1(t)/S_0(t)$$ and $$S_j(t) = \sum X_i^j w_i(t) \exp(X_i^T \beta)$$.
The iid decomposition of the beta's are on the form $$ \int (Z - E ) w(t) dM_1 + \int q(s)/p(s) dM_c $$ and returned as iid.
Events, deaths and censorings are specified via stop start structure and the Event call, that via a status vector and cause (code), censoring-codes (cens.code) and death-codes (death.code) indentifies these. See example and vignette.
## data with no ties
data(base1cumhaz)
data(base4cumhaz)
data(drcumhaz)
Lam1 <- base1cumhaz; Lam2 <- base4cumhaz; LamD <- drcumhaz
## simulates recurrent events of types 1 and 2 and with terminal event D and censoring
rr <- simRecurrentII(100,Lam1,cumhaz2=Lam2,death.cumhaz=LamD,cens=3/5000)
rr <- count.history(rr)
rr$cens <- 0
nid <- max(rr$id)
rr$revnr <- revcumsumstrata(rep(1,nrow(rr)),rr$id-1,nid)
rr$x <- rnorm(nid)[rr$id]
rr$statusG <- rr$status
rr <- dtransform(rr,statusG=3,death==1)
dtable(rr,~statusG+status+death)
#>
#> death 0 1
#> statusG status
#> 0 0 42 0
#> 1 0 0
#> 2 0 0
#> 1 0 0 0
#> 1 126 0
#> 2 0 0
#> 2 0 0 0
#> 1 0 0
#> 2 13 0
#> 3 0 0 58
#> 1 0 0
#> 2 0 0
dcut(rr) <- gx~x
ll <- recreg(Event(start,stop,statusG)~x+cluster(id),data=rr,cause=1,death.code=3)
summary(ll)
#>
#> n events
#> 239 126
#>
#> 100 clusters
#> coeffients:
#> Estimate S.E. dU^-1/2 P-value
#> x -0.097581 0.144494 0.086683 0.4995
#>
#> exp(coeffients):
#> Estimate 2.5% 97.5%
#> x 0.90703 0.68333 1.204
#>
#>
## censoring stratified after quartiles of x
lls <- recreg(Event(start, stop, statusG)~x+cluster(id),data=rr,cause=1,
death.code=3,cens.model=~strata(gx))
summary(lls)
#>
#> n events
#> 239 126
#>
#> 100 clusters
#> coeffients:
#> Estimate S.E. dU^-1/2 P-value
#> x -0.080601 0.127179 0.081397 0.5262
#>
#> exp(coeffients):
#> Estimate 2.5% 97.5%
#> x 0.92256 0.71902 1.1837
#>
#>