object: an object of class [ratio], e.g., result of the Huber ratio M-estimator svyratio_huber.
total: [numeric] vector of population totals of the auxiliary variables.
N: [numeric] population size (see also N_unknown.
variance: [character] type of variance estimator (default: "wu"); see Details Section.
keep_object: [logical] if TRUE, object is returned as an additional slot of the return value (default: TRUE).
N_unknown: [logical] if TRUE, it is assumed that the population size is unknown; thus, it is estimated (default: FALSE).
...: 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).
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_huber
or svyratio_tukey. The fitted model is called object.
Step 2: Based on the fitted model obtained in the first step, we predict the population total and mean, respectively, by the predictors svytotal_ratio and svymean_ratio, where object is the fitted ratio model.
Auxiliary data: Two types of auxiliary variables are distinguished: (1) population size N and (2) the population total of the auxiliary variable (denominator) used in the ratio model.
The option `N_unknown = TRUE` can be used in the predictor of the population mean if $N$ is unknown.
Variance estimation: Three variance estimators are implemented (argument variance): "base", "wu", and "hajek". These estimators correspond to the estimators v0, v1, and v2 in Wu (1982).
Utility functions: The return value is an object of class svystat_rob. Thus, the utility functions summary, coef, SE, vcov, residuals, fitted, and robweights are available.
Returns
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 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)}# Robust ratio M-estimator with Huber psi-functionrat <- svyratio_huber(~payroll,~ employment, dn, k =5)# Summary of the ratio estimatesummary(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 residualsplot(residuals(rat), robweights(rat))# Robust ratio predictor of the population meanm <- svymean_ratio(rat, total =1001233, N =90840)m
# Summary of the ratio estimate of the population meansummary(m)# Extract estimatecoef(m)# Extract estimate of scalescale(m)# Extract estimated standard errorSE(m)