perform_missforest_imputations: Multiple imputation loop

View source: R/function_imputation.R

perform_missforest_imputationsR Documentation

Multiple imputation loop

Description

*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".

Usage

perform_missforest_imputations(dataset, numcols, im = 1)

Arguments

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

Details

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.

Value

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.

Examples

see vignette


allanecology/BetaDivMultifun documentation built on Nov. 9, 2023, 8:47 p.m.