svyreg_tukey | R Documentation |
svyreg_tukeyM
and svyreg_tukeyGM
compute, respectively,
a survey weighted M- and GM-estimator of regression using
the biweight Tukey psi-function. Use svyreg_tukeyM
not
svyreg_tukey
because the latter is deprecated but is kept for
compatibility reasons.
svyreg_tukeyM(formula, design, k, var = NULL, na.rm = FALSE, verbose = TRUE, ...) svyreg_tukeyGM(formula, design, k, type = c("Mallows", "Schweppe"), xwgt, var = NULL, na.rm = FALSE, verbose = TRUE, ...) # deprecated svyreg_tukey(formula, design, k, var = NULL, na.rm = FALSE, verbose = TRUE, ...)
formula |
a |
design |
an object of class |
k |
|
var |
a one-sided |
na.rm |
|
verbose |
|
... |
additional arguments passed to the method (e.g., |
type |
|
xwgt |
|
Package survey must be loaded in order to use the functions.
svyreg_tukeyM
and svyreg_tukeyGM
compute, respectively,
M- and GM-estimates of regression by iteratively re-weighted least
squares (IRWLS). The estimate of regression scale is (by default)
computed as the (normalized) weighted median of absolute deviations
from the weighted median (MAD; see weighted_mad
) for
each IRWLS iteration. If the weighted MAD is zero (or nearly so),
the scale is computed as the (normalized) weighted
interquartile range (IQR).
The regression M-estimator svyreg_tukeyM
is robust against
residual outliers (granted that the tuning constant k
is
chosen appropriately).
Function svyreg_huberGM
implements the Mallows and Schweppe
regression GM-estimator (see argument type
).
The regression GM-estimators are robust against residual outliers
and outliers in the model's design space (leverage
observations; see argument xwgt
).
See svyreg_control
.
Models for svyreg_rob
are specified symbolically. A typical
model has the form response ~ terms
, where response
is the (numeric) response vector and terms
is a series of
terms which specifies a linear predictor for response
; see
formula
and lm
.
A formula has an implied intercept term. To remove this use
either y ~ x - 1
or y ~ 0 + x
; see
formula
for more details of allowed formulae.
Object of class svyreg.rob
By default, the method assumes a maximum number of maxit = 100
iterations and a numerical tolerance criterion to stop the iterations of
tol = 1e-05
. If the algorithm fails to converge, you may
consider changing the default values; see svyreg_control
.
Overview (of all implemented functions)
summary
, coef
,
residuals
, fitted
,
SE
and vcov
plot
for regression diagnostic plot methods.
Other robust estimating methods svyreg_huberM
and
svyreg_huberGM
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 Tukey bisquare psi-function m <- svyreg_tukeyM(payroll ~ employment, dn, k = 8) # Regression inference summary(m) # Extract the coefficients coef(m) # Extract variance/ covariance matrix vcov(m)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.