Data, information, knowledge
These three words are used loosely in conversation and precisely in this chapter. Data is raw, unprocessed facts — 37, 41, 39, 40 means nothing on its own. Information is data given context: those are the maximum daily temperatures in Lahore last week. Knowledge is what you conclude and can act on: it is unusually hot for the season, so schools should reschedule sports.
Data science is the discipline of moving along that chain reliably, and it has a fixed set of stages.
- Define the question. A vague question produces unusable data; deciding what you want to know comes before collecting anything.
- Collect the data — from surveys, sensors, existing records or public datasets.
- Clean it: remove duplicates, fix errors, decide what to do about missing values.
- Analyse it: averages, spread, trends, correlations.
- Present it: the chart that makes the finding visible to someone who has not seen the data.
Cleaning is most of the work
Real datasets contain the same person entered twice with different spellings, dates written three different ways, temperatures recorded as 400 instead of 40, and blank fields. Analysing dirty data produces confident, wrong answers — which is worse than no answer at all. This stage takes longer than the analysis and is where exam questions about "reliability" are pointing.
Primary and secondary data
Primary data is collected by you, for your question — a survey you ran, readings from a sensor you set up. It fits your purpose exactly and you know how it was gathered, but it costs time and effort and your sample may be small.
Secondary data already exists — government statistics, published research, a company's records. It is quick and often far larger, but it was collected for someone else's purpose, may be out of date, and you cannot check how carefully it was gathered.
| Method | Good for | Watch out for |
|---|---|---|
| Questionnaire | opinions from many people cheaply | leading questions; low response rates |
| Interview | depth and follow-up | slow; interviewer influence |
| Observation | what people do rather than say | people behave differently when watched |
| Sensors / automatic logging | large volumes, no human error | faulty sensors log plausible nonsense |
| Existing records | history you could not collect now | collected for another purpose |
Sampling, and how it goes wrong
You rarely measure everyone. A sample stands in for the whole population, and the conclusions are only as good as the sample is representative.
A random sample gives every member an equal chance of selection. A systematic sample takes every nth member. A stratified sample divides the population into groups — year groups, districts — and samples each in proportion, which is the safest when the groups differ.
Bias is anything that makes the sample unrepresentative. Surveying only students who own smartphones about internet use will overstate access; the people excluded are exactly the ones who would have changed the answer.
A larger sample does not fix bias
Increasing a biased sample from 100 to 10 000 gives you a more precise measurement of the wrong thing. Bias is a fault in who is being asked, not in how many. This distinction is worth a mark whenever a question describes a survey conducted in one place or among one group.
Presenting the finding
The chart is not decoration — it is the argument. Choosing the wrong type hides the very thing you are trying to show, and choosing a misleading scale is how statistics get a bad name.
| Chart | Use it for | Do not use it for |
|---|---|---|
| Bar chart | comparing separate categories | continuous data |
| Histogram | the distribution of continuous data | unrelated categories |
| Line graph | change over time | unordered categories |
| Pie chart | parts of one whole | comparing two different totals |
| Scatter plot | relationship between two variables | a single variable |
The same numbers shown three ways. The bar chart and histogram hold identical data, but only the histogram is honest about the classes being continuous — which is why the bars touch.
Correlation is not causation
Ice cream sales and drowning deaths rise together every summer. Neither causes the other — hot weather causes both. When a question asks what a scatter plot shows, the safe answer names the relationship and then says that a further investigation would be needed to establish a cause.
Before you leave this chapter
- Data → information (context) → knowledge (something you can act on).
- Primary data fits your question exactly; secondary data is faster and larger but was gathered for someone else.
- Cleaning takes longer than analysis, and skipping it produces confident wrong answers.
- Bias is about who you asked; a bigger sample does not cure it.
- Bar chart for categories, histogram for continuous data, line for time, pie for parts of a whole, scatter for relationships.
Describing a dataset before drawing conclusions
Before any chart, a few numbers summarise what the data looks like. Quoting them is what turns "the results were good" into a statement someone can check.
The mean is the arithmetic average and uses every value, so one extreme figure distorts it. The median is the middle value when sorted and ignores extremes entirely. The mode is the most common value and is the only one that works for categories such as favourite subject. The range and standard deviation describe how spread out the values are.
A shop records daily sales of 40, 42, 38, 41, 39 and 400 items. Which average describes a typical day, and why?
- The mean is
(40+42+38+41+39+400)/6 = 100items.Every value contributes, including the 400. - Sorted, the values are 38, 39, 40, 41, 42, 400, so the median is
(40+41)/2 = 40.5.Only the position of the middle values matters, not their size. - On five of the six days sales were between 38 and 42, so 100 describes no day at all.The mean has been dragged upward by a single unusual day.
- The median is the honest summary here, and the 400 should be investigated separately.An outlier is not noise to be deleted without thought — it may be a bulk order worth knowing about.
The median, 40.5 — the mean of 100 is distorted by one exceptional day.