class_svystat_rob {robsurvey}R Documentation

Utility Functions for Objects of Class svystat_rob

Description

Methods and utility functions for objects of class svystat_rob.

Usage

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:

See Also

svymean_dalen, svymean_huber, svymean_ratio, svymean_reg, svymean_tukey, svymean_trimmed, svymean_winsorized

svytotal_dalen, svytotal_huber, svytotal_ratio, svytotal_reg, svytotal_tukey, svytotal_trimmed, svytotal_winsorized

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

# 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 total
summary(wtot)

# Estimated mean square error (MSE)
mse(wtot)

# Estimate, std. err., variance, and the residuals
coef(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 residuals
plot(residuals(mtot), robweights(mtot))

[Package robsurvey version 0.6 Index]