View source: R/scoreImputedData.R
ScoreImpute | R Documentation |
Perform risk score multiple imputation method
ScoreImpute(
data,
event.model,
censor.model = event.model,
col.control,
NN.control = NN.options(),
time.dep = NULL,
m,
bootstrap.strata = rep(1, nrow(data)),
...,
parallel = c("no", "multicore", "snow")[1],
ncpus = 1L,
cl = NULL
)
data |
The data set for which imputation is required |
event.model |
The right hand side of the formula to be used for fitting the Cox model for calculating the time to event score e.g. ~Z1+Z2+Z3. |
censor.model |
The right hand side of the formula to be used for fitting the Cox model for calculating the time to
censoring score if not included then |
col.control |
A list of the columns names of |
NN.control |
Parameters which control the nearest neighbour algorithm. See |
time.dep |
A ScoreTD object, to be included if the time dependent score imputation method is to be used, otherwise it should be NULL |
m |
The number of data sets to impute |
bootstrap.strata |
When performing the bootstrap procedure for fitting the models,
how should the data be stratified (see strata argument to |
... |
Additional arguments passed into the Cox model Note the subset and na.action arguments should not be used (na.fail will be used when fitting the Cox model) |
parallel |
The type of parallel operation to be used (if any). |
ncpus |
integer: number of processes to be used in parallel operation: typically one would chose this to be the number of available CPUs |
cl |
An optional parallel or snow cluster for use if |
Note that coxph may fail to converge and the following output Warning in fitter(X, Y, strats, offset, init, control, weights = weights, : Ran out of iterations and did not converge
It is possible to use ridge regression by including a ridge term in the model formula
(e.g. ~Z1+ridge(Z2,theta=1)
). See ridge
for further details
A ScoreImputedSet
object
ScoreImputedSet.object
data(ScoreInd)
col.control <- col.headings(has.event="event", time="time",
Id="Id",arm="arm",
DCO.time="DCO.time",
to.impute="to.impute")
## Not run:
ans <- ScoreImpute(data=ScoreInd,event.model=~Z1+Z2+Z3+Z4+Z5,
col.control=col.control, m=5,
bootstrap.strata=ScoreInd$arm,
NN.control=NN.options(NN=5,w.censoring = 0.2))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.