survey_median | R Documentation |
weighted_se()
computes weighted standard errors of a variable or for
all variables of a data frame. survey_median()
computes the median for
a variable in a survey-design (see [survey::svydesign()]
).
weighted_correlation()
computes a weighted correlation for a two-sided
alternative hypothesis.
survey_median(x, design)
weighted_correlation(data, ...)
## Default S3 method:
weighted_correlation(data, x, y, weights, ci.lvl = 0.95, ...)
## S3 method for class 'formula'
weighted_correlation(formula, data, ci.lvl = 0.95, ...)
weighted_se(x, weights = NULL)
x |
(Numeric) vector or a data frame. For |
design |
An object of class |
data |
A data frame. |
... |
Currently not used. |
y |
Optional, bare (unquoted) variable name, or a character vector with the variable name. |
weights |
Bare (unquoted) variable name, or a character vector with
the variable name of the numeric vector of weights. If |
ci.lvl |
Confidence level of the interval. |
formula |
A formula of the form |
The weighted (test) statistic.
data(efc)
weighted_se(efc$c12hour, abs(runif(n = nrow(efc))))
# survey_median ----
# median for variables from weighted survey designs
data(nhanes_sample)
des <- survey::svydesign(
id = ~SDMVPSU,
strat = ~SDMVSTRA,
weights = ~WTINT2YR,
nest = TRUE,
data = nhanes_sample
)
survey_median(total, des)
survey_median("total", des)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.