ScoreImpute: Perform risk score multiple imputation method

View source: R/scoreImputedData.R

ScoreImputeR Documentation

Perform risk score multiple imputation method

Description

Perform risk score multiple imputation method

Usage

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
)

Arguments

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 event.model will be used

col.control

A list of the columns names of data which are used by the imputation algorithm See example below and for further details of these columns and their purpose see col.headings

NN.control

Parameters which control the nearest neighbour algorithm. See NN.options

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 boot::boot). if argument is not used then standard sampling with replacement is used to generate the bootstrap data

...

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 parallel="snow". If not supplied, a cluster on the local machine is created for the duration of the call.

Details

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

Value

A ScoreImputedSet object

See Also

ScoreImputedSet.object

Examples


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)


InformativeCensoring documentation built on June 7, 2023, 6:09 p.m.