| svymean_ratio {robsurvey} | R Documentation |
Robust Ratio Predictor of the Mean and Total
Description
Robust ratio predictor (M-estimator) of the population mean and total with Huber and Tukey biweight (bisquare) psi-function.
Usage
svytotal_ratio(object, total, variance = "wu", keep_object = TRUE)
svymean_ratio(object, total, N = NULL, variance = "wu",
keep_object = TRUE, N_unknown = FALSE)
Arguments
object |
an object of class |
total |
|
N |
|
variance |
|
keep_object |
|
N_unknown |
|
Details
Package survey must be attached to the search path in order to use
the functions (see library or require).
The (robust) ratio predictor of the population total or mean is computed in two steps.
Step 1: Fit the ratio model associated with the predictor by one of the functions
svyratio_huberorsvyratio_tukey. The fitted model is calledobject.Step 2: Based on the fitted model obtained in the first step, we predict the population total and mean, respectively, by the predictors
svytotal_ratioandsvymean_ratio, whereobjectis the fitted ratio model.
- Auxiliary data
-
Two types of auxiliary variables are distinguished: (1) population size
Nand (2) the population total of the auxiliary variable (denominator) used in the ratio model.The option
N_unknown = TRUEcan be used in the predictor of the population mean ifNis unknown. - Variance estimation
-
Three variance estimators are implemented (argument
variance):"base","wu", and"hajek". These estimators correspond to the estimatorsv0,v1, andv2in Wu (1982). - Utility functions
-
The return value is an object of class
svystat_rob. Thus, the utility functionssummary,coef,SE,vcov,residuals,fitted, androbweightsare available.
Value
Object of class svystat_rob
References
Wu, C.-F. (1982). Estimation of Variance of the Ratio Estimator. Biometrika 69, 183–189.
See Also
Overview (of all implemented functions)
svymean_reg and svytotal_reg for (robust) GREG
regression predictors
svyreg_huberM, svyreg_huberGM,
svyreg_tukeyM and svyreg_tukeyGM for robust
regression M- and GM-estimators
svymean_huber, svytotal_huber,
svymean_tukey and svytotal_tukey for
M-estimators
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)
}
# Robust ratio M-estimator with Huber psi-function
rat <- svyratio_huber(~payroll, ~ employment, dn, k = 5)
# Summary of the ratio estimate
summary(rat)
# Diagnostic plots of the ration/regression M-estimate (e.g.,
# standardized residuals against fitted values)
plot(rat, which = 1L)
# Plot of the robustness weights of the ratio/regression M-estimate
# against its residuals
plot(residuals(rat), robweights(rat))
# Robust ratio predictor of the population mean
m <- svymean_ratio(rat, total = 1001233, N = 90840)
m
# Summary of the ratio estimate of the population mean
summary(m)
# Extract estimate
coef(m)
# Extract estimate of scale
scale(m)
# Extract estimated standard error
SE(m)