smr_custom {LTASR} | R Documentation |
Calculate SMRs for Custom minor groupings
Description
smr_major
will collapse minor outcomes into "major" groupings as defined in the
rate object, rateobj
.
Usage
smr_custom(smr_minor_table, minor_grouping)
Arguments
smr_minor_table |
A data.frame/tibble as created by |
minor_grouping |
A numeric vector defining which minors to group together |
Value
A data.frame/tibble containing the expected and observed number of deaths as well the SMR, lower CI and upper CI for the outcome by the user
Examples
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_table <- smr_minor(py_table, rateobj)
#Calculate custom minor grouping for all deaths
smr_custom(smr_minor_table, 1:119)
#' #Calculate custom minor grouping for all deaths
smr_custom(smr_minor_table, 4:40)
[Package LTASR version 0.1.3 Index]