Calculate Age-Standardized Rate (ASR)
create_asr.Rd
This function calculates age-standardized rates (ASRs) using PBCR data. It supports stratification by multiple variables, allows the specification of different standard population structures, and provides flexibility in the inclusion of variance, confidence intervals, and population data.
Usage
create_asr(
x,
...,
event = fbs,
std = c("cn2000", "wld85"),
cancer_type = "big",
mp = 1e+05,
decimal = 2,
show_var = FALSE,
show_ci = FALSE
)
# S3 method for class 'canregs'
create_asr(x, ..., cancer_type = "big")
# S3 method for class 'canreg'
create_asr(x, ..., cancer_type = "big")
# S3 method for class 'fbswicds'
create_asr(
x,
...,
event = fbs,
std = c("cn2000", "wld85"),
mp = 1e+05,
decimal = 6,
show_pop = FALSE,
show_var = FALSE,
show_ci = FALSE
)
# S3 method for class 'fbswicd'
create_asr(
x,
...,
event = fbs,
std = c("cn2000", "wld85"),
mp = 1e+05,
decimal = 6,
show_pop = FALSE,
show_var = FALSE,
show_ci = FALSE
)
Arguments
- x
The input data, object with class of
'fbswicd'
,'fbswicds'
,'canreg'
, or'canregs'
.- ...
One or more variables used for stratification. For example, you can stratify by
sex
,year
,cancer
, or just byyear
. If sex is not passed as a parameter, the output will be the result for the combined gender.- event
A variable used to specify the type of calculation, options are fbs or sws, fbs for cancer incidence, and sws for cancer mortality.
- std
Specify the standard population structure in the 'std_pop' data frame used for calculating standardized rates. When calculating standardized rates for multiple standard populations, specify std = c(segi, china).
- cancer_type
A character string specifying the classification method used to categorize ICD-10 codes. This determines how ICD-10 codes are classified. Options include
"big"
(classify ICD-10 codes into 26 cancer categories),"small"
(classify ICD-10 codes into 59 cancer categories, more specific categories),"system"
(classify ICD-10 codes into organ system), and"gco"
(classify ICD-10 code into cancer categories same as classification published by the Global Cancer Observatory). This parameter is only available when the input data is a vector of ICD-10 codes, or object with class of'canreg'
or'canregs'
.- mp
A constant to multiply rates by (e.g. mp=1000 for rates per 1000).
- decimal
This parameter specifies the number of decimal places to round the results. The default is 2, which means rates will be rounded to two decimal places.
- show_var
Logical value whether output variance or not.
- show_ci
Logical value whether output confidence(lower or upper bound) or not.
- show_pop
Logical value whether output population or not.