Skip to content

Instantly share code, notes, and snippets.

@komuw
Last active February 6, 2025 09:00
Show Gist options
  • Save komuw/b7fc41d1cf018bc14f945a010a2045f0 to your computer and use it in GitHub Desktop.
Save komuw/b7fc41d1cf018bc14f945a010a2045f0 to your computer and use it in GitHub Desktop.
cost/spending of public primary, jss and secondary education in kenya
# we are going to try estimate the amount of money the govt(ahem, taxpayer) spends per public school student per year/term.
# We are only interested in the figures for students in PUBLIC primary, jss AND secondary schools.
# All the figures here come from the 2024/25 supplementary estimates I.
# see: https://mwangocapital.com/wp-content/uploads/2024/07/fy-24-25-supplementary-1-.pdf
# aka, the one that was sent to parliament after the 2024/25 finance bill was rejected.
# Number of learners.
# We are only interested in primary, jss & secondary school figures.
# See page 221 of the supplementary estimates.
learners_in_public_primary_sch = 6_450_133 # 6million
learners_in_jss = 3_312_865
learners_in_sec_sch = 3_244_325
learners_in_adult_education = 151_000
learners_provided_with_sch_meals = 4_000_000
total_public_learners = learners_in_public_primary_sch + learners_in_jss + learners_in_sec_sch
total_public_learners = 13_007_323 # 13million.
# Spending for basic education
# See page 229 of the supplementary estimates.
free_primary_education = 21_633_795_702 # KES 21 billion
pri_special_needs_education = 681_248_083
ecde = 18_448_319
pri_teachers_training_in_servicing = 389_469_379
adult_education = 55_275_376
expanding_edu_in_asals = 400_000_000
free_sec_edu = 94_599_910_071 # KES 94 billion
sec_teachers_services = 231_689_981
sec_teachers_training_in_servicing = 252_582_688
sec_special_needs_education = 200_000_000
curriculum_devpt = 1_098_221_559
exams_and_certification = 1_827_000_000
co_curriculum_activities = 1_329_508_180
hq_admin_services = 1_537_919_228
county_admin_services = 3_070_957_202
total_basic_education = (
free_primary_education
+ pri_special_needs_education
+ pri_teachers_training_in_servicing
+ expanding_edu_in_asals
+ free_sec_edu
+ sec_teachers_services
+ sec_teachers_training_in_servicing
+ sec_special_needs_education
+ curriculum_devpt
+ exams_and_certification
+ co_curriculum_activities
+ hq_admin_services
+ county_admin_services
)
assert total_basic_education == 127_252_302_073 # KES 127 billion
# Spending for TSC. We are only interested in TSC spending specifically for primary, jss & secondary(ie, excluding tertiary)
# See page 865 of the supplementary estimates.
teacher_mgmnt_primary = 196_127_073_024 # KES 196 billion
teacher_mgmnt_secondary = 137_015_327_079
teacher_mgmnt_tertiary = 4_533_870_504
governance_and_standards = 1_104_431_830
general_admin = 9_107_215_823
# For `governance_and_standards` & `general_admin`, it is not broken down. ie, it's hard to know what percentage of say `general_admin` is dedicated
# for the general_admin of primary, secondary or tertiary.
# But since `teacher_mgmnt_tertiary` is 1.34% of the total for teacher_mgmnt. We will aportion `governance_and_standards`, `general_admin` in same ratios.
# ie,
governance_and_standards_primary_and_secondary = 1_104_431_830 - ((1.34 / 100) * 1_104_431_830)
governance_and_standards_primary_and_secondary = int(governance_and_standards_primary_and_secondary)
assert governance_and_standards_primary_and_secondary == 1_089_632_443
general_admin_primary_and_secondary = 9_107_215_823 - ((1.34 / 100) * 9_107_215_823)
general_admin_primary_and_secondary = int(general_admin_primary_and_secondary)
assert general_admin_primary_and_secondary == 8_985_179_130
# Thus
total_tsc_for_primary_and_secondary = (
teacher_mgmnt_primary
+ teacher_mgmnt_secondary
+ governance_and_standards_primary_and_secondary
+ general_admin_primary_and_secondary
)
assert total_tsc_for_primary_and_secondary == 343_217_211_676 # KES 343 billion
total_basic_education_budget_spending = total_basic_education + total_tsc_for_primary_and_secondary
assert total_basic_education_budget_spending == 470_469_513_749 # 470 billion
total_spending_per_learner_per_year = total_basic_education_budget_spending / total_public_learners
total_spending_per_learner_per_year = int(total_spending_per_learner_per_year)
assert total_spending_per_learner_per_year == 36_169 # KES 36k per learner per year.
total_spending_per_learner_per_term = total_spending_per_learner_per_year / 3
total_spending_per_learner_per_term = int(total_spending_per_learner_per_term)
assert total_spending_per_learner_per_term == 12_056 # KES 12k per learner per term.
# Do note that the maths is not perfect.
# For instance, the country spends KES 1.8 billion on exams and certification per year.
# I have counted that money as part of the expense for public education.
# But strictly speaking, that money is spent on both public & private
# Since private schools use the same kcpe/kcse provided by govt.
# But this estimates are not meant to be a perfect.
# In any case, if we assume that curriculum_devpt, exams_and_certification, hq_admin_services &
# governance_and_standards_primary_and_secondary are shared between public & private schools
# And we thus exclude them from the calculation.
# The cost drops from KES 36,169 to KES 35,742 per public student per year.
#
@komuw
Copy link
Author

komuw commented Aug 2, 2024

For roads;

#
# The total length of tarmac/bitumen road in Kenya(yr 2024) is: 25,410km.
# See:
# 1. https://www.knbs.or.ke/wp-content/uploads/2024/05/Chapter-11-Construction-Sector-Tables.xlsx (table 11.10 & 11.11)
# 2. https://africacheck.org/fact-checks/blog/analysis-road-not-travelled-conflicting-data-threatens-kenya-president-uhuru
total_length_of_tarmac = 25_410  # 25,000 kilometers

# The cost of periodic maintenance of tarmac in year 2024 is KES ~14million/km
# ie, to lay an 35mm(3.5cm/1.3inch) of AC Overlay(asphalt concrete overaly)
# See:
# 1. https://krb.go.ke/RMLF/RMLF_2024.pdf (page 6)
# 2. https://www.knbs.or.ke/wp-content/uploads/2024/05/Chapter-11-Construction-Sector-Tables.xlsx (table 11.10 & 11.11)
# 3. https://integrum.co.ke/road-construction-costs-per-km-in-kenya-2021/
cost_of_maintenance_of_tarmac_per_km = 14_000_000  # KES 13.28m per km.

# Tarmac is estimated to last ~20yrs before a major rehabilitation is needed.
# And a 35mm overalyed road will last about ~15yrs
# See:
# 1. https://www.engineering.com/how-many-years-is-the-average-life-time-of-standard-asphalt-pavementsdoes-it-contain-partial-rehabilitation/
# 2. https://onlinepubs.trb.org/Onlinepubs/trr/1987/1117/1117-017.pdf
#
# Assuming, for whatever reason, Kenyan roads need maintenance every ~8yrs,
maintenance_cadence = 8  # ie, a road will require maintenance every 8years.
total_cost_of_maintenance_of_tarmac_per_yr = (
    total_length_of_tarmac * cost_of_maintenance_of_tarmac_per_km
) / maintenance_cadence
assert total_cost_of_maintenance_of_tarmac_per_yr == 44_467_500_000
# ie, you require KES 44billion to maintain tarmac roads per year.

# The cost of  constructing a new road in year 2024 is KES 110 million/km
# 1. https://krb.go.ke/RMLF/RMLF_2024.pdf
# 2. https://www.knbs.or.ke/wp-content/uploads/2024/05/Chapter-11-Construction-Sector-Tables.xlsx (table 11.10 & 11.11)
cost_of_new_road_per_km = 110_000_000  # KES 110m per km.

# If we set ourselves the audacious task of building 500 km/yr of new tarmac roads.
# (For reference: Kibaki built about ~250km/yr and Uhuru did ~1000km/yr.)
# See:
# 1. https://africacheck.org/fact-checks/blog/analysis-road-not-travelled-conflicting-data-threatens-kenya-president-uhuru
km_of_new_roads_per_yr = 500  # km

total_cost_of_new_roads_per_yr = cost_of_new_road_per_km * km_of_new_roads_per_yr
assert total_cost_of_new_roads_per_yr == 55_000_000_000
# ie, you require KES 55billion to construct new tarmac roads per year.


total_spending_on_tarmac_roads_per_yr = (
    total_cost_of_maintenance_of_tarmac_per_yr + total_cost_of_new_roads_per_yr
)
assert total_spending_on_tarmac_roads_per_yr == 99_467_500_000
# ie, you require KES 99billion to both construct new roads AND maintain existing ones per year.

# Do we have enough money to do that?
# The road maintenance levy collected KES 84billion in 2023/24(at KES 18/ltr).
# In 2024/25 it is projected to collect KES 115billion (at KES 25/ltr).
# See:
# 1. https://www.businessdailyafrica.com/bd/economy/where-rise-in-road-maintenance-levy-will-hurt-most-4692312
road_maintenance_levy_collection = 115_000_000_000  # KES 115billion per year

road_levy_surplus = road_maintenance_levy_collection - total_spending_on_tarmac_roads_per_yr
assert road_levy_surplus == 15_532_500_000  # KES 15billion

# Thus the road maintenance levy is enough to cater for the needs of both:
# (a) building new tarmac roads and
# (b) maintaining all existing tarmac roads.
# (c) their will be KES 15billion remaining.

# Kenya additionaly has about ~200,000km of un-tarmacked(earth) roads. What to do with those?
# See:
# 1. https://krb.go.ke/RMLF/RMLF_2024.pdf
#
# According to the the 2024/25 supplementary estimates I.
# See(page 221):
# 1. https://mwangocapital.com/wp-content/uploads/2024/07/fy-24-25-supplementary-1-.pdf
#
# the state department of roads has been assigned the following monies.
Construction_of_Roads_and_Bridges = 72_785_576_625  # KES 72billion
Rehabilitation_of_Roads = 36_577_853_501
Maintenance_of_Roads = 69_536_000_000
General_Administration_Planning_and_Support_Services = 5_942_520_610
total_roads_budget_per_yr = (
    Construction_of_Roads_and_Bridges + Rehabilitation_of_Roads + Maintenance_of_Roads
)
# I have not included the general admin in the total, since I think those are salaries for the rank & file at the ministry.
assert total_roads_budget_per_yr == 178_899_430_126  # KES 178billion per year.

# The cost of periodic maintenance of earth roads(ie, Gravelling) in year 2024 is KES ~4.83 million/km.
# See:
# https://krb.go.ke/RMLF/RMLF_2024.pdf
cost_of_maintenance_of_earth_roads_per_km = 4_830_000  # KES 4.83m per km.
total_length_of_earth_roads = 213_712  # km
total_cost_of_maintenance_of_earth_roads_per_yr = (
    total_length_of_earth_roads * cost_of_maintenance_of_earth_roads_per_km
) / maintenance_cadence
assert total_cost_of_maintenance_of_earth_roads_per_yr == 129_028_620_000
# KES 129billion. # ie, you require KES 129billion to maintain earth roads per year.

roads_budget_surplus = total_roads_budget_per_yr - total_cost_of_maintenance_of_earth_roads_per_yr
assert roads_budget_surplus == 49_870_810_126  # KES 49billion
# Thus the roads budget of KES 178billion is more than enough to maintain all earth roads.
# and have a surplus of 49billion.

total_roads_surplus = road_levy_surplus + roads_budget_surplus
assert total_roads_surplus == 65_403_310_126  # KES 65billion
# Thus the total surplus from roads is 65billion.

# In fact, if we changed so that we recarpet all tarmac roads every 5years(instead of 8) 
# and we still re-gravel all earth roads every 8years.
# We would still have a surplus of KES 38billion

# PS:
# The AC(asphalt concrete overal) overlay process is;
# (a) Preparation: existing road surface is cleaned & repaired to ensure proper adhesion of the new layer.
# (b) Tack Coat: sticky asphalt emulsion(tack coat) is applied to existing surface 2 bond the new layer.
# (c) Placement: 35mm thick layer of asphalt is spread evenly over the prepared surface.
# (d) Compaction: newly laid asphalt is compacted using rollers.
# (e) Cooling: asphalt concrete is allowed to cool and harden.
# See:
# https://www.youtube.com/watch?v=kWCJUQzre0o

# https://www.nature.com/articles/s41467-024-49193-1 (Efficient self-organization of informal public transport networks)

@komuw
Copy link
Author

komuw commented Aug 3, 2024

judiciary:

according to IEA kenya, judiciary budget should be  KES 40 bn
# https://x.com/LeoKemboi/status/1819419715225186735
# https://ieakenya.or.ke/?wpdmdl=2925

@komuw
Copy link
Author

komuw commented Nov 5, 2024

Tax to gdp ratios:

tax_revenue_2012 = 707.4  # billion # https://www.kra.go.ke/images/publications/202021-annual-revenue-performance-final.pdf
tax_revenue_2017 = 1340  # billion #ie, 1.340 trn # https://www.kra.go.ke/images/publications/Revenue-Performance-Report-2018-19.pdf
tax_revenue_2023 = 2407  # billion #ie, 2.407 trn # https://www.kra.go.ke/news-center/press-release/2122-kra-records-11-1-growth-in-revenue-collection

# https://x.com/komu_wairagu/status/1790721073849196944
govt_contribution_to_gdp_2012 = 25  # percent
# https://x.com/komu_wairagu/status/1790721073849196944
govt_contribution_to_gdp_2017 = 40  # percent
# https://www.youtube.com/watch?v=G0OoDb6V-SI&t=2994
govt_contribution_to_gdp_2023 = 50  # percent

# We are using nominal GDP figures since the tax revenues are also nominal.
gdp_2012 = 4_767.191  # billion # nominal # https://www.centralbank.go.ke/annual-gdp/
gdp_2017 = 8_483.396  # billion # nominal # https://www.centralbank.go.ke/annual-gdp/
gdp_2023 = 15_108.806  # billion # nominal # https://www.centralbank.go.ke/annual-gdp/

gdp_without_govt_contribution_to_gdp_2012 = gdp_2012 - (
    (govt_contribution_to_gdp_2012 / 100) * gdp_2012
)
gdp_without_govt_contribution_to_gdp_2017 = gdp_2017 - (
    (govt_contribution_to_gdp_2017 / 100) * gdp_2017
)
gdp_without_govt_contribution_to_gdp_2023 = gdp_2023 - (
    (govt_contribution_to_gdp_2023 / 100) * gdp_2023
)

tax_to_gdp_with_govt_contribution_to_gdp_2012 = (float(tax_revenue_2012) / float(gdp_2012)) * 100
tax_to_gdp_with_govt_contribution_to_gdp_2017 = (float(tax_revenue_2017) / float(gdp_2017)) * 100
tax_to_gdp_with_govt_contribution_to_gdp_2023 = (float(tax_revenue_2023) / float(gdp_2023)) * 100


tax_to_gdp_without_govt_contribution_to_gdp_2012 = (
    float(tax_revenue_2012) / float(gdp_without_govt_contribution_to_gdp_2012)
) * 100
tax_to_gdp_without_govt_contribution_to_gdp_2017 = (
    float(tax_revenue_2017) / float(gdp_without_govt_contribution_to_gdp_2017)
) * 100
tax_to_gdp_without_govt_contribution_to_gdp_2023 = (
    float(tax_revenue_2023) / float(gdp_without_govt_contribution_to_gdp_2023)
) * 100

print(
    f"""
tax_to_gdp_with_govt_contribution_to_gdp_2012: {tax_to_gdp_with_govt_contribution_to_gdp_2012:.2f}%
tax_to_gdp_with_govt_contribution_to_gdp_2017: {tax_to_gdp_with_govt_contribution_to_gdp_2017:.2f}%
tax_to_gdp_with_govt_contribution_to_gdp_2023: {tax_to_gdp_with_govt_contribution_to_gdp_2023:.2f}%

tax_to_gdp_without_govt_contribution_to_gdp_2012: {tax_to_gdp_without_govt_contribution_to_gdp_2012:.2f}%
tax_to_gdp_without_govt_contribution_to_gdp_2017: {tax_to_gdp_without_govt_contribution_to_gdp_2017:.2f}%
tax_to_gdp_without_govt_contribution_to_gdp_2023: {tax_to_gdp_without_govt_contribution_to_gdp_2023:.2f}%
      """
)

# Output:
# tax_to_gdp_with_govt_contribution_to_gdp_2012: 14.84%
# tax_to_gdp_with_govt_contribution_to_gdp_2017: 15.80%
# tax_to_gdp_with_govt_contribution_to_gdp_2023: 15.93%

# tax_to_gdp_without_govt_contribution_to_gdp_2012: 19.79%
# tax_to_gdp_without_govt_contribution_to_gdp_2017: 26.33%
# tax_to_gdp_without_govt_contribution_to_gdp_2023: 31.86%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment