Dalen's Estimators of the Population Mean and Total
Dalen's Estimators of the Population Mean and Total
Dalen's estimators Z2 and Z3 of the population mean and total; see weighted_mean_dalen for further details.
svymean_dalen(x, design, censoring, type ="Z2", na.rm =FALSE, verbose =TRUE,...)svytotal_dalen(x, design, censoring, type ="Z2", na.rm =FALSE, verbose =TRUE,...)
Arguments
x: a one-sided [formula], e.g., ~myVariable.
design: an object of class survey.design; see svydesign.
censoring: [double] cutoff threshold above which the observations are censored.
type: [character] type of estimator; either "Z2" or "Z3" (default: "Z2").
na.rm: [logical] indicating whether NA values should be removed before the computation proceeds (default: FALSE).
verbose: [logical] indicating whether additional information is printed to the console (default: TRUE).
...: additional arguments (currently not used).
Details
Package survey must be attached to the search path in order to use the functions (see library or require).
Methods/ types: type = "Z2" or type = "Z3"; see weighted_mean_dalen for more details.
Utility functions: summary, coef, SE, vcov, residuals, fitted, robweights.
Bare-bone functions: See weighted_mean_dalen and weighted_total_dalen.
Returns
Object of class svystat_rob
References
Dalén, J. (1987). Practical Estimators of a Population Total Which Reduce the Impact of Large Observations. R & D Report U/STM 1987:32, Statistics Sweden, Stockholm.
See Also
Overview (of all implemented functions)
svymean_trimmed, svytotal_trimmed, svymean_winsorized, svytotal_winsorized, svymean_huber and svytotal_huber
Examples
head(workplace)library(survey)# Survey design for stratified simple random sampling without replacementdn <-if(packageVersion("survey")>="4.2"){# survey design with pre-calibrated weights svydesign(ids =~ID, strata =~strat, fpc =~fpc, weights =~weight, data = workplace, calibrate.formula =~-1+ strat)}else{# legacy mode svydesign(ids =~ID, strata =~strat, fpc =~fpc, weights =~weight, data = workplace)}# Dalen's estimator Z3 of the population totalsvytotal_dalen(~employment, dn, censoring =20000, type ="Z3")# Dalen's estimator Z3 of the population meanm <- svymean_dalen(~employment, dn, censoring =20000, type ="Z3")# Summarizesummary(m)# Extract estimatecoef(m)# Extract estimated standard errorSE(m)