Description Usage Arguments Details Value Examples
View source: R/archived/tabmedians_svy-2020-03-28.R View source: R/tabmedians_svy.R
Creates a table comparing the median of y
across levels of x
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
formula |
Formula, e.g. |
design |
Survey design object from |
columns |
Character vector specifying what columns to include. Choices
for each element are |
parenth |
Character string specifying what values are shown in
parentheses after the medians in each cell. Choices are |
sep.char |
Character string with separator to place between lower and
upper bound of confidence intervals. Typically |
xlevels |
Character vector with labels for the levels of |
yname |
Character string with a label for the |
text.label |
Character string with text to put after the |
decimals |
Numeric value specifying number of decimal places for numbers other than p-values. |
svyranktest.list |
List of arguments to pass to
|
formatp.list |
List of arguments to pass to |
n.headings |
Logical value for whether to display group sample sizes in parentheses in column headings. |
N.headings |
Logical value for whether to display weighted sample sizes in parentheses in column headings. |
kable |
Logical value for whether to return a
|
Basically tabmedians
for complex survey data. Relies heavily on
the survey package.
kable
or character matrix.
1 2 3 4 5 6 7 8 9 10 11 12 | # Create survey design object
library("survey")
design <- svydesign(
data = tabsvydata,
ids = ~sdmvpsu,
strata = ~sdmvstra,
weights = ~wtmec2yr,
nest = TRUE
)
# Compare median BMI by sex
(medtable1 <- tabmedians.svy(BMI ~ Sex, design = design))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.