-
differences.ATTgt.filter_gt(base_period: 'varying' | 'universal', feasible: bool =
False, *, relative_period: int | list[int] =None, relative_period_start: int =None, relative_period_end: int =None, cohort: int | list[int] =None, cohort_start: int =None, cohort_end: int =None, time: int | list[int] =None, time_start: int =None, time_end: int =None) list[dict] Filter cohort-base_period-time combinations based on specified criteria and base period type.
The method filters the group time data based on the provided criteria and the selected base period handling method. Two base period methods are available: “varying” and “universal”. If feasible is set to True, only combinations of time and cohort present in the pipeline are included.
- Parameters:¶
- feasible : bool, optional¶
Whether to include only feasible combinations of time and cohort based on the pipeline. Default is False.
- base_period : Literal["varying", "universal"], optional¶
The base period handling method. It can be either “varying” or “universal”. If not specified, it uses the
base_period_typeattribute set during initialization.- relative_period : int | list[int], optional¶
Specific relative period values to filter for inclusion. Default is None.
- relative_period_start : int, optional¶
Minimum relative period value to include. Default is None.
- relative_period_end : int, optional¶
Maximum relative period value to include. Default is None.
- cohort : int | list[int], optional¶
Specific cohort values to filter for inclusion. Default is None.
- cohort_start : int, optional¶
Minimum cohort value to include. Default is None.
- cohort_end : int, optional¶
Maximum cohort value to include. Default is None.
- time : int | list[int], optional¶
Specific time values to filter for inclusion. Default is None.
- time_start : int, optional¶
Minimum time value to include. Default is None.
- time_end : int, optional¶
Maximum time value to include. Default is None.
- save : bool, optional
Whether to save the filtered group time and replace the base period type in the object’s state. Default is False.
- Returns:¶
A list of dictionaries representing cohort-base_period-time combinations. Each dictionary’s keys include:
cohort,base_period,time, and optionallystratumif thestrata_columnattribute is defined.- Return type:¶
- Raises:¶
ValueError – If ‘base_period’ is neither ‘varying’ nor ‘universal’.
See also
varying_base_periodFunction for handling varying base period.
universal_base_periodFunction for handling universal base period.