output_table: Print mean, SE, and CI nicely from survey functions

Description Usage Arguments Value Examples

View source: R/survey_functions.R

Description

Takes a survey object and prints out the results in a nicer format for a report.

Usage

1
output_table(t, dig = 0)

Arguments

t

A survey object from a svytotal, svymean, or svyby function

dig

The number of digits to the right of the decimal (using formatC)

Value

Returns a dataframe with character-formatted results summarizing the mean, standard error, and confidence interval

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
# nested syntax of base R:
out_tab(
   svytotal(~ variable_of_interest, survey_design_object, na.rm = TRUE)
)

# can be used with magrittr syntax as well
svytotal(~ variable_of_interest, survey_design_object, na.rm = TRUE) %>%
   out_tab

## End(Not run)

outcomesinsights/nhanes.tools documentation built on May 24, 2019, 5:54 p.m.