ipcwswitch (version 1.0.3)

ipcw: Computing the stabilized IPCweights

Description

Computing the stabilized IPCweights

Usage

ipcw(data, id, tstart, tstop, cens, arm, bas.cov, conf, trunc, type)

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. The default is NULL.

type

type a character string specifying the type of survival curve. The default is type=`kaplan-meier`

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. "An R Package for IPCW: Application to switches in clinical trials" (submitted)

See Also

SHIdat

Examples

Run this code
# NOT RUN {
## Not run
# ipcw(toy.rep, id = "id", tstart = tstart, tstop = tstop, cens = cens,
# arm="arm",
# bas.cov = c("age"),
# conf = c("TDconf"), trunc = 0.05, type='kaplan-meier')

# see ?SHIdat for a complete example
# }

Run the code above in your browser using DataCamp Workspace