Skip to contents

se_total_prop is a wrapper function for se_total() and se_prop() which estimates totals and proportions for categorical variables.

Usage

se_total_prop(data, ..., strata, weight, alpha = 0.05)

Arguments

data

A data frame or tibble.

...

Optional grouping variables (unquoted).

strata

The name of the strata variable (default is "zone").

weight

The name of the weight variable.

alpha

Significance level for confidence intervals. Default is 0.05.

Value

A tibble with joined total and proportion estimates.

See also

Examples

se_total_prop(
  data = nhanes,
  interview_lang,
  gender,
  birth_country,
  strata = strata,
  weight = weights
)
#> # A tibble: 10 × 12
#>    interview_lang gender birth_country   occ      total ci_total ci_l_total
#>    <chr>          <chr>  <chr>         <int>      <dbl>    <dbl>      <dbl>
#>  1 English        Female Missing           1     17984.   35248.    -17263.
#>  2 English        Female Other           704  16271319. 1439977.  14831343.
#>  3 English        Female US             3640 134617433. 5472957. 129144476.
#>  4 English        Male   Other           664  15571104. 1538821.  14032283.
#>  5 English        Male   US             3575 127077535. 5433656. 121643879.
#>  6 Spanish        Female Missing           1     11709.   22949.    -11240.
#>  7 Spanish        Female Other           464   7643212.  740228.   6902984.
#>  8 Spanish        Female US              269   3360788.  415220.   2945569.
#>  9 Spanish        Male   Other           404   8326198.  889838.   7436360.
#> 10 Spanish        Male   US              249   3583761.  469708.   3114053.
#> # ℹ 5 more variables: ci_u_total <dbl>, prop <dbl>, ci_prop <dbl>,
#> #   ci_l_prop <dbl>, ci_u_prop <dbl>