Module 1 · Statistics for Data Analysis
Statistics for analysts
What statistics does for an analyst, the difference between describing data and drawing conclusions from it, populations and samples, the kinds of variable you'll meet, and the three ways numbers most often mislead.
About 25 minutes
The problem
Kolanut Distribution's HR director reads a report that says "the average employee earns ₦609,250 a month" and concludes that pay is generous. A junior analyst replies that most employees earn less than ₦500,000. A third colleague says the sample of 80 employees is too small to say anything at all.
All three are talking about the same file, and they can't all be right. The difference between them isn't arithmetic. It's statistics: knowing which number answers the question, how much it can vary, and how far you can trust a conclusion drawn from it.
This course gives you those skills, in Excel or Google Sheets, on Kolanut's sales and HR data, Harbourline Freight's shipments and Ashgrove Chambers' invoices.
The concept
Two jobs statistics does
- Descriptive statistics summarise the data you have: the typical salary, how spread out delivery times are, how strongly two things move together. Lessons 2 to 6.
- Inferential statistics help you draw conclusions beyond the data you have: is a difference real or just luck, how precise is an estimate, will a trend continue? Lessons 7 to 10.
Most day-to-day analysis is descriptive. Inference is what stops you announcing a "finding" that's really noise.
Population and sample
- The population is everyone or everything you want to know about: all of Kolanut's customers, every shipment Harbourline will ever make.
- A sample is the part you actually have data on.
Sometimes your data is the whole population. Kolanut's employees.csv lists all 80 people who have worked there, so the average salary in it isn't an estimate; it's the fact. Often it isn't: a survey of 200 customers is a sample of all customers, and the answer would be slightly different with a different 200. Asking "is this all of them, or some of them?" decides which tools you need.
Kinds of variable
| Kind | What it is | Example | Typical summaries |
|---|---|---|---|
| Categorical | A label from a set | department, region, payment method | counts, percentages, the most common |
| Ordinal | Categories with an order | job level (Junior < Mid < Senior), a 1–5 rating | counts, the median |
| Numerical, discrete | Counts | containers per shipment, packs per order line | mean, median, spread |
| Numerical, continuous | Measurements | revenue, salary, weight, days to pay | mean, median, spread |
The kind decides what's meaningful. An "average region" is nonsense; an average salary is fine. A job level of "2.4" means nothing even if you coded Junior as 1 and Senior as 3.
Three ways numbers mislead
- The wrong average. A few very high values pull the mean up. Kolanut's mean salary (₦609,250) is well above the median (₦492,500), because ten managers earn over ₦1.2 million. "The typical employee" is closer to the median. Lesson 2 shows how to choose.
- No sense of spread. "Average delivery time is 27 days" hides whether almost every shipment takes 26–28 days or some take 10 and others 60. Customers experience the spread, not the average. Lesson 3.
- Mistaking noise for a signal. Small groups and small differences bounce around by chance. Customer Service's resignation rate (3 of 8) sounds alarming, but three people is a small number. Lessons 7 to 9 give you the tools to tell the difference.
Example
The HR director's question, answered properly. Open the HR dataset's employees.csv in Excel or Google Sheets and put these formulas in empty cells (the salary is column G, rows 2 to 81):
Excel formula
=AVERAGE(G2:G81) 609,250
=MEDIAN(G2:G81) 492,500
=COUNTIF(G2:G81,"<500000") 41Read together: the average is ₦609,250, but half of all employees earn ₦492,500 or less, and 41 of 80 earn under ₦500,000. The mean is pulled up by the highest earners. A fair one-line answer for the director:
Most employees earn under ₦500,000 a month (the median is ₦492,500). The average is higher, ₦609,250, because ten managers earn over ₦1.2 million.
That sentence is more useful than either number on its own, and it's statistics doing its job: choosing the right summary and saying what it means.
Walkthrough
- Download the HR dataset (below) and open
employees.csvin Excel or Google Sheets. - Press Ctrl + T to make it a Table. Check there are 80 employees.
- For each column, write down which kind of variable it is:
department(categorical),job_level(ordinal),monthly_salary(continuous), and so on. - Calculate the mean and median salary with
AVERAGEandMEDIAN, and count how many earn under ₦500,000 withCOUNTIF. - Calculate the mean and median for Junior staff only:
=AVERAGEIFS(G2:G81, D2:D81, "Junior")and=MEDIAN(IF(D2:D81="Junior", G2:G81)). In older Excel, finish that last one with Ctrl + Shift + Enter. - Write one sentence, for the HR director, that uses both numbers honestly.
Practice
Practice
How many employees in employees.csv earn more than ₦1,000,000 a month?
Practice
What is the median monthly salary of Mid-level staff?
Practice
A researcher surveys 300 of Kolanut's 4,000 retail customers about delivery times. Are the 300 a population or a sample?
Challenge
Challenge · optional
job_level is stored as text (Junior, Mid, Senior, Manager). What kind of variable is it? (One word from this lesson's table.)
Check your understanding
Answer every question to check.