View source: R/function_imputation.R
perform_missforest_imputations | R Documentation |
*Note*: this is a very specific function, only useful in the context of the analysis as described in the vignette of function imputation. It requires an already prepared dataset (no negative values, log transformed). The names of columns with negative values are stored. This function performes im imputations with missforest. The resulting iputed dataset is stored in a list "impvals" of length im. The variable-wise imputation error (missforest parameter variablewise = T) is stored in the list "imperr".
perform_missforest_imputations(dataset, numcols, im = 1)
dataset |
The dataset with the missing values which will be imputed. All variables need to be logtransfomed and negative values need to be shifted, according to the vignett. |
numcols |
The names of the columns from 'dataset' which are numeric. |
i |
the numer of imputations |
The following variables need to be defined before use of the function : 'mindea' : from variable DEA, the minimum (below 0) before shifting the whole variable to be positive. 'minno' : from variable NO3.2014, the minimum before shifting the whole column to be positive. 'mindung' : minimum dung.decomposition value to shift back the vector to have values above zero.
A list containing two lists, 'impvals' and 'imperr', both containing data tables. 'imperr' contains the variablewise imputation errors, which 'impvals' contains the imputed values. Note that they are already back-transformed (exp) and negative values are shifted back in.
see vignette
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.