class_svyreg_rob: Utility Functions for Objects of Class svyreg_rob

class_svyreg_robR Documentation

Utility Functions for Objects of Class svyreg_rob

Description

Methods and utility functions for objects of class svyreg_rob.

Usage

## S3 method for class 'svyreg_rob'
print(x, digits = max(3L, getOption("digits") - 3L), ...)

## S3 method for class 'svyreg_rob'
summary(object, mode = c("design", "model", "compound"),
    digits = max(3L, getOption("digits") - 3L), ...)

## S3 method for class 'svyreg_rob'
coef(object, ...)

## S3 method for class 'svyreg_rob'
vcov(object, mode = c("design", "model", "compound"), ...)

## S3 method for class 'svyreg_rob'
SE(object, mode = c("design", "model", "compound"), ...)

## S3 method for class 'svyreg_rob'
residuals(object, ...)

## S3 method for class 'svyreg_rob'
fitted(object, ...)

## S3 method for class 'svyreg_rob'
robweights(object)

## S3 method for class 'svyreg_rob'
plot(x, which = 1L:4L,
    hex = FALSE, caption = c("Standardized residuals vs. Fitted Values",
    "Normal Q-Q", "Response vs. Fitted values",
    "Sqrt of abs(Residuals) vs. Fitted Values"),
	panel = if (add.smooth) function(x, y, ...) panel.smooth(x, y,
    iter = iter.smooth, ...) else points, sub.caption = NULL, main = "",
	ask = prod(par("mfcol")) < length(which) && dev.interactive(), ...,
	id.n = 3, labels.id = names(residuals(x)), cex.id = 0.75, qqline = TRUE,
	add.smooth = getOption("add.smooth"), iter.smooth = 3,
	label.pos = c(4, 2), cex.caption = 1, cex.oma.main = 1.25)

Arguments

x

object of class svyreg_rob.

digits

[integer] minimal number of significant digits.

...

additional arguments passed to the method.

object

object of class svyreg_rob.

mode

[character] mode of variance estimator: "design", "model" or "compound" (default: "design").

which

[integer] indicating which plots to be drawn; if a subset of the plots is required, you can specify a subset of the numbers 1:4.

hex

[logical] if TRUE, a hexagonally binned plot is shown in place of a scatterplot.

caption

[character] captions to appear above the plots; vector of valid graphics annotations. It can be set to "" or NA to suppress all captions.

panel

panel function. The useful alternative to points, panel.smooth can be chosen by add.smooth = TRUE.

sub.caption

[character] common title—above the figures if there are more than one; used as sub (s.title) otherwise. If NULL, as by default, a possible abbreviated version of deparse(x$call) is used.

main

[character] title to each plot—in addition to caption.

ask

[logical]; if TRUE, the user is asked before each plot, see par(ask=.).

id.n

[integer] number of points to be labelled in each plot, starting with the most extreme.

labels.id

[character] vector of labels from which the labels for extreme points will be chosen. NULL uses observation numbers.

cex.id

[numeric] magnification of point labels.

qqline

[logical] indicating if a qqline should be added to the normal Q-Q plot.

add.smooth

[logical] indicating if a smoother should be added to most plots; see also panel above.

iter.smooth

[integer] the number of robustness iterations, the argument iter in panel.smooth.

label.pos

[numeric] positioning of labels, for the left half and right half of the graph respectively.

cex.caption

[numeric] controls the size of caption.

cex.oma.main

[numeric] controls the size of the sub.caption only if that is above the figures when there is more than one.

Details

Package survey must be loaded in order to use the functions.

Variance

For variance estimation (summary, vcov, and SE) three modes are available:

  • "design": design-based variance estimator using linearization; see Binder (1983)

  • "model": model-based weighted variance estimator (the sampling design is ignored)

  • "compound": design-model-based variance estimator; see Rubin-Bleuer and Schiopu-Kratina (2005) and Binder and Roberts (2009)

Utility functions

The following utility functions are available:

  • summary gives a summary of the estimation properties

  • plot shows diagnostic plots for the estimated regression model

  • robweights extracts the robustness weights (if available)

  • coef extracts the estimated regression coefficients

  • vcov extracts the (estimated) covariance matrix

  • residuals extracts the residuals

  • fitted extracts the fitted values

References

Binder, D. A. (1983). On the Variances of Asymptotically Normal Estimators from Complex Surveys. International Statistical Review 51, 279–292. doi: 10.2307/1402588

Binder, D. A. and Roberts, G. (2009). Design- and Model-Based Inference for Model Parameters. In: Sample Surveys: Inference and Analysis ed. by Pfeffermann, D. and Rao, C. R. Volume 29B of Handbook of Statistics, Amsterdam: Elsevier, Chap. 24, 33–54 doi: 10.1016/S0169-7161(09)00224-7

Rubin-Bleuer, S. and Schiopu-Kratina, I. (2005). On the Two-phase framework for joint model and design-based inference. The Annals of Statistics 33, 2789–2810. doi: 10.1214/009053605000000651

See Also

Weighted least squares: svyreg; robust weighted regression svyreg_huberM, svyreg_huberGM, svyreg_tukeyM and svyreg_tukeyGM

Examples

data(workplace)

library(survey)
# Survey design for simple random sampling without replacement
dn <- svydesign(ids = ~ID, strata = ~strat, fpc = ~fpc, weights = ~weight,
    data = workplace)

# Compute regression M-estimate with Huber psi-function
m <- svyreg_huberM(payroll ~ employment, dn, k = 8)

# utility functions
summary(m)
coef(m)
SE(m)
vcov(m)
residuals(m)
fitted(m)

robsurvey documentation built on Jan. 6, 2023, 5:09 p.m.