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 |
design |
an object of class |
censoring |
|
type |
|
na.rm |
|
verbose |
|
Details
Package survey must be attached to the search path in order to use
the functions (see library
or require
).
- Methods/ types
type = "Z2"
ortype = "Z3"
; seeweighted_mean_dalen
for more details.- Utility functions
- Bare-bone functions
See
weighted_mean_dalen
andweighted_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)