Description Usage Arguments Value Examples
Predict
computes the predicted values and their standard deviations for each
statistical unit
1 2 3 4 5 6 7 |
object |
data.table containing the statistical units whose predicted values and standard deviations for each variable is to be computed. |
Param |
Object of virtual class PredParam with the parameters determining the method of computation of the predicted values and standard deviations of each statistical unit. |
data.table with the predicted values and standard deviations computed for each variable and each statistical unit.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | ## Not run:
library(xlsx)
library(StQ)
library(RepoReadWrite)
DD <- RepoXLSToDD('S:/E30183/E30183.NombresVariables_V1.xlsx')
FD.StQ <- ReadRepoFile('S:/E30183/E30183.FD_V1.MM032016.P_1', DD, perl = TRUE)
Units <- getUnits(FD.StQ)
IDQuals <- names(Units)
VarNames <- c('CifraNeg_13.___', 'Personal_07.__2.__')
FD.dm <- dcast_StQ(FD.StQ, ExtractNames(VarNames))[, c(IDQuals, VarNames), with = FALSE]
FF.StQ <- ReadRepoFile('S:/E30183/E30183.FF_V1.MM032016.D_1', DD, perl = TRUE)
DomainName <- c('Tame_05._2.', 'ActivEcono_35._4._2.1.4._0')
FF.dm <- dcast_StQ(FF.StQ, ExtractNames(DomainName))[, c(IDQuals, DomainName), with = FALSE]
FD.dm <- merge(FD.dm, FF.dm, by = IDQuals, all.x = TRUE)
FF.StQ <- ReadRepoFile('S:/E30183/E30183.FF_V1.MM022016.D_1', DD, perl = TRUE)
ImpParam <- new(Class = 'MeanImputationParam',
VarNames = c('PredCifraNeg_13.___', 'PredErrorSTDCifraNeg_13.___',
'PredPersonal_07.__2.__', 'PredErrorSTDPersonal_07.__2.__'),
DomainNames = c('Tame_05._2.', 'ActivEcono_35._4._2.1.4._0'))
PredlmParam <- new(Class = 'PredlmParam',
EdData = FF.StQ,
VarNames = c('CifraNeg_13.___', 'Personal_07.__2.__'),
DomainNames = 'Tame_05._2.',
Imputation = ImpParam)
Predict(FD.dm, PredlmParam)
FD <- readRDS('../E30183.FD.MM122016.rds')
Units <- StQ::getUnits(FD)
Units <- Units[sample(1:(dim(Units)[1]), 1000)]
StQ::setUnits(FD) <- Units
FD.dm <- StQ::dcast_StQ(FD)
StQList <- readRDS('../E30183.FF.StQList.rds')
StQ::setUnits(StQList) <- Units
TS.list <- list(Reg = list('RegDiffTSPred', forward = 2L),
Stat = list('StatDiffTSPred', forward = 2L),
StatReg = list('StatRegDiffTSPred', forward = 2L),
Arima = list('AutoArimaTSPred', forward = 2L))
VarNames <- c('CifraNeg_13.___', 'Personal_07.__1._1._')
BestTSPredParam <- new(Class='BestTSPredParam', TSPred.list = TS.list, VarNames = VarNames)
ImpParam <- new(Class = 'MeanImputationParam',
VarNames = 'CifraNeg_13.___',
DomainNames = 'Tame_05._2.')
PredTSParam <- new(Class = 'PredTSParam',
TS = StQList,
Param = BestTSPredParam,
Imputation = ImpParam)
Predict(FD.dm, PredTSParam)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.