compare_nordcan_statistics_table_lists: Compare NORDCAN Statistics

View source: R/compare_statistics_tables.R

compare_nordcan_statistics_table_listsR Documentation

Compare NORDCAN Statistics

Description

Compare statistics between two versions of NORDCAN.

Usage

compare_nordcan_statistics_table_lists(
  current_stat_table_list,
  old_stat_table_list
)

plot_nordcan_statistics_table_comparisons(x)

Arguments

current_stat_table_list

⁠[list]⁠ (mandatory, no default)

list of statistics tables; current version; intended for the output of nordcan_statistics_tables

old_stat_table_list

⁠[list]⁠ (mandatory, no default)

list of statistics tables; current version; intended for the output of nordcan_statistics_tables from a previous run

x

⁠[list]⁠ (mandatory, no default)

the output of compare_nordcan_statistics_table_lists

Details

Any comparisons have been defined on the basis of the name of the table, i.e. cancer_record_count_dataset can have a different set of comparisons than survival_statistics_dataset.

All comparisons between two statistics from the current and old version are done by subtracting the old statistic from the new. All p-values are estimated for these differences.

Comparisons are only performed on statistics in strata which exist in both the old and current versions. E.g. if the old version contains counts up to 2018 and the current one up to 2019, no comparisons are done on 2019 counts.

plot_nordcan_statistics_table_comparisons produces .png files into dir nordcancore::get_global_nordcan_settings()[["work_dir"]]. Each file is a grid of entity-specific plots. One .png corresponds to one dataset taken from x$comparisons. Only the following datasets are plotted:

  • cancer_record_count_dataset: column sex is summed out before plotting.

  • cancer_death_count_dataset: column sex is summed out before plotting.

  • prevalent_patient_count_dataset column sex is summed out before plotting, and only ⁠full_years_since == "0 - 999⁠ data is used.

Value

A list with elements

  • summary: a data.table that summarizes every comparison performed, where the summaries are stratified by table name and statistic column name

  • comparisons: a list of data.tables, where one row in a data.table corresponds to one comparison between an old and a new statistic.

Functions

  • plot_nordcan_statistics_table_comparisons(): plots time series of comparison results (compare_nordcan_statistics_table_lists output); see Details


CancerRegistryOfNorway/nordcanepistats documentation built on June 3, 2024, 5:41 p.m.