View source: R/ratio.regression.R
| binregRatio | R Documentation |
Estimates the percentage of the years lost that is due to a cause and how covariates affects this percentage by doing ICPW regression.
binregRatio(
formula,
data,
cause = 1,
time = NULL,
beta = NULL,
type = c("II", "I"),
offset = NULL,
weights = NULL,
cens.weights = NULL,
cens.model = ~+1,
se = TRUE,
kaplan.meier = TRUE,
cens.code = 0,
no.opt = FALSE,
method = "nr",
augmentation = NULL,
outcome = c("cif", "rmtl"),
model = c("logit", "exp", "lin"),
Ydirect = NULL,
...
)
formula |
formula with outcome (see |
data |
data frame |
cause |
cause of interest (numeric variable) |
time |
time of interest |
beta |
starting values |
type |
"II" adds augmentation term, and "I" classical outcome IPCW regression |
offset |
offsets for partial likelihood |
weights |
for score equations |
cens.weights |
censoring weights |
cens.model |
only stratified cox model without covariates |
se |
to compute se's based on IPCW |
kaplan.meier |
uses Kaplan-Meier for IPCW in contrast to exp(-Baseline) |
cens.code |
gives censoring code |
no.opt |
to not optimize |
method |
for optimization |
augmentation |
to augment binomial regression |
outcome |
can do CIF regression "cif"=F(t|X), "rmtl"=E( t- min(T, t) | X)" |
model |
logit, exp or lin(ear) |
Ydirect |
use this Y instead of outcome constructed inside the program, should be a matrix with two column for numerator and denominator. |
... |
Additional arguments to lower level funtions |
Let the years lost be
Y1= t- min(T ,)
and the years lost due to cause 1
Y2= I(epsilon==1) ( t- min(T ,t)
, then we model the ratio
logit( E(Y2 | X)/E(Y1 | X)) = X^T \beta
. Estimation is based on on binomial regresion IPCW response estimating equation:
X ( \Delta^{ipcw}(t) Y2 expit(X^T \beta) - Y1 ) = 0
where
\Delta^{ipcw}(t) = I((min(t,T)< C)/G_c(min(t,T)-)
is IPCW adjustment of the response
Y(t)= I(T \leq t, \epsilon=1 )
.
(type="I") sovlves this estimating equation using a stratified Kaplan-Meier for the censoring distribution. For (type="II") the default an additional censoring augmentation term
X \int E(Y(t)| T>s)/G_c(s) d \hat M_c
is added.
The variance is based on the squared influence functions that are also returned as the iid component. naive.var is variance under known censoring model.
Censoring model may depend on strata (cens.model=~strata(gX)).
Thomas Scheike
library(mets)
data(bmt); bmt$time <- bmt$time+runif(408)*0.001
rmst30 <- rmstIPCW(Event(time,cause!=0)~platelet+tcell+age,bmt,time=30,cause=1)
rmst301 <- rmstIPCW(Event(time,cause)~platelet+tcell+age,bmt,time=30,cause=1)
rmst302 <- rmstIPCW(Event(time,cause)~platelet+tcell+age,bmt,time=30,cause=2)
estimate(rmst30)
estimate(rmst301)
estimate(rmst302)
## percentage of total cumulative incidence due to cause 1
rmtlratioI <- rmtlRatio(Event(time,cause)~platelet+tcell+age,bmt,time=30,cause=1)
summary(rmtlratioI)
pp <- predict(rmtlratioI,bmt)
ppb <- cbind(pp,bmt)
## percentage of total cumulative incidence due to cause 1
cifratio <- binregRatio(Event(time,cause)~platelet+tcell+age,bmt,time=30,cause=1)
summary(cifratio)
pp <- predict(cifratio,bmt)
rmtlratioI <- binregRatio(Event(time,cause)~platelet+tcell+age,bmt,
time=30,cause=1,outcome="rmtl")
summary(rmtlratioI)
pp <- predict(rmtlratioI,bmt)
ppb <- cbind(pp,bmt)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.