Reassessment Data

leap.data_generation.reassessment_data module

leap.data_generation.reassessment_data.get_asthma_df(starting_year: int = 1999, max_year: int = 2065, min_age: int = 3, max_age: int = 110, max_asthma_age: int = 62, stabilization_year: int = 2025) pandas.core.frame.DataFrame[source]

Loads the asthma prevalence / incidence predictions from Model 1.

Parameters:
starting_year: int = 1999

The starting year for the dataframe.

max_year: int = 2065

The ending year for the dataframe.

min_age: int = 3

The minimum age for asthma prediction.

max_age: int = 110

The maximum age for asthma prediction.

max_asthma_age: int = 62

The maximum age for for which the asthma prevalence / incidence model can accurately make predictions.

stabilization_year: int = 2025

The year when asthma stabilization occurs.

Returns:

A DataFrame containing asthma occurrence predictions. Columns:

  • age (int): age in years, range [min_age, max_age].

  • sex (str): one of "M" or "F".

  • year (int): calendar year, range [starting_year, max_year].

  • incidence (float): predicted asthma incidence for the given age, sex, and year.

  • prevalence (float): predicted asthma prevalence for the given age, sex, and year.

leap.data_generation.reassessment_data.calculate_reassessment_probability(prevalence_past: float, prevalence_current: float, incidence_current: float) float[source]

Calculates the reassessment probability based on asthma prevalence and incidence.

Parameters:
prevalence_past: float

The prevalence of asthma from the previous year.

prevalence_current: float

The prevalence of asthma in the current year.

incidence_current: float

The incidence of asthma in the current year.

Returns:

The probability that someone diagnosed with asthma will maintain their diagnosis in the current year.

leap.data_generation.reassessment_data.get_reassessment_data(df_asthma: pandas.core.frame.DataFrame, province: str = 'CA', starting_year: int = 1999, max_year: int = 2065, max_age: int = 110) pandas.core.frame.DataFrame[source]

Generates reassessment data for asthma prevalence and incidence.

Parameters:
df_asthma: pandas.core.frame.DataFrame

A dataframe containing asthma prevalence and incidence predictions from Occurrence Model 1. The dataframe should have the following columns:

  • age (int): age in years, range [3, max_age].

  • sex (str): one of "M" or "F".

  • year (int): calendar year, range [starting_year, max_year].

  • incidence (float): predicted asthma incidence for the given age, sex, and year.

  • prevalence (float): predicted asthma prevalence for the given age, sex, and year.

province: str = 'CA'

The 2-letter province code, e.g. "CA".

starting_year: int = 1999

The starting year for the data.

max_year: int = 2065

The ending year for the data.

max_age: int = 110

The maximum age for asthma prediction.

Returns:

A DataFrame containing the reassessment data. Columns:

  • year (int): calendar year, range [starting_year + 1, max_year].

  • province (str): the 2-letter province code, e.g. "CA".

  • age (int): age in years, range [4, max_age].

  • sex (str): one of "M" or "F".

  • prob (float): the probability that someone diagnosed with asthma will maintain their asthma diagnosis in the given year. Range: [0, 1].

leap.data_generation.reassessment_data.generate_reassessment_data()[source]

Generate reassessment data for asthma prevalence and incidence across different provinces.