Skip to contents

Overall rate

Usage

total_rate(pop, per = getOption("surveytable.rate_per"))

Arguments

pop

population

per

calculate rate per this many items in the population

Value

A table

See also

Other tables: tab(), tab_cross(), tab_rate(), tab_subset_rate(), total()

Examples

set_survey(namcs2019sv)
#>                         Survey info {NAMCS 2019 PUF}                         
#> ┌───────────┬──────────────┬────────────────────────────────────────────────┐
#> │ Variables │ Observations │ Design                                         │
#> ├───────────┼──────────────┼────────────────────────────────────────────────┤
#> │        33 │        8,250 │ Stratified 1 - level Cluster Sampling design   │
#> │           │              │ (with replacement)                             │
#> │           │              │ With (398) clusters.                           │
#> │           │              │ namcs2019sv = survey::svydesign(ids = ~CPSUM,  │
#> │           │              │ strata = ~CSTRATM, weights = ~PATWT            │
#> │           │              │ , data = namcs2019sv_df)                       │
#> └───────────┴──────────────┴────────────────────────────────────────────────┘
#> 
total_rate(uspop_example$total)
#>                 Total (rate per 100 population) {NAMCS 2019 PUF}                 
#> ┌───────────────┬───────────────┬───────────────┬───────────────┬───────────────┐
#> │             n │          Rate │            SE │            LL │            UL │
#> ├───────────────┼───────────────┼───────────────┼───────────────┼───────────────┤
#> │         8,250 │         320.7 │          15.1 │         292.4 │         351.7 │
#> └───────────────┴───────────────┴───────────────┴───────────────┴───────────────┘
#>   N = 8250. Checked NCHS presentation standards. Nothing to report.              
#>