ipcw: Computing the stabilized IPCweights

Description Usage Arguments Value References See Also Examples

Description

Computing the stabilized IPCweights

Usage

1
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

1
2
3
4
5
6
7
## 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

ipcwswitch documentation built on May 16, 2019, 1:12 a.m.

Related to ipcw in ipcwswitch...