svymean_dalen {robsurvey}R Documentation

Dalen's Estimators of the Population Mean and Total

Description

Dalen's estimators Z2 and Z3 of the population mean and total; see weighted_mean_dalen for further details.

Usage

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).

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.

Value

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 replacement
dn <- 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 total
svytotal_dalen(~employment, dn, censoring = 20000, type = "Z3")

# Dalen's estimator Z3 of the population mean
m <- svymean_dalen(~employment, dn, censoring = 20000, type = "Z3")

# Summarize
summary(m)

# Extract estimate
coef(m)

# Extract estimated standard error
SE(m)

[Package robsurvey version 0.6 Index]