Skip to content

Commit

Permalink
added main poverty docs
Browse files Browse the repository at this point in the history
  • Loading branch information
masterismail committed Jul 15, 2024
1 parent 6525f1b commit 7c45513
Show file tree
Hide file tree
Showing 5 changed files with 280 additions and 0 deletions.
66 changes: 66 additions & 0 deletions docs/Poverty/deep/byage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# By age

## Overview

The deep poverty by age group metrics provide insights into how a policy reform affects deep poverty rates for different age categories. These metrics are part of the `EconomicImpact` class and can be calculated for children, adults, seniors, and the overall population.

## Available Metrics

1. `poverty/deep/child`: Calculates the deep poverty rate for children.
2. `poverty/deep/adult`: Calculates the deep poverty rate for adults.
3. `poverty/deep/senior`: Calculates the deep poverty rate for seniors.
4. `poverty/deep/age/all`: Calculates the overall deep poverty rate.

## Metric Structure

Each metric returns a dictionary with the following keys:
- `baseline`: The deep poverty rate before the reform.
- `reform`: The deep poverty rate after the reform.
- `change`: The percentage change in the deep poverty rate due to the reform.

All values are rounded to 1 decimal place for the baseline, reform, and change.

## Example Usage

```python
from policyengine import EconomicImpact

# Initialize the EconomicImpact class with a reform
impact = EconomicImpact(reform={
"gov.hmrc.income_tax.rates.uk[0].rate": {
"2024-01-01.2100-12-31": 0.55
}
}, country="uk")

# Calculate deep poverty rates by age group
child_deep_poverty = impact.calculate("poverty/deep/child")
adult_deep_poverty = impact.calculate("poverty/deep/adult")
senior_deep_poverty = impact.calculate("poverty/deep/senior")
overall_deep_poverty = impact.calculate("poverty/deep/age/all")

# Print the results
print(f"Child deep poverty: {child_deep_poverty}")
print(f"Adult deep poverty: {adult_deep_poverty}")
print(f"Senior deep poverty: {senior_deep_poverty}")
print(f"Overall deep poverty: {overall_deep_poverty}")

```

## output

```
Child deep poverty: {'baseline': 2.4, 'reform': 2.5, 'change': 0.7}
Adult deep poverty: {'baseline': 2.6, 'reform': 2.7, 'change': 3.9}
Senior deep poverty: {'baseline': 1.8, 'reform': 1.8, 'change': 0.5}
Overall deep poverty: {'baseline': 2.4, 'reform': 2.5, 'change': 2.7}
```

## Interpretation

In this example:

- The child deep poverty rate increases slightly from 2.4% to 2.5%, a 0.7% increase.
- The adult deep poverty rate increases from 2.6% to 2.7%, a 3.9% increase.
- The senior deep poverty rate remains stable at 1.8%, with a minimal 0.5% increase.
- The overall deep poverty rate increases from 2.4% to 2.5%, a 2.7% increase.
61 changes: 61 additions & 0 deletions docs/Poverty/deep/bygender.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# By gender

## Overview

The deep poverty by gender metrics provide insights into how a policy reform affects deep poverty rates for different genders. These metrics are part of the `EconomicImpact` class and can be calculated for males, females, and the overall population.

## Available Metrics

1. `poverty/deep/male`: Calculates the deep poverty rate for males.
2. `poverty/deep/female`: Calculates the deep poverty rate for females.
3. `poverty/deep/gender/all`: Calculates the overall deep poverty rate.

## Metric Structure

Each metric returns a dictionary with the following keys:
- `baseline`: The deep poverty rate before the reform.
- `reform`: The deep poverty rate after the reform.
- `change`: The percentage change in the deep poverty rate due to the reform.

All values are rounded to 2 decimal places for the baseline and reform, and to 1 decimal place for the change.

## Example Usage

```python
from policyengine import EconomicImpact

# Initialize the EconomicImpact class with a reform
impact = EconomicImpact(reform={
"gov.hmrc.income_tax.rates.uk[0].rate": {
"2024-01-01.2100-12-31": 0.55
}
}, country="uk")

# Calculate deep poverty rates by gender
male_deep_poverty = impact.calculate("poverty/deep/male")
female_deep_poverty = impact.calculate("poverty/deep/female")
overall_deep_poverty = impact.calculate("poverty/deep/gender/all")

# Print the results
print(f"Male deep poverty: {male_deep_poverty}")
print(f"Female deep poverty: {female_deep_poverty}")
print(f"Overall deep poverty: {overall_deep_poverty}")

```

## output

```
Male deep poverty: {'baseline': 2.66, 'reform': 2.73, 'change': 2.5}
Female deep poverty: {'baseline': 2.16, 'reform': 2.23, 'change': 2.9}
Overall deep poverty: {'baseline': 2.41, 'reform': 2.47, 'change': 2.7}
```

## Interpretation

In this example:

- The baseline male deep poverty rate is 2.66%, which increases to 2.73% after the reform, representing a 2.5% increase.
- The baseline female deep poverty rate is 2.16%, which increases to 2.23% after the reform, representing a 2.9% increase.
- The overall deep poverty rate increases from 2.41% to 2.47%, a change of 2.7%.
63 changes: 63 additions & 0 deletions docs/Poverty/regular/byage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# By age

## Overview

The regular poverty by age group metrics provide insights into how a policy reform affects poverty rates for different age categories. These metrics are part of the `EconomicImpact` class and can be calculated for children, adults, seniors, and the overall population.

## Available Metrics

1. `poverty/regular/child`: Calculates the poverty rate for children.
2. `poverty/regular/adult`: Calculates the poverty rate for adults.
3. `poverty/regular/senior`: Calculates the poverty rate for seniors.
4. `poverty/regular/all`: Calculates the overall poverty rate.

## Metric Structure

Each metric returns a dictionary with the following keys:
- `baseline`: The poverty rate before the reform.
- `reform`: The poverty rate after the reform.
- `change`: The percentage change in the poverty rate due to the reform.

All values are rounded to 2 decimal places for the baseline and reform, and to 1 decimal place for the change.

## Example Usage

```python
from policyengine import EconomicImpact

# Initialize the EconomicImpact class with a reform
impact = EconomicImpact(reform={
"gov.hmrc.income_tax.rates.uk[0].rate": {
"2024-01-01.2100-12-31": 0.55
}
}, country="uk")

# Calculate poverty rates by age group
child_poverty = impact.calculate("poverty/regular/child")
adult_poverty = impact.calculate("poverty/regular/adult")
senior_poverty = impact.calculate("poverty/regular/senior")
overall_poverty = impact.calculate("poverty/regular/all")

# Print the results
print(f"Child poverty: {child_poverty}")
print(f"Adult poverty: {adult_poverty}")
print(f"Senior poverty: {senior_poverty}")
print(f"Overall poverty: {overall_poverty}")

```
## Example Output

```
Child poverty: {'baseline': 0.32, 'reform': 0.36, 'change': 10.1}
Adult poverty: {'baseline': 0.17, 'reform': 0.19, 'change': 8.4}
Senior poverty: {'baseline': 0.13, 'reform': 0.17, 'change': 30.5}
Overall poverty: {'baseline': 0.20, 'reform': 0.22, 'change': 11.7}
```
## Interpretation

In this example:

- The child poverty rate increases from 32% to 36%, a 10.1% increase.
- The adult poverty rate increases from 17% to 19%, an 8.4% increase.
- The senior poverty rate increases from 13% to 17%, a significant 30.5% increase.
- The overall poverty rate increases from 20% to 22%, an 11.7% increase.
58 changes: 58 additions & 0 deletions docs/Poverty/regular/bygender.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# By gender

## Overview
The regular poverty by gender metrics provide insights into how a policy reform affects poverty rates for different genders. These metrics are part of the EconomicImpact class and can be calculated for males, females, and the overall population.

## Available Metrics
- `poverty/regular/male`: Calculates the poverty rate for males.
- `poverty/regular/female`: Calculates the poverty rate for females.
- `poverty/regular/gender/all`: Calculates the overall poverty rate.

## Metric Structure
Each metric returns a dictionary with the following keys:
- `baseline`: The poverty rate before the reform.
- `reform`: The poverty rate after the reform.
- `change`: The percentage change in the poverty rate due to the reform.

All values are rounded to 2 decimal places for the baseline and reform, and to 1 decimal place for the change.

## Example Usage
```python
from policyengine import EconomicImpact

# Initialize the EconomicImpact class with a reform
impact = EconomicImpact(reform={
"gov.hmrc.income_tax.rates.uk[0].rate": {
"2024-01-01.2100-12-31": 0.55
}
}, country="uk")

# Calculate poverty rates by gender
male_poverty = impact.calculate("poverty/regular/male")
female_poverty = impact.calculate("poverty/regular/female")
overall_poverty = impact.calculate("poverty/regular/gender/all")

# Print the results
print(f"Male poverty: {male_poverty}")
print(f"Female poverty: {female_poverty}")
print(f"Overall poverty: {overall_poverty}")
```

## Example output

```
Male poverty: {'baseline': 0.18, 'reform': 0.21, 'change': 12.9}
Female poverty: {'baseline': 0.21, 'reform': 0.23, 'change': 10.7}
Overall poverty: {'baseline': 0.20, 'reform': 0.22, 'change': 11.7}
```

## Interpretation

In this example:

- The baseline male poverty rate is 18%, which increases to 21% after the reform, representing a 12.9% increase.
- The baseline female poverty rate is 21%, which increases to 23% after the reform, representing a 10.7% increase.
- The overall poverty rate increases from 20% to 22%, a change of 11.7%.

These metrics can help policymakers understand the differential impact of a reform on poverty rates across genders.
32 changes: 32 additions & 0 deletions docs/Poverty/regular/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Regular poverty

## Overview

Regular poverty metrics measure the proportion of individuals living below the standard poverty line. These metrics provide crucial insights into the effectiveness of economic policies and their impact on different demographic groups.

## Available Metrics

Our regular poverty analysis includes the following categories:

1. **Poverty by Age Group**
- Child Poverty
- Adult Poverty
- Senior Poverty
- Overall Poverty

2. **Poverty by Gender**
- Male Poverty
- Female Poverty
- Overall Poverty

## Importance

Regular poverty metrics are essential for:
- Assessing the overall economic well-being of a population
- Identifying vulnerable groups most affected by poverty
- Evaluating the effectiveness of poverty reduction policies
- Comparing poverty rates across different demographics

## Usage

These metrics can be accessed using the `EconomicImpact` class. For detailed information on each metric, please refer to the respective documentation pages.

0 comments on commit 7c45513

Please sign in to comment.