computeRunningEstim: Return a data.table) with the sum of desing weights that...

Description Usage Arguments Value Examples

View source: R/computeRunningEstim.R

Description

computeRunningEstim computes the sum of design weights for every value in edPriority, according to the following procedure: In each row of the returning data.table), the variable edPriority indicates the number of edited units. The variable estim contains the sum of design weights without taking into account design weights of edited units. They are set to 0.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
computeRunningEstim(
  edPriority,
  data,
  levelsTargetVar,
  targetVar,
  id.vars,
  varPriority,
  designWeight,
  suffix = "_ed"
)

Arguments

edPriority

mesh of points to calculate the pseudo relative bias. These values represent the number of edited units.

data

data frame, list or environment (or object coercible by as.data.table to a data.table) containing the variables in the model (see 'Details').

levelsTargetVar

every values of the regresand (an object of class character).

targetVar

name of the regressand (an object of class character).

id.vars

names of the identification variables for each unit in the input data set data.

varPriority

variable with the priority of the unit.

designWeight

an object of class character containing the design weight.

suffix

parameter for the name of the edited version of the variable under analysis.

Value

data.table with three columns: targetVar with the values of regressand, estim with the sum of desing weights that remain to be explained, according to the number of edited units (variable edPriority).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## Not run: 
 fitPar <- new(Class = 'fitParam',
  edData = FFall_AS.StQ, rawData = FGall_AS.StQ, 
  selParam = list(ntreeTry=1000, stepFactor=2, improve=0.05, 
                  trace=TRUE, plot=TRUE, doBest = TRUE, 
                  ptrain = 0.8, DD = DDactu),
                  valParam = list(edEffInd = effInd, priorBin = 5, 
                  dataVal = c('Train','Test')))
                  
 ObsPredPar1 <- new(Class = 'categObsPredModelParam',
                  Data = FGall_AS.StQ,
                  VarRoles = list(Units = IDUnits,
                  Domains = character(0),
                  DesignW = DesignW,
                  Regressands = Regressands,
                  Regressors = Regressors
                  ))
                  
ObsPredPar1 <-  fitModels(ObsPredPar1, fitPar, na.as.category)
ObsPredPar1 <- computeVal(ObsPredPar1, fitPar, na.as.category)
 # computeVal calls computeEdEfficiency calls (computeRunningEstim and effInd)

## End(Not run)

david-salgado/categObsPredModelParam documentation built on Dec. 3, 2020, 1:42 p.m.