impute_data_individual {rbmi} | R Documentation |
Impute data for a single subject
Description
This function performs the imputation for a single subject at a time implementing the
process as detailed in impute()
.
Usage
impute_data_individual(
id,
index,
beta,
sigma,
data,
references,
strategies,
condmean,
n_imputations = 1
)
Arguments
id |
Character string identifying the subject. |
index |
The sample indexes which the subject belongs to e.g |
beta |
A list of beta coefficients for each sample, i.e. |
sigma |
A list of the sigma coefficients for each sample split by group i.e.
|
data |
A |
references |
A named vector. Identifies the references to be used when generating the
imputed values. Should be of the form |
strategies |
A named list of functions. Defines the imputation functions to be used.
The names of the list should mirror the values specified in |
condmean |
Logical. If |
n_imputations |
When |
Details
Note that this function performs all of the required imputations for a subject at the same time. I.e. if a subject is included in samples 1,3,5,9 then all imputations (using sample-dependent imputation model parameters) are performed in one step in order to avoid having to look up a subjects's covariates and expanding them to a design matrix multiple times (which would be more computationally expensive). The function also supports subject belonging to the same sample multiple times, i.e. 1,1,2,3,5,5, as will typically occur for bootstrapped datasets.