censordata | R Documentation |
censordata
simulates a pattern of participant dropouts
censordata(dat, trialdesign, censorparam)
dat |
dat file as produced by |
trialdesign |
a trial design as defined by |
censorparam |
a data.table provides 3 named parameters: (1) beta0 - the total rate (approximately) of censoring (0-1) (2) beta1 - the proportion of the total dropout that should be biased (0-1) (3) eb1 - the exponent used to define the shape of the curve defining biased dropout. See example, below. |
This function inputs a dat
file as would be produced by
generateData and selects a subset to drop out (censor).
The probability of a particular timepoint being selected for
censoring in the initial pass is the sum of two factors: one
that censors at a set rate as a function of time, and one that
biases the rate of censoring based on the trajectory of symptoms,
with a large improvement in symptoms from baseline decreasing the
probability of dropout, while a small change or a worsening
increases the probability of dropout. In a separate, second pass
all dropouts are carried forward, such that once a datapoint
has been censored, all future datapoints for that particular
participant are also censored
A new data file, with the censored data points replaced by NA
,
will be returned
# Create a set of censoring params to
# feed to censordata one at a time:
censorparams<-data.table(
names=c("balanced","more of flat","more of biased","high dropout"),
beta0=c(.05,.05 ,.05,.15),
beta1=c(.5,.2,.8 ,.5),
eb1= c(2, 2 ,2 ,2 )
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.