Description Usage Arguments Details Value Examples
View source: R/archived/tabmulti_svy-2020-03-28.R View source: R/tabmulti_svy.R
Creates a table comparing multiple characteristics (e.g. median age, mean
BMI, and race/ethnicity distribution) across levels of x
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | tabmulti.svy(
formula = NULL,
design,
xvarname = NULL,
yvarnames = NULL,
ymeasures = NULL,
columns = c("xgroups", "p"),
listwise.deletion = FALSE,
sep.char = ", ",
xlevels = NULL,
yvarlabels = NULL,
ylevels = NULL,
decimals = NULL,
formatp.list = NULL,
n.headings = FALSE,
N.headings = FALSE,
kable = TRUE,
tabmeans.svy.list = NULL,
tabmedians.svy.list = NULL,
tabfreq.svy.list = NULL
)
|
formula |
Formula, e.g. |
design |
Survey design object from |
xvarname |
Character string with name of column variable. Should be one
of |
yvarnames |
Character vector with names of row variables. Each element
should be one of |
ymeasures |
Character vector specifying whether each |
columns |
Character vector specifying what columns to include. Choices
for each element are |
listwise.deletion |
Logical value for whether observations with missing
values for any |
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 |
yvarlabels |
Named list specifying labels for certain |
ylevels |
Character vector (if only 1 frequency comparison) or list of
character vectors with labels for the levels of each categorical |
decimals |
Numeric vector specifying number of decimal places for
numbers other than p-values for each |
formatp.list |
List of arguments to pass to |
n.headings |
Logical value for whether to display unweighted 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
|
tabmeans.svy.list |
List of arguments to pass to
|
tabmedians.svy.list |
List of arguments to pass to
|
tabfreq.svy.list |
List of arguments to pass to
|
Basically tabmulti
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 age, race, and BMI by sex
tabmulti.svy(Age + Race + BMI ~ Sex, design)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.