smr_minor {LTASR} | R Documentation |
smr_minor
calculates SMRs for all minor groupings found within the rate
object, rateobj
, for the stratified cohort py_table
smr_minor(py_table, rateobj)
py_table |
A stratified cohort created by |
rateobj |
A rate object created by |
A dataframe/tibble containing the expected and observed number of deaths
as well as SMRs, lower CI and upper CI for each minor found in the rate object
rateobj
library(LTASR)
library(dplyr)
#Import example person file
person <- person_example %>%
mutate(dob = as.Date(dob, format='%m/%d/%Y'),
pybegin = as.Date(pybegin, format='%m/%d/%Y'),
dlo = as.Date(dlo, format='%m/%d/%Y'))
#Import default rate object
rateobj <- us_119ucod_19602021
#Stratify person table
py_table <- get_table(person, rateobj)
#Calculate SMRs for all minors
smr_minor(py_table, rateobj)