Function is used in autotune_mice
but can be use sepraetly.
formula_creating(df, col_miss, col_no_miss, col_type, percent_of_missing)
List with formula object[1] and information if its no numeric value in dataset[2].
data.frame. Data frame to impute missing values with column names.
character vector. Names of columns with NA.
character vector. Names of columns without NA.
character vector. A vector containing column type names.
numeric vector. Vector contatining percent of missing data in columns for example c(0,1,0,0,11.3,..)
Function create a formula as follows. It creates one of the formulas its next possible formula impossible possible formula is created:
1. Numeric no missing ~ 3 numeric with most missing
2. Numeric no missing ~ all available numeric with missing
3. Numeric with less missing ~ 3 numeric with most missing
4. Numeric with less missing ~ all available numeric with missing
5. No numeric no missing ~ 3 most missing no numeric
6. No numeric no missing ~ all available no numeric with missing
7. No numeric with less missing ~ 3 no numeric with most missing
8. No numeric with less missing ~ all available no numeric with missing.
For example, if its impossible to create formula 1 and 2 formula 3 will be created but if it's possible to create formula 1 and 5 formula 1 will be created.
Stef van Buuren, Karin Groothuis-Oudshoorn (2011). mice: Multivariate Imputation by Chained Equations in R. Journal of Statistical Software, 45(3), 1-67. URL https://www.jstatsoft.org/v45/i03/.