BenchImputationParam-class: S4 class for the parameters of the benchmark variable(s)...

Description Slots Examples

Description

Definition of the S4 class named BenchImputationParam for the parameters for the benchmark variable(s) imputation method of missing values.

Slots

VarNames

character vector with the names of the variables to impute.

DomainNames

character vector with the names of the variables determining the domains over which to compute the benchmark values quantiles.

UnitNames

character vector with the names of the identification variables.

BenchValues

data.table with the values of the benchmark variable(S) used to compute the imputation values.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# An empty BenchImputationParam object:
new(Class = 'BenchImputationParam')

## Not run: 

FF.StQList <- readRDS('../E30183.FF.StQList.rds')
FF <- FF.StQList[["MM072016"]]

ValToImpute <- dcast_StQ(FD, ExtractNames(c('CifraNeg_13.___', 'ActivEcono_35._4._2.1.4._0')))
ValToImpute[sample(1:16941, floor(16941 / 5)), CifraNeg_13.___ := NA_real_]

BenchValues <- dcast_StQ(FF, ExtractNames(c('CifraNeg_13.___', 'ActivEcono_35._4._2.1.4._0')))
BenchValues[is.na(CifraNeg_13.___), CifraNeg_13.___ := mean(CifraNeg_13.___), by = 'ActivEcono_35._6._2.1.4._0']
BenchValues <- BenchValues[, c('NOrden', 'CifraNeg_13.___'), with = FALSE]

BenchImpParam <- new(Class = 'BenchImputationParam',
                     VarNames = 'CifraNeg_13.___',
                     DomainNames = 'ActivEcono_35._4._2.1.4._0',
                     BenchValues = BenchValues)

## End(Not run)

david-salgado/StQImputation documentation built on July 31, 2019, 11:33 p.m.