Fixed issue if parameterperiod was typehaven::labelled incalc.stError().
Refactored code to make use of newdata.tablevariableenv. Makes code more readable and stable.
calc.stError() has new parametergroup.diff. Ifgroup.diff=TRUE differencesbetween values defined ingroup will also be calculated.For instance
library(surveysd)set.seed(1234)eusilc <- demo.eusilc(n = 4,prettyNames = TRUE)dat_boot <- draw.bootstrap(eusilc, REP = 3, hid = "hid", weights = "pWeight", strata = "region", period = "year")dat_boot_calib <- recalib(dat_boot, conP.var = "gender", conH.var = "region")# estimate weightedRatio for povertyRisk per perioderr.est <- calc.stError(dat_boot_calib, var = "povertyRisk", fun = weightedRatio, group = "gender", group.diff = TRUE)will produce difference in poverty rate betweenmale andfemale, in addition to other estimates.
Updatedvignetteaccordingly.
Fixed bug with parameteradjust.var andfun.adjust.var in functioncalc.stError().
Changed parameternational torelative.share incalc.stError() included adeprecate-message ifnational = TRUE issupplied.
Fixed issue with parameterlooseH in functionipf().
Fixed bug that variables names created by internal functionswhere not properly cleaned up before returningdata.tableoutput.
Improvedsummary.ipf() and includedprint.summary.ipf() in order to make the output ofipf() as well as convergence issues when usingipf() more intuitive.
New parametermethod indraw.bootstrap() andrescaled.bootstrap(). Canbei either"Preston" or"Rao-Wu", see?draw.bootstrap() or the newvignette.
draw.bootstrap() can now be used to draw bootstrapreplicates if bootstrap replicates where drawn for previous year withparameteralready.selected.already.selectedexpects a list ofdata.tables indicating if a record wasalready included in a bootstrap replicates in the previousperiod
New functionget.selection() to create input forparameteralready.selected indraw.bootstrap().
Updated and included (more) unit tests.
rescaled.bootstrap() has additional parameterperiod which is identical to the one indraw.bootstrap. Ifperiod is notNULL the boostraps will be drawn such that in each periodand strata/cluster onlycomputeLinearG1 foruse withipf().computeLinearG1 is now morestable when only numerical variables are used for weighting.numericalWeighting can be passed torecalib and will correctly be passed along to functionipfipf() to trim weightsipf()recalib() accepts conP and conH in the same way asipfrecalib() has argumentsepsP andepsH, to make convergence limits more transparantipf() when supplyinghid="hid", seehttps://github.com/statistikat/surveysd/pull/20. Thanksdemo.eusilc() for all examples and unit tests inthis packagerecalib() without specifyingconP.vars orconH.varssimPop::ipu2() and some related functions tosurveysd.... argument incalc.stErrordraw.bootstrap to downstreamfunctionsdraw.bootstrap and includeprettyNames argument. update documenentation examples touse new variable nameslaeken anddata.table inexamplesvignettes/TheoryWord.Rmd into a dynamicmarkdown file describing the methodology of the package