Mctaba Labs logo
BootcampData ScienceThe WhiteboardProjectsEventsMasterclassesWebinarsLearn
Book CallApply

500+ developers already in the community

Get answers, find accountability partners, and stay ahead

Join Discord →
Mctaba Labs logo

Educating 1 million students in tech by 2030.

Programs

  • Coding Bootcamp in Nairobi
  • Data Science to AI Engineering
  • HighSchool Graduates Launchpad
  • AI & Business Automation
  • Corporate Training
  • Kids & Teens
  • McTaba Story & Mission
  • Full-Stack Curriculum
  • Course Pricing & Plans
  • Frequently Asked Questions

Resources

  • Join Discord Community
  • Tech Events in Nairobi
  • Masterclasses
  • Free Resources
  • Learn
  • Data Science Guides
  • African Payments Reference
  • Campus
  • Africa Tech Talent Report
  • Partner With Us
  • Start a Project
  • Software & AI Studio
  • Our Work
  • Outcomes

Contact Us

  • 124 Manyani East Road, Lavington, Nairobi
  • +254727795603
  • Book a Discovery Call

Office Hours:

Mon-Fri: 9am - 2pm EAT

Sat: 10am - 12pm EAT

© 2026 Mctaba Labs - A product of Edtech Industries. All rights reserved.

Privacy PolicyTerms of ServiceRefund Policy
  1. Learn
  2. Data Science in Kenya
  3. The Statistics You Actually Need for Data Science
Bonaventure OgetoBy Bonaventure Ogeto|Updated November 3, 2026

Last checked 3 November 2026

The Statistics You Actually Need for Data Science

You need five ideas: mean versus median, spread, sampling, the A/B test, and Bayes for rare events. Each fits on one page and needs only school arithmetic. Skip proofs and learn each idea through one small example before you touch a library.

In this article

  1. 1. Five ideas, not a whole degree
  2. 2. Averages, medians and spread
  3. 3. Sampling: can you trust a small group?
  4. 4. A/B test on a USSD menu
  5. 5. Bayes on fraud alerts
  6. 6. How to learn these five without drowning

Five ideas, not a whole degree

McTaba runs coding and data bootcamps in Kenya. This guide is written to be useful whether or not you ever join one.

Imagine a statistics lecture that starts with a coin toss and ends in a wall of Greek letters. You do not need that wall. A working analyst reaches for five ideas again and again, and this page shows each on a small example you can redo with a pen. For the larger picture, see our data science career map for Kenya.

IdeaThe question it answersKenyan picture
Mean and medianWhat is typical?Salaries in a small company
SpreadHow much does it vary?Daily sales at one stall
SamplingCan I trust a small group?Surveying 200 shoppers
A/B testDid the change work?Two versions of a USSD menu
BayesHow likely is it, given the alert?A fraud alert on M-Pesa style data

If you want these taught alongside code, with weekly feedback, the Data Science to AI Engineering programme covers them in its maths and statistics phase, with Bayes for fraud alerts and A/B testing. No coding, data or maths background needed.

Averages, medians and spread

For example, imagine nine staff at a small Nairobi firm, with made-up monthly salaries in thousands of shillings: 35, 38, 40, 42, 45, 48, 50, 52 and 400. The 400 is the owner.

  • Mean: add them up (750) and divide by nine. About 83 thousand.
  • Median: put them in order and take the middle one. The fifth is 45 thousand.

Eight of nine people earn less than the mean. The mean got pulled by one big number. The median stays close to what most people take home. When data has a long tail, as incomes, prices and mobile money transfers do, report the median first.

Now spread. Two stalls can both sell a median of 5,000 shillings a day. One sells between 4,500 and 5,500 every day. The other swings between 500 and 12,000. You would plan stock very differently. Three simple measures of spread:

  • Range: biggest minus smallest. Quick, but one odd day ruins it.
  • Interquartile range: the width of the middle half of days. Hard to fool.
  • Standard deviation: the typical distance from the mean. Most libraries print it.

In pandas, df["amount"].describe() prints all of these in one go. The first week of learning Python for data science gets you to that line.

Get weekly developer tips

Join 25,000+ developers. Practical guides, job tips, and new content — straight to your inbox.

No spam. Unsubscribe anytime.

Sampling: can you trust a small group?

Imagine you ask 200 shoppers at one Westlands supermarket what they pay for mobile data. Does the answer describe Kenya? No. It describes shoppers at that supermarket on that day.

A sample speaks for a population only if it was chosen fairly. Three questions to ask every time:

  1. Who could not have ended up in my sample? (People without smartphones, people who shop elsewhere.)
  2. Who chose to answer? (The angry and the keen answer more than the content.)
  3. Is the sample big enough for the difference I care about? A bigger sample shrinks random error. It does not fix a biased one.

The same warning applies to your own data. A table of M-Pesa transactions holds only the people who used M-Pesa. Before you generalise, write down who is missing.

A/B test on a USSD menu

For example, imagine a savings service with a USSD menu. Version A asks for the amount first. Version B asks for the phone number first. You send each version to 1,000 made-up users.

  • For example, version A: 1,000 users, 300 finished a deposit, a rate of 30.0%.
  • For example, version B: 1,000 users, 345 finished a deposit, a rate of 34.5%.

B is 4.5 percentage points ahead. Is that real, or luck? The standard error of the difference is about 2.1 points (work: the square root of 0.30 x 0.70 / 1,000 plus 0.345 x 0.655 / 1,000). The gap divided by the standard error is about 2.2. A gap above 2 is unlikely to be luck alone, so luck alone would produce it about 3 times in 100.

Put it in plain words for the product owner: "B probably finishes more deposits. The true gain is likely between 0.4 and 8.6 points. Ship B, and keep watching."

Rules that stop false wins

  • Decide the sample size and the metric before you start.
  • Do not stop the test the day it looks good.
  • Split users at random, not by day, or Friday paydays will fool you.

The result then has to reach a person who decides. Data storytelling shows how to write that one page.

Bayes on fraud alerts

This one surprises people. For example, imagine a bank flags suspicious transfers. Made-up numbers: 1 in 100 transfers is fraud. The alert catches 90% of fraud. It also wrongly flags 5% of honest transfers.

Take 10,000 transfers.

  • Fraud: 100. The alert catches 90.
  • For example, honest transfers: 9,900. The alert wrongly flags 495 of them.
  • Total alerts: 90 + 495 = 585.

For example, of those 585 alerts, only 90 are fraud, about 15 in every 100. An alert that "catches 90% of fraud" is wrong about five times in six when it fires.

That is Bayes' rule without the formula. Start from how rare the thing is, then update with the evidence. Two lessons follow. For rare events, accuracy figures mislead. And an alert team needs a cheap way to clear false alarms, or it will drown. The fraud topic gets its own build in our guide to mobile money fraud detection with machine learning.

How to learn these five without drowning

  1. Redo each example above on paper, then in a spreadsheet, then in Python.
  2. Change one number and predict what moves.
  3. Use free lessons from Khan Academy for gaps, not as a starting wall.
  4. Apply each idea to a dataset from our six-month data science roadmap.

No maths degree is needed for any of this, and no school can promise a job from it. It is the thinking that lets you say "I am not sure yet" in a meeting, and mean it. The Data Science to AI Engineering programme starts on 11 January 2027 and costs KES 140,000.

Key Takeaways

  • ✓Five ideas do most of the work: mean versus median, spread, sampling, A/B tests and Bayes.
  • ✓For skewed data such as salaries, lead with the median.
  • ✓A bigger sample cuts random error but never fixes bias.
  • ✓For rare events, a high catch rate can still mean mostly false alarms.

Frequently Asked Questions

How much statistics do I need for data science?
Enough to choose between mean and median, describe spread, judge a sample, read an A/B test and reason about rare events. These five ideas cover most analyst work.
Should I report the mean or the median?
When a few large numbers pull the data, as with salaries or transfer sizes, report the median first and the mean second.
What does it mean when a test result is called significant?
It is the chance of seeing a gap this big if the two versions were really the same. A small chance, such as 3 in 100, means luck alone is an unlikely explanation.
Why do fraud alerts have so many false alarms?
Because fraud is rare. Even a good alert flags many honest transfers when almost all transfers are honest.

Learn data science on African data

KES 140,000

Data Science to AI Engineering: 5 months full time or 8 months part time, hybrid in Nairobi. Fraud, credit and M-Pesa data from Week 1, and every model deployed. Starts 11 January 2027.

See the Data Science programme

Need it live by next month? Our studio builds it

Related guides

  • Data Science Roadmap for Beginners: 6 Months, Week by Week
  • AI vs Machine Learning vs Data Science: The Difference
  • Best Data Science Courses in Kenya (2026): Fees, Length, Who Each Suits

Keep reading

Python for Data Science: Your First 30 Days

Thirty days, four weeks, one small script a week. Learn only the parts of Python that data work uses, with examples on made-up Kenyan shop data.

Read more

Data Storytelling: Turning a Chart into a Decision

A chart is not the finish line. This guide shows the one-page memo, a simple way to pick a chart, and a before and after on made-up shop data.

Read more

Catching Mobile Money Fraud with Machine Learning

A fraud model on the public PaySim dataset, judged in shillings lost and wasted alarms rather than a single accuracy score.

Read more

Can You Learn Data Science Without a Maths Background?

Yes, you can start. Here is which maths data science needs, in what order it arrives, and the real work you can do before you have it.

Read more

Explore related topics

Breaking Into Tech

Practical, no-nonsense guides for anyone looking to start or change their career in tech. From choosing your first language to acing interviews.

Tech Salary Data

Transparent salary data for tech roles in Africa and worldwide, updated regularly with real market research.

AI Skills & Tools

Practical AI knowledge for developers. Build your first agent, get good at RAG, and pick the right AI coding tools for real work.

Bonaventure Ogeto

Bonaventure Ogeto

Founder and CEO, Mctaba Labs

Software engineer for 8+ years. He runs a Nairobi studio that ships products on M-Pesa, WhatsApp and AI, and teaches what the studio ships. He holds a BSc in Mathematics and Computer Science.

More about the author