miWithPcAux | R Documentation |
Create multiple imputations with the mice package using the principal component auxiliary variable scores produced by createPcAux as the predictors in the imputation model.
miWithPcAux(
rawData,
pcAuxData,
nImps = 100L,
nomVars = NULL,
ordVars = NULL,
idVars = NULL,
dropVars = "useExtant",
nComps = NULL,
compFormat = "list",
seed = NULL,
simMode = FALSE,
forcePmm = FALSE,
nProcess = 1L,
verbose = 2L,
control,
micemethods = c("norm", "polr", "polyreg", "logreg")
)
rawData |
A data frame containing the incomplete data for which to create the multiple imputations. |
pcAuxData |
An object of class PcAuxData produced by a run of createPcAux. |
nImps |
An integer giving the number of imputations to create. Defaults to nImps = 100L. |
nomVars |
An optional character vector containing names of any nominal variables (i.e., unordered factors) that exist in rawData. If unspecified, any nomVarsdefined in pcAuxDatawill be used. |
ordVars |
An optional character vector containing names of any ordinal variables (i.e., ordered factors) that exist in rawData. If unspecified, any ordVars defined in pcAuxDatawill be used. |
idVars |
An optional character vector containing names of any ID variables that exist in rawData. Any columns flagged as ID variables should not be represented in nomVars, ordVars, dropVars, or groupVars. If unspecified, any idVars defined in pcAuxDatawill be used. |
dropVars |
An optional character vector containing names of any nuisance variables that should be excluded from the imputation process. If unspecified, the default value of dropVars = "useExtant" causes any user-defined dropVars defined in pcAuxData to be used. |
nComps |
A two-element vector giving the number of linear and nonlinear, respectively, component scores to extract. See the Details section for more information. When not specified, all component scores that exist in pcAuxData are used. |
compFormat |
The format in which the multiply-imputed data sets are returned. Valid argu- ments are "list", which returns a list of length nImps with each entry containing one imputed data set, "long", "broad", and "repeated". The latter three options are passed directly to the action argument of the mice::complete function. See the documentation for mice::completefor more details on the behavior of the "long", "broad", and "repeated" options. Defaults to compFormat = "list". |
seed |
An optional integer used to seed the random number generator used by the im- putation algorithm. Defaults to seed = NULL which employs any seed defined in createPcAux and, otherwise, leaves the default random number generator unaltered. |
simMode |
A logical switch turning ’Simulation Mode’ on or off. In Simulation Mode all of the automatic data checks will be suppressed. This mode is intended for use when miWithPcAuxis being called as part of a Monte Carlo simulation study in which the data properties are well-known by the user. This mode should not be used for ’real-world’ data analysis. Defaults to simMode = FALSE. |
forcePmm |
A logical flag indicating whether or not the imputation should use predictive mean matching as the elementary imputation method for (almost) all variables. If forcePmm == FALSE, the elementary imputation methods are chosen to match each variable’s declared type. When forcePmm == TRUE, nominal variables are still imputed with GLM-based methods appropriate for their declared types, but all other variables are imputed with PMM. Defaults to forcePmm = FALSE. |
nProcess |
An integer that gives the number of parallel processes to use when for parallel MI. Must be less than or equal to the number of available logical processor cores. A value of nProcess = 1L results in serial MI processing. Defaults to nProcess = 1L. |
verbose |
An integer code in 0, 1, 2 defining the verbosity of output printed to the screen. verbose = 0prints no output; verbose = 1prints all output except for the mes- sages returned by mice; verbose = 2 prints all output, including the messages returned by mice. Warnings are always printed, regardless of the value assigned to verbose. Defaults to verbose = 2. |
control |
An optional list of control parameters (see ’Details’). |
micemethods |
Which |
A Reference Class object of class PcAuxData.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.