Impute an observed mode value for every missing value
Usage
impute_mode(ds, type = "columnwise", convert_tibble = TRUE)
Value
An object of the same class as ds with imputed missing values.
Arguments
ds
A data frame or matrix with missing values.
type
A string specifying the values used for imputation; one of:
"columnwise", "rowwise", "total", "Two-Way" or "Winer" (see details).
convert_tibble
If ds is a tibble, should it be converted
(see section A note for tibble users).
Details
This function behaves exactly like impute_mean. The only
difference is that it imputes a mode instead of a mean. All types
from impute_mean are also implemented for impute_mode.
They are documented in impute_mean and
apply_imputation.
A mode value of a vector x is a most frequent value of x.
If this value is not unique, the first occurring mode value in x will
be used as imputation value.
References
Beland, S., Pichette, F., & Jolani, S. (2016). Impact on Cronbach's
\(\alpha\) of simple treatment methods for missing data.
The Quantitative Methods for Psychology, 12(1), 57-73.
See Also
apply_imputation the workhorse for this function.
Other location parameter imputation functions:
impute_mean(),
impute_median()