CancerRegistryOfNorway / nordcansurvival

Other
0 stars 0 forks source link

Global settings for last year of survival #33

Closed CotterpinDoozer closed 3 years ago

CotterpinDoozer commented 3 years ago

To be able to move the survival window one year further, all countries delivering NORDCAN-statistics must have that year included. For instance: for last year of survival to be 2019, all countries need to have 2019 for incidence. If one country still only has 2018, the survival can only be until 2018.

At present time, this is hardcoded into the ado-file. It might be better to include this in the global settings, so that all countries set this manually based on what we agree upon in the NORDCAN-group than having to change the modules every time. This also makes the modules more usable for other users who might not have come as far in the cancer registration as the Nordic countries.

To be discussed how to best to this.

BjarteAAGNES commented 3 years ago

Will respond with details before 12.00 today.

BjarteAAGNES commented 3 years ago

Just saw this was for the Autumn 2021 release I wonder: if Huidong is making changes to the global settings anyway and this change should be be easy to make - maybe it should also be done together with the other global settings changes?

CotterpinDoozer commented 3 years ago

We can move it to spring as plan A and then postpone to autumn if we see that it takes a lot of work.

BjarteAAGNES commented 3 years ago

Then:

let the user define:

last_year_of_incidence last_year_of_mortality last_year_of_survival

last_year_of_survival <= last_year_of_incidence period_5 defined from last_year_of_survival
early validation of matching life table if possibly (outside survival module)

Bjarte will modify the Stata ado to reflect the changes above

HuidongTian commented 3 years ago

This is the current setting of the global nordcan setting:

nordcancore::set_global_nordcan_settings(
  work_dir = getwd(),
  participant_name = "Finland",
  stat_cancer_record_count_first_year = 1953L,
  stat_cancer_death_count_first_year = 1953L,
  regional_data_first_year = 1953L,
  last_year = 2019L
)

Discussed with Bjarte, we are going to have the new setting as:

nordcancore::set_global_nordcan_settings(
  work_dir = getwd(),
  participant_name = "Norway",
  first_year_incidence = 1953L,
  first_year_mortality = 1953L,
  last_year_incidence = 2019L,
  last_year_mortality = 2019L,
  last_year_survival = 2018L,
  first_year_region = 1953L
)
BjarteAAGNES commented 3 years ago

is "first_year_survival" then calculated backwards from last_year_survival ? what is start year for survival? 1969 as before and where is it defined?

(Here there is a detail for BJARTE to consider: when defining first cancer for a patient within a group to be analysed this operation is now done in the extract define function - if a start year is given restricting data for this function a "selection" problem grows when a later start date is defined) thus startyear 1969 as used now have a slight problem for the first period restricting start to 1999 will make a much larger problem...if the definition of first cancer within group is not defined before restricting data to cases from 1999.)

HuidongTian commented 3 years ago

global_settings_env[["stat_survival_follow_up_first_year"]] <- last_year - 49L

metadata, line 234

BjarteAAGNES commented 3 years ago

Thanks. This should probably be changed now to

global_settings_env[["stat_survival_follow_up_first_year"]] <- last_year_survival - 49L

HuidongTian commented 3 years ago

Yes. And further, like: global_settings_env[["first_year_survival"]] <- last_year_survival - 49L

BjarteAAGNES commented 3 years ago

Is _first_yearsurvival used for anything? Due to the technical comment on "selection" above I do not want the user to set or change the start year for survival, thus no first_year_survival. At least not for the April version. If it is needed internally for some reason it should not be exposed to the user.

HuidongTian commented 3 years ago

It is not exposed to the user. It is stored in the global setting and was retrieved in function: nordcanstat_survival, line 41.

BjarteAAGNES commented 3 years ago

Thanks. Will first_year_survival replace the name used in nordcanstat_survival, line 42: first_year <- gs[["stat_survival_follow_up_first_year"]]

or do we have several gs variables with names starting with stat_ for some good reason?

HuidongTian commented 3 years ago

All year related arguments were changed to first_year_survival, last_year_survival style. "stat_.*" style arguments were not used in future.

BjarteAAGNES commented 3 years ago

pushed a fix to the hard coded last year in Stata ado extract_* to gitlab

last year is now calculated from the given variable period_5

BjarteAAGNES commented 3 years ago

life table file including 2019 copied into ../data/.. for used in dev/testing

BjarteAAGNES commented 3 years ago

After testing: also update documentation including any end user documentation/instructions, This could be made a separate issue/task.