ipcw {ipcwswitch} | R Documentation |
Computing the stabilized IPCweights
Description
Computing the stabilized IPCweights
Usage
ipcw(
data,
id,
tstart,
tstop,
cens,
arm,
bas.cov,
conf,
trunc = NULL,
type = "kaplan-meier"
)
Arguments
data |
a dataframe containing the following variables |
id |
the patient's id |
tstart |
the date of the beginning of the follow-up (in numeric format, with the first being equal at 0) |
tstop |
the date of the end of the follow-up (in numeric format) |
cens |
the indicator of treatment censoring (denoted by 1 at the end of the follow-up) |
arm |
the randomized treatment (2-levels factor) |
bas.cov |
a vector the baseline covariates |
conf |
a vector of time-dependent confounders |
trunc |
an optional fraction for the weights. For instance, when trunc = 0.01, the left tail is truncated to the 1st percentile and the right tail is truncated to the 99th percentile |
type |
a character string specifying the type of survival curve. The default is |
Value
the initial dataframe data with stabilized IPCweights as additional arguments. By default, the un-truncated stabilized weights are given. If the trunc option is not NULL then the truncated stabilized weights are also given.
References
Graffeo, N., Latouche, A., Le Tourneau C., Chevret, S. (2019) "ipcwswitch: an R package for inverse probability of censoring weighting with an application to switches in clinical trials". Computers in biology and medicine, 111, 103339. doi : "10.1016/j.compbiomed.2019.103339"
See Also
Examples
## Not run
# ipcw(toy.rep, tstart = tstart, tstop = tstop, cens = cens,
# arm="arm",
# bas.cov = c("age"),
# conf = c("TDconf"), trunc = 0.05)
# see ?SHIdat for a complete example