View source: R/svyratio_huber.R
svyratio_huber | R Documentation |
svyratio_huber
and svyratio_tukey
compute the robust
M-estimator of the ratio of two variables with, respectively,
Huber and Tukey biweight (bisquare) psi-function.
svyratio_huber(numerator, denominator, design, k, var = denominator, na.rm = FALSE, asym = FALSE, verbose = TRUE, ...) svyratio_tukey(numerator, denominator, design, k, var = denominator, na.rm = FALSE, verbose = TRUE, ...)
numerator |
a one-sided |
denominator |
a one-sided |
design |
an object of class |
k |
|
var |
a |
na.rm |
|
asym |
|
verbose |
|
... |
additional arguments passed to the method (e.g., |
Package survey must be loaded in order to use the functions.
The functions svyratio_huber
and svyratio_tukey
are
implemented as wrapper functions of the regression estimators
svyreg_huberM
and svyreg_tukeyM
. See
the help files of these functions (e.g., on how additional
parameters can be passed via ...
or on the usage of the
var
argument).
Object of class svyreg.rob
and ratio
Overview (of all implemented functions)
summary
, coef
,
residuals
, fitted
,
SE
and vcov
plot
for regression diagnostic plot methods
svyreg_huberM
, svyreg_huberGM
,
svyreg_tukeyM
and svyreg_tukeyGM
for robust
regression estimators
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 <- svyratio_huber(~payroll, ~employment, dn, k = 8) # Regression inference summary(m) # Extract the coefficients coef(m) # Extract estimated standard error SE(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.