From data to information
Data is raw recorded fact that has no inherent interpretation: a day's takings, an order, actions taken, a customer's postcode. Information is meaning created out of data. A notebook of daily takings is data. "A normal day brings in about RM320" is information. The higher quality and breadth of information you have, the better decisions you can make.
Say you run a nasi lemak stall in Seremban and write down each day's sales. You want to know what a normal day looks like, whether business is growing, and whether a new menu photo brings more orders.
| Day | Sales (RM) |
|---|---|
| 1 | 300 |
| 2 | 270 |
| 3 | 310 |
| 4 | 300 |
| 5 | 340 |
| 6 | 360 |
| 7 | 920 |
| 8 | 320 |
| 9 | 330 |
| 10 | 350 |
| Total | 3,800 |
Clean before counting
Data cleaning is finding and fixing faults in the data before any sum is done. The common faults are duplicates (a sale entered twice), missing values (a day left blank, which is different from a day with zero sales), mixed labels ("NL ayam" and "nasi lemak ayam" counted as two products) and typing slips. You first wrote day 4 as 3,000. Your receipts for the day showed RM300, so you corrected the entry.
Day 7 is different. RM920 is far from every other day, which makes it an outlier. You check, and the figure is right: you had a catering order. A wrong outlier is corrected. A true outlier is kept and read separately, because it describes a different kind of day.
What a typical day looks like
Descriptive statistics sum a set of numbers up in a few figures.
| Measure | Meaning | All 10 days | 9 ordinary days |
|---|---|---|---|
| Mean | The total divided by the count | 3,800 ÷ 10 = 380 | 2,880 ÷ 9 = 320 |
| Median | The middle value when sorted | 325 | 320 |
| Mode | The value that occurs most often | 300 | 300 |
| Range | Highest minus lowest | 920 − 270 = 650 | 360 − 270 = 90 |
| Standard deviation | The typical distance of a day from the mean | About 192 | About 28 |
Sorted, the ten days are 270, 300, 300, 310, 320, 330, 340, 350, 360, 920. With an even count the median is halfway between the two middle values, 320 and 330.
One catering day lifts the mean from 320 to 380. Your stall beat RM380 on only one day in ten, so a conclusion of "RM380 every day" is not true. When data holds outliers, the median describes the usual case better than the mean.
The standard deviation says how tightly the days cluster. On the 9 ordinary days it is about RM28, so most days land between roughly RM290 and RM350. If you see a RM250 on a day, it's time to investigate.
Be aware of percentages and rates
A percentage is a share out of 100, and every percentage has a base: the figure it is a share of. A rise from RM320 to RM352 is RM32 on a base of RM320, which is 10%. A fall from RM352 back to RM320 is RM32 on a base of RM352, which is 9.1%. The ringgit are the same and the percentages differ, so "up 10%, then down 10%" does not return to the start.
A rate is a count set against the size of the group it came from, such as orders per 100 customers messaged. Rates allow a fair comparison between groups of different sizes. When two rates are compared, the gap is given in percentage points: from 10% to 20% is a rise of 10 percentage points, and it is also a doubling.
Be aware of trend and seasonality
A trend is the long-run direction of a figure. Seasonality is a pattern that repeats with the calendar: weekends, school holidays, festive months, the end of the month before payday.
In the fasting month your morning stall took RM6,600, against RM8,250 the month before. That is a fall of 20%, and read alone it looks like trouble. The fasting month the year before took RM6,000. Against the same season, sales are up 10%. Comparing a period with the same period a year earlier is a year-on-year comparison, and it is the plain way to see a trend through a season.
Correlation is not causation
Correlation means two figures tend to rise and fall together. Causation means one produces the change in the other. Correlation is easy to find and proves little.
You notice that on days you post on Facebook, sales are higher. You post mostly on Saturdays and Sundays, when sales are higher anyway. The weekend is a confounding variable: a third factor driving both. The correlation is real, and whether the posts cause anything is still unknown. To find out, you would have to change the posting and hold the rest steady.
A/B testing to improve precision of data
An A/B test does exactly that. Two versions are shown to two similar groups over the same period, with one difference between them, and the results are compared. You send your weekend pre-order message to 400 customers, split at random. Group A gets the usual text. Group B gets the same text with a photo of the sambal.
| Sent | Ordered | Rate | |
|---|---|---|---|
| A: text only | 200 | 20 | 10% |
| B: text with photo | 200 | 40 | 20% |
The photo doubled the order rate. Whether to believe that depends on sample size, the number of cases behind a figure. Had you tried the message on 20 customers each and seen 2 orders against 4, the rates would be the same 10% and 20%, and a gap of 2 orders turns up by luck all the time. With 200 in each group, a gap this wide would arise by luck less than once in a hundred tries. Statisticians call such a result statistically significant: unlikely to be chance alone. The working rule for you is that small samples swing wildly, so a result from a handful of cases is a reason to test again with more.
The random split matters as much as the size. If group B were your regulars and group A new numbers, the test would measure loyalty.
Now you are better at data science
Trained this way, you treat a number as a claim to be checked. Is the data clean? Is the average a mean or a median, and what did the outliers do to it? A percentage of what base? Compared with which period? How many cases? Could something else explain it? You now plan on RM320 a day and treat catering as a separate line. You did not cut your hours after a quiet fasting month, and you kept the photo. Each of those decisions would have gone the other way on a first glance at the same notebook.