Data Analyst Program

Statistics · Week 2 of 4 · 5 hours

Standard Deviation and Probability Basics

Measure how spread out data is, and reason about how likely events are.

Learning objectives

By the end of this week you will be able to:

  • Calculate range, variance and standard deviation.
  • Interpret a standard deviation in words.
  • Calculate basic probabilities from counts.
  • Distinguish independent events, and use the and/or rules.

Lessons

Standard Deviation

Two stores can have the same average delivery time but very different reliability. Store A: 4, 4, 4, 4, 4. Store B: 1, 2, 4, 6, 7. Both have a mean of 4, but Store B is unpredictable. Spread measures this.

Range = max − min. Store A: 0. Store B: 6. Simple, but it only uses two values.

Standard deviation is roughly the typical distance of each value from the mean. Step by step for Store B (mean 4):

  1. Distance from mean: −3, −2, 0, 2, 3
  2. Square each (so negatives do not cancel): 9, 4, 0, 4, 9
  3. Average the squares (this is the variance). For a sample, divide by n − 1: 26 / 4 = 6.5
  4. Take the square root: √6.5 ≈ 2.55 days

So deliveries at Store B typically land about 2.5 days away from the 4-day average. Store A's standard deviation is 0.

Excel: =STDEV.S(range) for a sample (the usual choice) and =STDEV.P(range) when you have the whole population. pandas: df["days"].std().

Interpreting it: a small standard deviation means values cluster tightly around the mean; a large one means they are scattered. Always report it next to the mean, in the same units.

Probability Basics

Probability is a number from 0 (impossible) to 1 (certain) describing how likely something is. It is often written as a percentage.

P(event) = number of ways it can happen / total number of equally likely outcomes

Rolling a 6 on a die: 1 / 6 ≈ 0.167. In business you usually estimate probability from data: if 45 of 900 website visitors bought something, P(purchase) = 45 / 900 = 0.05, a 5% conversion rate.

Key rules:

  • Complement: P(not A) = 1 − P(A). If 5% buy, 95% do not.
  • Or (events that cannot both happen): P(A or B) = P(A) + P(B). Rolling a 1 or a 2 = 1/6 + 1/6 = 1/3.
  • And (independent events): P(A and B) = P(A) × P(B). Two coin flips both heads = 0.5 × 0.5 = 0.25. Events are independent when one does not change the chance of the other.

Conditional probability is the chance of A given that B happened, written P(A | B). Example: of 200 mobile visitors, 6 bought; of 100 desktop visitors, 8 bought. P(buy | mobile) = 3%, P(buy | desktop) = 8%. Comparing conditional probabilities like this is everyday analyst work.

Watch

Practice

  1. Calculate the range and sample standard deviation by hand for 10, 12, 14, 16, 18, then check with STDEV.S.
  2. Two call centers each average 6 minutes wait. A has a standard deviation of 1 minute, B has 4. Write which one you would recommend and why.
  3. A store had 1,200 visitors: 300 on mobile (12 purchases) and 900 on desktop (54 purchases). Calculate P(purchase), P(no purchase), P(purchase | mobile) and P(purchase | desktop).

Check your understanding

Try each question first, then open it to see the answer.

Two datasets have the same mean. One has a standard deviation of 2, the other 10. What does that tell you?

The second is far more spread out and less predictable.

If P(rain) = 0.3, what is P(no rain)?

0.7.

What is the probability of flipping three heads in a row?

0.5 × 0.5 × 0.5 = 0.125 (12.5%).

Assignment

Submit your worked calculations and a short paragraph explaining standard deviation to a manager with no statistics background.