Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distributional charts #36

Merged
merged 5 commits into from
Sep 25, 2024

Conversation

masterismail
Copy link
Collaborator

Usage

Distributional / by Income / Relative

# Import necessary modules
from policyengine import EconomicImpact

# Create an instance of EconomicImpact
impact = EconomicImpact(
    reform={"gov.hmrc.income_tax.rates.uk[0].rate": {"2024-01-01.2100-12-31": 0.55}}, 
    country="uk"
)

# Calculate the Gini coefficient
rel = impact.chart("distributional/by_income/relative")

print("rel")

image

Distributional / by Income / Average

# Import necessary modules
from policyengine import EconomicImpact

# Create an instance of EconomicImpact
impact = EconomicImpact(
    reform={"gov.hmrc.income_tax.rates.uk[0].rate": {"2024-01-01.2100-12-31": 0.55}}, 
    country="uk"
)

# Calculate the Gini coefficient
avg = impact.chart("distributional/by_income/average")

print("avg")

image

Distributional / by wealth / Relative

# Import necessary modules
from policyengine import EconomicImpact

# Create an instance of EconomicImpact
impact = EconomicImpact(
    reform={"gov.hmrc.income_tax.rates.uk[0].rate": {"2024-01-01.2100-12-31": 0.55}}, 
    country="uk"
)

# Calculate the Gini coefficient
rel = impact.chart("distributional/by_wealth/relative")

print("rel:")

image

Distributional / by wealth / Average

# Import necessary modules
from policyengine import EconomicImpact

# Create an instance of EconomicImpact
impact = EconomicImpact(
    reform={"gov.hmrc.income_tax.rates.uk[0].rate": {"2024-01-01.2100-12-31": 0.55}}, 
    country="uk"
)

# Calculate the Gini coefficient
avg = impact.chart("distributional/by_wealth/average")

print("avg:")

image

@nikhilwoodruff nikhilwoodruff merged commit 5ec0ce2 into PolicyEngine:main Sep 25, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants