EC 285 - 2026-09-17 - Lecture 03

EC 285 - Lecture 03 - 2026-09-17

Introductory Statistics · Zara Liaqat · SB 106

Week 2 · 16:08-17:27 · 78 min · Full transcript · Flashcards

Overview

This lecture finished Chapter 2 (Descriptive Statistics). It started with a quick review of the measures of center and spread and a look at the range. Next it went through variance and standard deviation in detail: what the formula means, why it squares the gaps, and the population and sample symbols. Then it covered the coefficient of variation, covariance and correlation, and ended with a practice problem that finds the mean, standard deviation and percentiles from a frequency table.

Review: center and spread

This section picks up where Lecture 02 stopped, which was at percentiles and quartiles.

Center and spread

Why: Once you know roughly where the middle is, the next question is how far the other values sit from it. Two data sets can have the same center and very different spread.

Range

The range is the maximum value minus the minimum value.

Why: It is quick to compute, but it only uses the two most extreme values. So it is driven by outliers and tells you nothing about how the values between them are spread. The lecturer said that in her opinion it is "not very useful". You can still report it.

Range=xmax−xmin

where xmax is the largest value and xmin is the smallest.
Not on any formula sheet, so memorise it.

Example: range of test grades

The highest grade in a class is 90 and the lowest is 10.

  1. 90−10=80 -- subtract the minimum from the maximum

Answer: 80 -- this doesn't say whether most students scored near 50 or were split between the two ends.

She had skipped the range last class because it is simple: "well, you should know that."

Quartiles

Quartiles are special percentiles that split the ranked data into four parts, each holding 25% of the values. Q1 is the 25th percentile, Q2 is the 50th and Q3 is the 75th.

Why: Q2 is the median, so 50% of the observations sit above it and 50% sit below it. You find all of them with the percentile formula from Lecture 02 (worked in the practice problem below).

Variance and standard deviation

These are the two most widely used measures of spread. They show up in every chapter from here to the end of the course.

Variance and standard deviation

The variance is the average of the squared deviations (gaps) of the values from the mean. The standard deviation is the square root of the variance. Both measure how much the data spread out around the average.

Why: Here is the lecturer's way to remember it: "the average of squared deviations from the average." Take each value's gap from the mean, square it, add them up, and average. The gaps are squared because some values sit below the mean and some above. Without squaring, the positive and negative gaps would cancel out. In fact, the gaps from the mean always add up to exactly 0. On slide 12 they are −6,−4,−2,−1,1,2,2 and 8, which add up to 0. So their average would always be 0 and would tell you nothing about the spread. Squaring makes every observation count, and it puts extra weight on values far from the mean. The downside is that every observation affects the result, so outliers push the standard deviation up. The standard deviation is often preferred to the variance because it is in the same units as the data, which makes it easier to read.

Population:

σ2=∑i=1N(xi−μ)2Nσ=∑i=1N(xi−μ)2N

Sample:

s2=∑i=1n(xi−x¯)2n−1s=∑i=1n(xi−x¯)2n−1

where xi is the i-th value, μ is the population mean, x¯ is the sample mean, N is the population size and n is the sample size.
Not on any formula sheet (population or sample), so memorise all four.

A student mentioned the empirical rule. For bell-shaped data, about 68% of values fall within one standard deviation of the mean, about 95% within two and about 99.7% within three. The lecturer said about 99% fall within three, which matches the standard 99.7% once rounded. The lecturer said it was "too complicated" for now and moved on.

Example: sample standard deviation (slide 12)

The sample data are 10, 12, 14, 15, 17, 18, 18 and 24, so n=8.

  1. x¯=10+12+14+15+17+18+18+248=1288=16 -- find the mean first, because the formula needs it
  2. Deviations: −6,−4,−2,−1,1,2,2,8 -- subtract 16 from each value
  3. Squared: 36,16,4,1,1,4,4,64 -- square each gap so they can't cancel
  4. 36+16+4+1+1+4+4+64=130 -- add them up (this is the numerator)
  5. s2=1308−1=1307=18.57 -- divide by n−1 to get the variance
  6. s=18.57=4.3095 -- take the square root to get the standard deviation

Answer: s=4.31 -- the values sit about 4.3 units from the mean of 16 "on average". If a question asks for the variance, stop at step 5. (In class she said "134/7" for the variance, but the slide's own numbers give 130/7.)

Exam

The variance and standard deviation formulas are "not going to be listed on the formula sheet and there will almost certainly be questions on the exam, so you should remember the formula." She said to practise until you can write the formula without looking.
On calculators: "a lot of students know how it's done, but they make a mistake on the calculator. They forget to put a bracket or square it for one of the terms." On a multiple-choice question, one slip loses all the points. Bring the calculator you'll use on the exam, work the numerator first, and "do it once, and then do it one more time." Don't miss any observation, the square, the n−1 or the square root. Rounding to two decimal places is fine. On paper you can write "..." for the middle terms, like the slide does, but your calculator needs every term.

Population and sample symbols

Why: This is the parameter versus statistic idea from Lecture 01. The memory trick is "S stands for sample." Greek letters are for the population, which we almost never observe, so in this course you will nearly always use the sample formulas.

Exam

"All the symbols, the letters that you see on this slide, you should remember. Memorize all of them." Even when a formula is on the formula sheet, "I won't define them. So you should know what they are."

Why divide by n minus 1

The sample variance divides by n−1 instead of n. The population version divides by N.

Why: The lecturer said statisticians have proved that n−1 gives a better estimate, especially when the sample is small. The standard intuition is that the gaps are measured from x¯, which is computed from the same sample. That makes them come out a little too small, and dividing by a slightly smaller number corrects for it.

Exam

"We will always be dealing with samples, so you have to subtract 1."

Coefficient of variation

This is the fifth and last measure of spread.

Coefficient of variation

The coefficient of variation (CV) is the standard deviation divided by the mean, written as a percentage.

Why: A standard deviation is in the data's own units, which could be dollars, millions or months. So you can't directly compare the spread of two data sets measured differently. The CV has no units because it is always a percent, which makes it useful for comparing several data sets. The higher the CV, the bigger the spread around the average. She described it as a number between 0 and 100. It usually is, but it can go above 100% when the standard deviation is bigger than the mean. You'll only ever use the sample version, because the population values are unknown.

CV=(sx¯)⋅100%(population: CV=(σμ)⋅100%)

where s is the sample standard deviation and x¯ is the sample mean.
The sample CV is on the formula sheet for: Midterm 1. The population CV is not on any formula sheet.

Made-up example: CV for the slide 12 data

She suggested finding the CV for the standard deviation example but didn't work it. That data had s=4.3095 and x¯=16.

  1. CV=4.309516⋅100% -- put the standard deviation over the mean
  2. 4.309516=0.2693 -- divide
  3. 0.2693⋅100%=26.93% -- turn it into a percent

Answer: CV=26.93% -- the typical gap from the mean is about 27% of the mean itself.

Covariance and correlation

These don't measure spread. They measure how two variables, X and Y, move together.

Covariance

Covariance measures the direction of the linear relationship between two variables.

Why: For each observation, you multiply X's gap from its mean by Y's gap from its mean. When both are above or both are below their means, the product is positive. When one is above and the other below, it is negative. Averaging these products shows which case dominates.

sxy=∑i=1n(xi−x¯)(yi−y¯)n−1σxy=∑i=1N(xi−μx)(yi−μy)N

where x¯ and y¯ are the sample means of X and Y. The second formula is the population version.
The population version (σxy) is on the formula sheet for: Midterm 1, Midterm 2. The sample version (sxy, divide by n−1) is not on any formula sheet, so memorise it.

Exam

"There's a complicated formula to find covariance. I'll put that on the formula sheet so you don't have to remember this." You still need to know what each symbol means.

Correlation coefficient

The correlation coefficient measures both the direction and the strength of the linear relationship. It is always between −1 and +1.

Why: Covariance depends on the units of X and Y, so its size is hard to interpret. Dividing by both standard deviations removes the units and squeezes the result into the range from −1 to 1.

r=Cov(x,y)sxsyρ=Cov(x,y)σxσy

where r is the sample correlation, ρ ("rho") is the population correlation, and sx and sy are the standard deviations of X and Y. You find the covariance first, then divide.
The population version (ρ) is on the formula sheet for: Midterm 1, Midterm 2. The sample version (r) is not on any formula sheet. It has the same shape, but with the sample covariance sxy (divide by n−1) on top and sxsy on the bottom.

Examples from class:

Example: grocery spending and disposable income (slide 17)

Five people (A to E). Weekly grocery spending x: 115, 120, 150, 165, 190. Weekly disposable income y: 400, 460, 480, 420, 500. The slide uses the population formulas.

  1. μx=115+120+150+165+1905=7405=148 -- mean of x
  2. μy=400+460+480+420+5005=22605=452 -- mean of y
  3. xi−μx: −33,−28,2,17,42 and yi−μy: −52,8,28,−32,48 -- the gaps from each mean
  4. Products: 1716,−224,56,−544,2016 -- multiply each person's x gap by their y gap
  5. 1716−224+56−544+2016=3020 -- add the products
  6. Cov(x,y)=30205=604 -- divide by N=5
  7. σx=1089+784+4+289+17645=39305=786=28.036 -- standard deviation of x
  8. σy=2704+64+784+1024+23045=68805=1376=37.095 -- standard deviation of y
  9. ρ=60428.036×37.095=6041040.0=0.581 -- divide the covariance by both standard deviations

Answer: ρ=0.58 -- a positive, moderately strong relationship: people with more income tend to spend more on groceries.

She showed this table to show how the formula is applied step by step (she built it in Excel). She said that without a computer on the exam, "I won't ask you to do this" by hand.

Exam

The correlation formula will be on the formula sheet: "I will put this formula on the formula sheet." She won't define the symbols there, so know that the bottom is the standard deviation of x times the standard deviation of y.

Correlation and causation

Even when two variables are correlated, one doesn't necessarily cause the other. This is the same distinction as in Lecture 01.

Correlation only sees straight lines

Correlation and covariance only measure the strength of a linear (straight-line) relationship. A correlation near zero doesn't mean there is no relationship. It means there is no straight-line relationship.

Why: On slide 19, ρ=−0.1540, yet the scatter plot is clearly U-shaped. It falls steeply and then rises steeply. The strong negative part and the strong positive part cancel out when combined into one straight-line measure. A student suggested splitting the data at the bottom of the U. That is true, but the answer she wanted was simply: "correlation measures the strength of the linear relationship. This is non-linear."

Exam

Nobody in the room could answer this, and she said: "I also note that down that nobody was able to answer that, so potentially I ask this on the exam." Know that "correlation goes to zero doesn't always mean that there's no relationship."

Practice problem: pairs of shoes

This problem is from the textbook and mixes Chapters 1 and 2. Randomly chosen people were asked how many pairs of shoes they own. X is the number of pairs and f is the frequency.

x 1 2 3 4 5 6 7
f 2 5 8 12 12 0 1

Questions: (a) the sample mean and standard deviation, (b) a histogram, (c) the first quartile and the median, (d) the percent who own at least five pairs, (e) the 90th percentile. She added the mode as an extra question.

Reading a frequency table

The x row lists the possible answers. The f row counts how many people gave each answer. For example, 12 people said "five pairs". The sample size is the sum of all the frequencies. Because the people were randomly selected, this is a sample, so use the sample formulas.

Example: mode and sample size

  1. Mode: the highest frequency is 12, which appears for both x=4 and x=5 -- the mode is the x value, not the count
  2. n=2+5+8+12+12+0+1=40 -- add the frequencies to count the people

Answer: The mode is 4 and 5, so the data are bimodal. 40 people were surveyed.

Exam

Students in class answered "12" for the mode and "7" or "8" for the sample size. Both are wrong. "Your mean, median, mode must be in units of x." "Make sure you can read a chart like this, you understand what f means, what x means."

Weighted mean

When data come in a frequency table, you multiply each value by how often it appears, add the results, and divide by the total count.

Why: The table is shorthand for the raw list: two 1s, five 2s, eight 3s, and so on. Multiplying by f is the same as adding each value as many times as it appears. So values that show up more often get more weight.

x¯=∑i=1kfixi∑i=1kfi=∑i=1kfixin

where xi is each distinct value, fi is its frequency, k is the number of distinct values (here k=7) and n=∑fi is the sample size.
Not on any formula sheet, so memorise it.

Example: mean number of pairs of shoes

  1. ∑fixi=1(2)+2(5)+3(8)+4(12)+5(12)+6(0)+7(1) -- weight each value by its frequency
  2. =2+10+24+48+60+0+7=151 -- add the products
  3. x¯=15140=3.775 -- divide by n=40, not by 7

Answer: x¯=3.775 pairs -- the average person in the sample owns just under four pairs.

Standard deviation from a frequency table

This is the same sample standard deviation formula, except each squared gap is multiplied by its frequency before you add them up.

Why: It is still "the average of squared deviations from the average". Each value's squared gap just needs to be counted as many times as that value appears.

s=∑i=1kfi(xi−x¯)2n−1

where fi is the frequency of value xi, x¯ is the weighted mean and n=∑fi.
Not on any formula sheet, so memorise it.

Example: standard deviation of pairs of shoes

She gave only the final answer (1.29). These are the steps, using x¯=3.775 and n=40.

  1. x=1: 2(1−3.775)2=2(7.700625)=15.40125 -- squared gap times its frequency
  2. x=2: 5(2−3.775)2=5(3.150625)=15.753125
  3. x=3: 8(3−3.775)2=8(0.600625)=4.805
  4. x=4: 12(4−3.775)2=12(0.050625)=0.6075
  5. x=5: 12(5−3.775)2=12(1.500625)=18.0075
  6. x=6: 0(6−3.775)2=0 -- nobody answered 6
  7. x=7: 1(7−3.775)2=1(10.400625)=10.400625
  8. 15.40125+15.753125+4.805+0.6075+18.0075+0+10.400625=64.975 -- add them up
  9. s2=64.97540−1=64.97539=1.666 -- divide by n−1
  10. s=1.666=1.29 -- take the square root

Answer: s=1.29 pairs -- a typical person's count is about 1.3 pairs away from the mean of 3.775.

Percentiles from a frequency table

The P-th percentile is the value in the (P/100)(n+1)-th position of the ordered data. That formula only gives a position, not the answer. You then count down the frequencies (running totals) until you reach that position and read off the x value there.

Why: A percentile is the value with P% of the data below it. Because the table is already in ascending order, the running totals of f tell you which x value sits at each position.

Position of P-th percentile=P100(n+1)

where P is the percentile you want and n is the sample size.
Not on any formula sheet, so memorise it.

The running totals for this table are 2, 7, 15, 27, 39, 39 and 40. So positions 1–2 hold x = 1, positions 3–7 hold x = 2, positions 8–15 hold x = 3, positions 16–27 hold x = 4 and positions 28–39 hold x = 5.

Example: first quartile

  1. 25100(40+1)=0.25×41=10.25 -- Q1 is the 25th percentile, so find its position
  2. Count down: 2, 2+5=7, 7+8=15 -- position 10.25 falls between 8 and 15

Answer: Q1=3 pairs -- the answer is the x value, not 10.25. A student tried dividing 40 by 4. That skips the n+1, so it isn't the method.

Example: median

  1. 50100(40+1)=0.5×41=20.5 -- the median is the 50th percentile
  2. Count down: 15, then 15+12=27 -- position 20.5 falls between 16 and 27

Answer: Median = 4 pairs.

Example: 90th percentile

  1. 90100(40+1)=0.9×41=36.9 -- the position of the 90th percentile
  2. Count down: 27, then 27+12=39 -- position 36.9 falls between 28 and 39

Answer: 90th percentile = 5 pairs.

Example: percent owning at least five pairs

  1. 12+0+1=13 -- people with 5, 6 or 7 pairs
  2. 1340=0.325 -- divide by the sample size

Answer: 32.5% own at least five pairs.

Histogram

She didn't work part (b) in class. She called it easy because every bar is a single x value with equal widths: x along the bottom and frequency as the height.

Example: histogram of pairs of shoes

These are the steps, since she didn't draw it.

  1. Put x (pairs of shoes, 1 to 7) along the bottom -- one bar per x value, all the same width
  2. Put frequency (f) up the side, from 0 to 12 -- the biggest f is 12
  3. Make each bar as tall as its f: 2, 5, 8, 12, 12, 0, 1 -- the bars sit side by side with no gaps
  4. Leave x = 6 empty -- nobody owns six pairs, so its height is 0, but 6 still keeps its spot on the axis

Answer: the histogram below. The two tallest bars, at 4 and 5, are the two modes you found above.

\begin{document}
\begin{tikzpicture}[x=1cm, y=0.4cm]
% Light grid every 2 people, so bar heights are easy to read.
\foreach \y in {2,4,...,12}
\draw[black!40, dashed] (0.5,\y) -- (7.5,\y);
% One bar per x value. Each bar is 1 wide and centred on its x, so neighbours touch.
% x = 6 has f = 0: no bar, but it keeps its place on the axis.
\foreach \x/\h in {1/2, 2/5, 3/8, 4/12, 5/12, 6/0, 7/1} {
\ifnum\h>0
\filldraw[fill=blue!45!white, draw=black] (\x-0.5,0) rectangle (\x+0.5,\h);
\fi
\node[above] at (\x,\h) {\small $\h$};
\node[below] at (\x,0) {$\x$};
}
% Axes and labels.
\draw[->] (0.5,0) -- (7.9,0);
\draw[->] (0.5,0) -- (0.5,13.6);
\foreach \y in {0,2,...,12}
\node[left] at (0.5,\y) {\small $\y$};
\node at (4,-2.6) {Pairs of shoes owned ($x$)};
\node[rotate=90] at (-0.6,6.5) {Frequency ($f$)};
\end{tikzpicture}
\end{document}
Exam

"Your concepts should be very clear on what quartiles, percentiles, median, what do they mean, and the process of finding it." First put the data in ascending order. Then use the formula to get the position. Then find the x at that position: "this is not the answer. It's not the final answer." She called the whole problem "a really good question because it's testing everything". Solve it all at home.

Exam checklist

Admin & deadlines


Transcribed automatically from the lecture recording. Slides used: EC 285 - Ch. 02 - Descriptive Statistics (slides).pdf. Course info used: EC 285 - Syllabus - Fall 2026.pdf. Audio archived at /mnt/porsche/configs/lectures/archive/2026-09/EC 285 - 2026-09-17 - Lecture 03.opus.