| Title: | Cancer RADAR Project Tool |
|---|---|
| Description: | Cancer RADAR is a project which aim is to develop an infrastructure that allows quantifying the risk of cancer by migration background across Europe. This package contains a set of functions cancer registries partners should use to reshape 5 year-age group cancer incidence data into a set of summary statistics (see Boyle & Parkin (1991, ISBN:978-92-832-1195-2)) in lines with Cancer RADAR data protections rules. |
| Authors: | Nienke Alberts [aut], Damien Georges [aut, cre] (ORCID: <https://orcid.org/0000-0003-2425-7591>), Stefano Rosso [aut], Iacopo Baussano [aut] (ORCID: <https://orcid.org/0000-0002-7322-1862>) |
| Maintainer: | Damien Georges <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 3.0.0 |
| Built: | 2026-05-17 08:33:59 UTC |
| Source: | https://github.com/cran/cancerradarr |
Age-standardized incidence rate (asir)
age_standardized_incidence_rates(ncan, py, pystd, ncan.min = 5, py.min = 0)age_standardized_incidence_rates(ncan, py, pystd, ncan.min = 5, py.min = 0)
ncan |
integer, (age-specific) number of cancers in the population of interest |
py |
integer, (age-specific) person-year in the the population of interest |
pystd |
numeric, (age-specific) standard population person-years (e.g. standard world population) |
ncan.min |
integer, minimum number of observation required not to mask the CI's out |
py.min |
integer, minimum person-years required not to mask the CI's out Age-standardized incidence rate (asir) and associated 95% confidence interval are computing assuming normal distribution of the asir. asir is a summary statistics that should be computed per group of individuals providing age specific counts. |
a 1 line and 3 column data.frame containing the asir (est) and associated 95% CI (lci, uci)
Boyle P, Parkin DM. Cancer registration: principles and methods. Statistical methods for registries. IARC Sci Publ. 1991;(95):126-58. PMID: 1894318.
ncan <- 1:10 py <- 101:110 pystd <- 10:1 ncan.min <- 5 age_standardized_incidence_rates(ncan, py, pystd, ncan.min) age_standardized_incidence_rates(ncan, py, pystd, sum(ncan) + 1)ncan <- 1:10 py <- 101:110 pystd <- 10:1 ncan.min <- 5 age_standardized_incidence_rates(ncan, py, pystd, ncan.min) age_standardized_incidence_rates(ncan, py, pystd, sum(ncan) + 1)
Compute the aggregated age group names from a vector of more detailed age groups
aggregated_ageg_name(selected.ageg, ageg.sep = "_")aggregated_ageg_name(selected.ageg, ageg.sep = "_")
selected.ageg |
character, the fine grain age group vector |
ageg.sep |
character, the ageg group separator character |
character, the name of the aggregated age group
ageg.in <- c('15_19', '20_24', '25_29') aggregated_ageg_name(ageg.in)ageg.in <- c('15_19', '20_24', '25_29') aggregated_ageg_name(ageg.in)
Generate all the possible combinations of slices in a chopped vector
chop_vector(vect.size = 3)chop_vector(vect.size = 3)
vect.size |
int, the size of the vector |
a matrix containing all the possible slices to chop a vector per line
chop_vector(3)chop_vector(3)
This is a list containing all the possible combination of slices to chop vectors of size 1 to 18. It is useful to compute custom age group aggregation to ensure we are not disclosing age group with too few cancer cases.
chopped.vector.listchopped.vector.list
A 18 item list:
each element is a matrix containing all the possible chop combinations to aggregate a vector of size n. ...
Compute summary statistics from 5 years age-group cancer registry data
create_canradar_summary_file( filename.in, filename.out, ncan.min = 5, py.min = 100, include.by.cob.stat = TRUE, verbose = TRUE )create_canradar_summary_file( filename.in, filename.out, ncan.min = 5, py.min = 100, include.by.cob.stat = TRUE, verbose = TRUE )
filename.in |
file path, the file containing the 5 years age counts of cancers stratified per cancer type, sex and country of birth |
filename.out |
file path, the file where summary .xlsx file will be save |
ncan.min |
integer, the minimum number of cancer per age group o be displayed |
py.min |
integer, the minimum number of person-years per age group to be considered during the aggregation step (default is 100) |
include.by.cob.stat |
logical, (TRUE by default) should the statistic per country-of-birth be computed and included in the output file. |
verbose |
logical, shall progress message be printed |
a .xlsx with all the summary statistics needed for Cancer RADAR project to be transmitted to project PIs.
## Update file.in with the path to the input file containing your registry data ## (e.g. file.filled <- "cancerRADAR_input.xlsx") file.in <- system.file("extdata", "ex_cancerRADAR_input_filled.xlsx", package = "cancerradarr") file.out <- 'cancerRADAR_input.xlsx' ## for cancer radar data submission, we advise to use the parameter ncan.min = 5 and ## include.by.cob.stat = TRUE create_canradar_summary_file(file.in, file.out, ncan.min = 20, include.by.cob.stat = FALSE) ## remove the file to pass package computation tests unlink(file.out)## Update file.in with the path to the input file containing your registry data ## (e.g. file.filled <- "cancerRADAR_input.xlsx") file.in <- system.file("extdata", "ex_cancerRADAR_input_filled.xlsx", package = "cancerradarr") file.out <- 'cancerRADAR_input.xlsx' ## for cancer radar data submission, we advise to use the parameter ncan.min = 5 and ## include.by.cob.stat = TRUE create_canradar_summary_file(file.in, file.out, ncan.min = 20, include.by.cob.stat = FALSE) ## remove the file to pass package computation tests unlink(file.out)
Create a template file to be filled by cancer registry partners
create_registry_input_file(filename = "cancerRADAR_input.xlsx", verbose = TRUE)create_registry_input_file(filename = "cancerRADAR_input.xlsx", verbose = TRUE)
filename |
file path, the name of the template file to be created |
verbose |
logical, shall progress message be printed |
a template .xlsx file is created on the hard drive.
file.in <- 'input_file_test.xlsx' create_registry_input_file(file.in) ## remove the file to pass package computation tests unlink(file.in)file.in <- 'input_file_test.xlsx' create_registry_input_file(file.in) ## remove the file to pass package computation tests unlink(file.in)
Create a static report from cancer RADAR output file
create_static_report(filename.out = "")create_static_report(filename.out = "")
filename.out |
file path, the path to a cancer RADAR output file This function will create a html report that could be useful to check the data that will be transmitted to IARC. |
nothing is returned, but a html file created with some summary statistics and graphs out of the file that should be transmitted with IARC
Smart aggregation of cancer cases per age group
custom_ageg_aggregation( dat, ncan.min = 5, py.min = 0, add.total = FALSE, ncan.lab = "ncan", py.lab = "py" )custom_ageg_aggregation( dat, ncan.min = 5, py.min = 0, add.total = FALSE, ncan.lab = "ncan", py.lab = "py" )
dat |
tibble, a single cancer/sex/country tibble containing cancer cases from a registry. It should contains the column ageg and ncan |
ncan.min |
integer, the minimal number of cancer in each category |
py.min |
integer, the minimal number of person-years in each category |
add.total |
logical, should the 'total' category added to the output dataset |
ncan.lab |
character, the column label where cancer cases are stored |
py.lab |
character, the column label where (optional) population at risk are stored |
aggregated dataset where all the age group contains at least ncan.min cancers cases
dat <- dplyr::tribble( ~ ageg, ~ ncan, '00_04', 0, '05_09', 0, '10_14', 0, '15_19', 0, '20_24', 1, '25_29', 2, '30_34', 4, '35_39', 5, '40_44', 1, '45_49', 10, '50_54', 14, '55_59', 1, '60_64', 2, '65_69', 2, '70_74', 5, '75_79', 1, '80_84', 0, '85', 0 ) custom_ageg_aggregation(dat, 0) custom_ageg_aggregation(dat, 5) custom_ageg_aggregation(dat, 10) custom_ageg_aggregation(dat, 100)dat <- dplyr::tribble( ~ ageg, ~ ncan, '00_04', 0, '05_09', 0, '10_14', 0, '15_19', 0, '20_24', 1, '25_29', 2, '30_34', 4, '35_39', 5, '40_44', 1, '45_49', 10, '50_54', 14, '55_59', 1, '60_64', 2, '65_69', 2, '70_74', 5, '75_79', 1, '80_84', 0, '85', 0 ) custom_ageg_aggregation(dat, 0) custom_ageg_aggregation(dat, 5) custom_ageg_aggregation(dat, 10) custom_ageg_aggregation(dat, 100)
In order to prevent loose of data in case of too low effective, several geographical aggregation can be considered. In this table are stored the different level of aggregation and the aggregation correspondence table considered.
dat.aggrdat.aggr
A data frame with 250 rows and 5 columns:
Country ISO3 code
UN region
UN subregion
HDI 2023 category
any migration background
...
A multi-columns dataset containing all the countries of birth (as ISO3 code) and other geographical aggregation rules
A multi-columns dataset containing for all the countries of birth (as ISO3 code), sex and cancer type
combinations the quartiles of cancer burden in country of origin burden. The quartiles (0%-24%,
25%-49%, 50%-74% and 75-100%) are based on the ASIR from GLOBOCAN 2022.
dat.asr.catdat.asr.cat
A data frame with 2,220 rows and 5 columns:
Country ISO3 code
targeted sex
the cancer type
GLOBOCAN 2022 age-standardized cancer incidence rate
GLOBOCAN 2022 age-standardized cancer incidence rate quartile category
...
A 2 column dataset containing all the countries of birth (with associated countries codes) included in Cancer RADAR project
dat.cobdat.cob
A data frame with 251 rows and 3 columns:
Country name
Country code
Country ISO3 code (used as unique id)
...
This function checks the input file for common data quality issues that can cause errors during processing, including duplicate age groups and unexpected age group labels.
diagnose_input_file(filename.in)diagnose_input_file(filename.in)
filename.in |
file path, the file containing the 5 years age counts of cancers stratified per cancer type, sex and country of birth |
A list containing diagnostic information:
duplicate_age_groups: Data frame of combinations with duplicate age groups
invalid_age_groups: Character vector of invalid age group labels found
summary: Overall summary of issues found
file.in <- system.file("extdata", "ex_cancerRADAR_input_filled.xlsx", package = "cancerradarr") diagnosis <- diagnose_input_file(file.in) print(diagnosis$summary)file.in <- system.file("extdata", "ex_cancerRADAR_input_filled.xlsx", package = "cancerradarr") diagnosis <- diagnose_input_file(file.in) print(diagnosis$summary)
A multi-columns dataset containing for all the European countries (UN definition) (as ISO3 code), sex and cancer type
combinations the number of cases and population at risk estimated in GLOBOCAN 2022. This data
are used in cancerradarr to compute the relative index on a standard reference population that
could be more easily compared between registries.
In addition to individual European countries, aggregated areas such as
E27 (European Union 27 countries) and EUN (all the UN European countries)
are stred in the dataset
globocan.2022.euglobocan.2022.eu
A data frame with 6,384 rows and 6 columns:
Country ISO3 code
targeted sex
targeted age group
the cancer type
number of cancer cases estimated in GLOBOCAN 2022
population at risk estimated in GLOBOCAN 2022
...
https://gco.iarc.fr/today/en
Bray F, Laversanne M, Sung H, Ferlay J, Siegel RL, Soerjomataram I, Jemal A. Global cancer statistics 2022: GLOBOCAN estimates of incidence and mortality worldwide for 36 cancers in 185 countries. CA Cancer J Clin. 2024 May-Jun;74(3):229-263. doi: 10.3322/caac.21834. Epub 2024 Apr 4. PMID: 38572751.
Compute crude incidence rates
incidence_rates(ncan, py, ncan.min = 5, py.min = 0)incidence_rates(ncan, py, ncan.min = 5, py.min = 0)
ncan |
integer, number of cancer |
py |
integer, number of person-year |
ncan.min |
integer, minimum number of observation required not to mask the CI's out |
py.min |
integer, minimum number of person-year required not to mask the CI's out Crude incidence rates and associated 95% confidence interval are computing assuming a Poisson distribution and the exact method. |
a 3 column data.frame containing the crude incidence rate estimate (est) and associated 95% CI (lci, uci)
Boyle P, Parkin DM. Cancer registration: principles and methods. Statistical methods for registries. IARC Sci Publ. 1991;(95):126-58. PMID: 1894318.
ncan <- c(1, 10, 100) py <- c(10, 100, 1000) incidence_rates(ncan, py, 5, 500)ncan <- c(1, 10, 100) py <- c(10, 100, 1000) incidence_rates(ncan, py, 5, 500)
Compute incidence rates difference
incidence_rates_difference(ncan, py, ncanref, pyref, ncan.min = 5, py.min = 0)incidence_rates_difference(ncan, py, ncanref, pyref, ncan.min = 5, py.min = 0)
ncan |
integer, number of cancers in the population of interest |
py |
integer, person-year of the the population of interest |
ncanref |
integer, number of cancers in the reference population |
pyref |
integer, person-year of the the reference population |
ncan.min |
integer, minimum number of observation required not to mask the CI's out |
py.min |
integer, minimum person-year required not to mask the CI's out Incidence rates differences and associated 95% confidence interval are computing assuming normal distribution of the differences.. |
a 3 column data.frame containing the incidence rates difference (est) and associated 95% CI (lci, uci)
ncan <- 1:10 py <- 101:110 ncanref <- 41:50 pyref <- 251:260 ncan.min <- 5 incidence_rates_difference(ncan, py, ncanref, pyref, ncan.min)ncan <- 1:10 py <- 101:110 ncanref <- 41:50 pyref <- 251:260 ncan.min <- 5 incidence_rates_difference(ncan, py, ncanref, pyref, ncan.min)
Compute incidence rates ratio
incidence_rates_ratio(ncan, py, ncanref, pyref, ncan.min = 5, py.min = 0)incidence_rates_ratio(ncan, py, ncanref, pyref, ncan.min = 5, py.min = 0)
ncan |
integer, number of cancers in the population of interest |
py |
integer, person-year of the the population of interest |
ncanref |
integer, number of cancers in the reference population |
pyref |
integer, person-year of the the reference population |
ncan.min |
integer, minimum number of observation required not to mask the CI's out |
py.min |
integer, minimum person-year required not to mask the CI's out Incidence rates ratio and associated 95% confidence interval are computing assuming normal distribution of the ratios on the log scale. |
a 3 column data.frame containing the incidence rates ratio (est) and associated 95% CI (lci, uci)
Boyle P, Parkin DM. Cancer registration: principles and methods. Statistical methods for registries. IARC Sci Publ. 1991;(95):126-58. PMID: 1894318.
ncan <- 1:10 py <- 101:110 ncanref <- 41:50 pyref <- 251:260 ncan.min <- 5 incidence_rates_ratio(ncan, py, ncanref, pyref, ncan.min)ncan <- 1:10 py <- 101:110 ncanref <- 41:50 pyref <- 251:260 ncan.min <- 5 incidence_rates_ratio(ncan, py, ncanref, pyref, ncan.min)
Compute the indirect proportional incidence ratio (pir)
indirect_proportional_incidence_ratio( ncan, ntot, ncanref, ntotref, ncan.min = 5 )indirect_proportional_incidence_ratio( ncan, ntot, ncanref, ntotref, ncan.min = 5 )
ncan |
integer, (age-specific) number of cancers in the population of interest |
ntot |
integer, (age-specific) total number of cancer the the population of interest |
ncanref |
integer, (age-specific) number of cancers in the reference population |
ntotref |
integer, (age-specific) total number of cancer the the reference of interest |
ncan.min |
integer, minimum number of observation required not to mask the CI's out Indirect proportional incidence ratio and associated 95% confidence interval are computing assuming normal distribution of the pir on the log scale. pir is a summary statistics that should be computed per group of individuals providing age specific counts. |
a 1 line and 3 column data.frame containing the pir (est) and associated 95% CI (lci, uci)
Boyle P, Parkin DM. Cancer registration: principles and methods. Statistical methods for registries. IARC Sci Publ. 1991;(95):126-58. PMID: 1894318.
ncan <- 1:10 ntot <- 11:20 ncanref <- 41:50 ntotref <- 251:260 ncan.min <- 5 indirect_proportional_incidence_ratio(ncan, ntot, ncanref, ntotref, ncan.min) indirect_proportional_incidence_ratio(ncan, ntot, ncanref, ntotref, sum(ncan) + 1)ncan <- 1:10 ntot <- 11:20 ncanref <- 41:50 ntotref <- 251:260 ncan.min <- 5 indirect_proportional_incidence_ratio(ncan, ntot, ncanref, ntotref, ncan.min) indirect_proportional_incidence_ratio(ncan, ntot, ncanref, ntotref, sum(ncan) + 1)
Compute indirect standardized incidence ratio (sir)
indirect_standardized_incidence_ratio( ncan, py, ncanref, pyref, ncan.min = 5, py.min = 0 )indirect_standardized_incidence_ratio( ncan, py, ncanref, pyref, ncan.min = 5, py.min = 0 )
ncan |
integer, (age-specific) number of cancers in the population of interest |
py |
integer, (age-specific) person-year of the the population of interest |
ncanref |
integer, (age-specific) number of cancers in the reference population |
pyref |
integer, (age-specific) person-year of the the reference population |
ncan.min |
integer, minimum number of observation required not to mask the CI's out |
py.min |
integer, minimum number of person-years required not to mask the CI's out Standardized incidence ratio (sir) and associated 95% confidence interval are computing assuming normal distribution of the pir on the log scale. sir is a summary statistics that should be computed per group of individuals providing age specific counts. |
a 1 line and 3 column data.frame containing the sir (est) and associated 95% CI (lci, uci)
Boyle P, Parkin DM. Cancer registration: principles and methods. Statistical methods for registries. IARC Sci Publ. 1991;(95):126-58. PMID: 1894318.
ncan <- 1:10 py <- 101:110 ncanref <- 41:50 pyref <- 251:260 ncan.min <- 5 indirect_standardized_incidence_ratio(ncan, py, ncanref, pyref, ncan.min) indirect_standardized_incidence_ratio(ncan, py, ncanref, pyref, sum(ncan) + 1)ncan <- 1:10 py <- 101:110 ncanref <- 41:50 pyref <- 251:260 ncan.min <- 5 indirect_standardized_incidence_ratio(ncan, py, ncanref, pyref, ncan.min) indirect_standardized_incidence_ratio(ncan, py, ncanref, pyref, sum(ncan) + 1)
Calling this function will open the dictionary describing sheets and variables stored in the cancer
summary file (output file generated by create_canradar_summary_file function). It
could be useful for the cancer registries to check what kind of data they will be sharing.
Note that a temporary copy of the dictionary is created on your hard drive to prevent from
unwanted file modification.
open_canradar_dictionary()open_canradar_dictionary()
the path to a temporary file where cancer RADAR dictionary is stored
## Not run: open_canradar_dictionary() ## End(Not run)## Not run: open_canradar_dictionary() ## End(Not run)
Compute proportional rates
proportional_rates(ncan, ntot, ncan.min = 5)proportional_rates(ncan, ntot, ncan.min = 5)
ncan |
integer, number of cancer of interest |
ntot |
integer, overall number of cancer |
ncan.min |
integer, minimum number of observation required not to mask the CI's out Proportional incidence rates and associated 95% confidence interval are computing assuming a Binomial distribution and the Clopper and Pearson (1934) procedure. |
a 3 column data.frame containing the proportional incidence rate estimate (est) and associated 95% CI (lci, uci)
C. J. CLOPPER, B.Sc., E. S. PEARSON, D.Sc., THE USE OF CONFIDENCE OR FIDUCIAL LIMITS ILLUSTRATED IN THE CASE OF THE BINOMIAL, Biometrika, Volume 26, Issue 4, December 1934, Pages 404–413, https://doi.org/10.1093/biomet/26.4.404
Boyle P, Parkin DM. Cancer registration: principles and methods. Statistical methods for registries. IARC Sci Publ. 1991;(95):126-58. PMID: 1894318.
ncan <- c(1, 10, 100) ntot <- c(10, 100, 1000) proportional_rates(ncan, ntot, 5)ncan <- c(1, 10, 100) ntot <- c(10, 100, 1000) proportional_rates(ncan, ntot, 5)
Read cancer registry summary statistics (non age-specific)
read_cancerradar_output_01(filename.out, aggr.level = "cob_iso3")read_cancerradar_output_01(filename.out, aggr.level = "cob_iso3")
filename.out |
file path, the path to a cancer RADAR output file |
aggr.level |
character, the aggregation level to be considered. Should be one of |
a tibble with 9 columns
reg_label: factor, the chosen aggregation level id
sex: character, male/female
ageg: character, age group (here total)
can: character, the cancer type
ref: character, the reference population for relative index
index: character, the type of index
est: dbl, the index estimator
lci: dbl, the index confidence interval lower bound
uci: dbl, the index confidence interval upper bound
filename.out <- system.file('extdata/ex_cancerRADAR_output.xlsx', package = "cancerradarr") dat.out <- read_cancerradar_output_01(filename.out, 'un_region') head(dat.out)filename.out <- system.file('extdata/ex_cancerRADAR_output.xlsx', package = "cancerradarr") dat.out <- read_cancerradar_output_01(filename.out, 'un_region') head(dat.out)
Read cancer registry summary statistics (age-specific incidence rate and proportional rates)
read_cancerradar_output_02(filename.out, aggr.level = "cob_iso3")read_cancerradar_output_02(filename.out, aggr.level = "cob_iso3")
filename.out |
file path, the path to a cancer RADAR output file |
aggr.level |
character, the aggregation level to be considered. Should be one of |
a tibble with 11 columns
reg_label: factor, the chosen aggregation level id
sex: character, male/female
ageg: character, age group (here total)
can: character, the cancer type
index: character, the type of index
est: dbl, the index estimator
lci: dbl, the index confidence interval lower bound
uci: dbl, the index confidence interval upper bound
ageg_sta: dbl, the age group starting age
ageg_sto: dbl, the age group stopping age
ageg_mid: dbl, the age group middle age
filename.out <- system.file('extdata/ex_cancerRADAR_output.xlsx', package = "cancerradarr") dat.out <- read_cancerradar_output_02(filename.out, 'un_region') head(dat.out)filename.out <- system.file('extdata/ex_cancerRADAR_output.xlsx', package = "cancerradarr") dat.out <- read_cancerradar_output_02(filename.out, 'un_region') head(dat.out)
Read cancer registry summary statistics (age-specific number of cancer cases)
read_cancerradar_output_03(filename.out, aggr.level = "cob_iso3")read_cancerradar_output_03(filename.out, aggr.level = "cob_iso3")
filename.out |
file path, the path to a cancer RADAR output file |
aggr.level |
character, the aggregation level to be considered. Should be one of |
a tibble with 10 columns
reg_label: factor, the chosen aggregation level id
sex: character, male/female
ageg: character, age group (here total)
can: character, the cancer type
index: character, the type of index
ncan: dbl, the number of cancer
py: dbl, the population size (if available)
ageg_sta: dbl, the age group starting age
ageg_sto: dbl, the age group stopping age
ageg_mid: dbl, the age group middle age
filename.out <- system.file('extdata/ex_cancerRADAR_output.xlsx', package = "cancerradarr") dat.out <- read_cancerradar_output_03(filename.out, 'any_migr') head(dat.out)filename.out <- system.file('extdata/ex_cancerRADAR_output.xlsx', package = "cancerradarr") dat.out <- read_cancerradar_output_03(filename.out, 'any_migr') head(dat.out)
Create a dynamic report from cancer RADAR output file
run_dynamic_report(filename.out = "")run_dynamic_report(filename.out = "")
filename.out |
file path, the path to a cancer RADAR output file This function will open a shiny app where cancer registries can visually check the data they will be transmitted to IARC. |
nothing is returned
Age-standardized incidence rates differences (asird)
standardized_incidence_rate_difference( ncan, py, ncanref, pyref, pystd, ncan.min = 5, py.min = 0 )standardized_incidence_rate_difference( ncan, py, ncanref, pyref, pystd, ncan.min = 5, py.min = 0 )
ncan |
integer, (age-specific) number of cancers in the population of interest |
py |
integer, (age-specific) person-year in the the population of interest |
ncanref |
integer, (age-specific) number of cancers in the reference population |
pyref |
integer, (age-specific) person-year in the the reference population |
pystd |
numeric, (age-specific) standard population person-years (e.g. standard world population) |
ncan.min |
integer, minimum number of observation required not to mask the CI's out |
py.min |
integer, minimum number of person-years required not to mask the CI's out Age-standardized incidence rate difference (asird) is computed without confidence interval estimation for now. asird is a summary statistics that should be computed per group of individuals providing age specific counts. |
a 1 line and 3 column data.frame containing the pir (est) and associated 95% CI (lci, uci)
https://www.hsph.harvard.edu/thegeocodingproject/analytic-methods/
ncan <- 1:10 py <- 101:110 ncanref <- 41:50 pyref <- 251:260 pystd <- 10:1 ncan.min <- 5 standardized_incidence_rate_difference(ncan, py, ncanref, pyref, pystd, ncan.min) standardized_incidence_rate_difference(ncan, py, ncanref, pyref, pystd, sum(ncan) + 1)ncan <- 1:10 py <- 101:110 ncanref <- 41:50 pyref <- 251:260 pystd <- 10:1 ncan.min <- 5 standardized_incidence_rate_difference(ncan, py, ncanref, pyref, pystd, ncan.min) standardized_incidence_rate_difference(ncan, py, ncanref, pyref, pystd, sum(ncan) + 1)
Age-standardized incidence rates ratio (asirr)
standardized_incidence_rate_ratio( ncan, py, ncanref, pyref, pystd, ncan.min = 5, py.min = 0 )standardized_incidence_rate_ratio( ncan, py, ncanref, pyref, pystd, ncan.min = 5, py.min = 0 )
ncan |
integer, (age-specific) number of cancers in the population of interest |
py |
integer, (age-specific) person-year in the the population of interest |
ncanref |
integer, (age-specific) number of cancers in the reference population |
pyref |
integer, (age-specific) person-year in the the reference population |
pystd |
numeric, (age-specific) standard population person-years (e.g. standard world population) |
ncan.min |
integer, minimum number of observation required not to mask the CI's out |
py.min |
integer, minimum person-year required not to mask the CI's out Age-standardized incidence rate ratio (asirr) and associated 95% confidence interval are computing Armitage and Berry (1987) formula. asird is a summary statistics that should be computed per group of individuals providing age specific counts. |
a 1 line and 3 column data.frame containing the pir (est) and associated 95% CI (lci, uci)
Boyle P, Parkin DM. Cancer registration: principles and methods. Statistical methods for registries. IARC Sci Publ. 1991;(95):126-58. PMID: 1894318.
ncan <- 1:10 py <- 101:110 ncanref <- 41:50 pyref <- 251:260 pystd <- 10:1 ncan.min <- 5 standardized_incidence_rate_ratio(ncan, py, ncanref, pyref, pystd, ncan.min) standardized_incidence_rate_ratio(ncan, py, ncanref, pyref, pystd, sum(ncan) + 1)ncan <- 1:10 py <- 101:110 ncanref <- 41:50 pyref <- 251:260 pystd <- 10:1 ncan.min <- 5 standardized_incidence_rate_ratio(ncan, py, ncanref, pyref, pystd, ncan.min) standardized_incidence_rate_ratio(ncan, py, ncanref, pyref, pystd, sum(ncan) + 1)
Checks that age group labels in a dataset match expected formats.
validate_age_groups(dat)validate_age_groups(dat)
dat |
A data frame containing an |
Expected age group labels are:
Five-year age bands: '00_04', '05_09', ..., '80_84'
Open-ended group: '85'
Special categories: 'total', 'DCO', 'MV'
NULL (invisibly). The function is called for its side effect of stopping execution if invalid age groups are found.
dat <- data.frame(ageg = c("00_04", "05_09", "10_14")) validate_age_groups(dat)dat <- data.frame(ageg = c("00_04", "05_09", "10_14")) validate_age_groups(dat)