Utility Functions for Objects of Class svystat_rob
Utility Functions for Objects of Class svystat_rob
Methods and utility functions for objects of class svystat_rob.
mse(object,...)## S3 method for class 'svystat_rob'mse(object,...)## S3 method for class 'svystat'mse(object,...)## S3 method for class 'svystat_rob'summary(object, digits = max(3L, getOption("digits")-3L),...)## S3 method for class 'svystat_rob'coef(object,...)## S3 method for class 'svystat_rob'SE(object,...)## S3 method for class 'svystat_rob'vcov(object,...)## S3 method for class 'svystat_rob'scale(x,...)## S3 method for class 'svystat_rob'residuals(object,...)## S3 method for class 'svystat_rob'fitted(object,...)robweights(object)## S3 method for class 'svystat_rob'robweights(object)## S3 method for class 'svystat_rob'print(x, digits = max(3L, getOption("digits")-3L),...)
Arguments
object: object of class svystat_rob.
digits: [integer] minimal number of significant digits.
...: additional arguments passed to the method.
x: object of class svystat_rob.
Details
Package survey must be attached to the search path in order to use the functions (see library or require).
Utility functions:
mse computes the estimated risk (mean square error) in presence of representative outliers; see also mer
summary gives a summary of the estimation properties
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)}# Estimated one-sided k winsorized population total (i.e., k = 2 observations# are winsorized at the top of the distribution)wtot <- svytotal_k_winsorized(~employment, dn, k =2)# Show summary statistic of the estimated totalsummary(wtot)# Estimated mean square error (MSE)mse(wtot)# Estimate, std. err., variance, and the residualscoef(wtot)SE(wtot)vcov(wtot)residuals(wtot)# M-estimate of the total (Huber psi-function; tuning constant k = 3)mtot <- svytotal_huber(~employment, dn, k =45)# Plot of the robustness weights of the M-estimate against its residualsplot(residuals(mtot), robweights(mtot))