Data & Statistics

Study Sheet

Data & Statistics

Center, spread, displays, scatter plots, correlation, and two-way tables

Measures of Center

Concept
The three averages

A measure of center is a single number that describes the “middle” of a data set.

  • [leftmargin=1.4em,itemsep=2pt]
  • Mean (the “average”): add all the values, then divide by how many there are. @@BLOCK0@@
  • Median: the middle value after the data is put in order. If there is an even number of values, average the two middle ones.
  • Mode: the value that appears most often. A set can have no mode, one mode, or several.
Example
Worked example: all three centers

Find the mean, median, and mode of:   7, 3, 9, 5, 6, 9, 3, 97,\ 3,\ 9,\ 5,\ 6,\ 9,\ 3,\ 9.

Mean: sum =7+3+9+5+6+9+3+9=51= 7+3+9+5+6+9+3+9 = 51, and there are 88 values, so

mean=518=6.375.\text{mean} = \frac{51}{8} = 6.375.

Median: order the data first: 3, 3, 5, 6, 7, 9, 9, 93,\ 3,\ 5,\ 6,\ 7,\ 9,\ 9,\ 9. With 88 values the two middle ones are the 44th and 55th: 66 and 77.

median=6+72=6.5.\text{median} = \frac{6+7}{2} = 6.5.

Mode: 99 appears three times, more than any other value, so the mode is 99.

Concept
Which center is “best”?
  • [leftmargin=1.4em,itemsep=2pt]
  • Use the mean when the data is fairly even with no extreme values.
  • Use the median when there are outliers (values far from the rest), because the median is not pulled toward them.
  • Use the mode for categories or “most popular” questions (favorite color, most common shoe size).

An outlier is a value much larger or smaller than the rest of the data.

Tip

Remember: Always order the data before finding the median. An outlier drags the mean toward itself but barely moves the median. Example: for 2,4,6,82,4,6,8 the mean is 55; change the 88 to 8080 and the mean jumps to 2323, but the median only moves from 55 to 55.

Measures of Spread

Concept
Range, quartiles, and IQR
3456789

A measure of spread tells how spread out the data is.

  • [leftmargin=1.4em,itemsep=2pt]
  • Range == maximum - minimum.
  • Quartiles split ordered data into four equal parts. Q2Q2 is just the median. Q1Q1 (the lower quartile) is the median of the lower half; Q3Q3 (the upper quartile) is the median of the upper half.
  • Interquartile range (IQR) =Q3Q1= Q3 - Q1. It measures the spread of the middle 50%50\% of the data and ignores outliers.

One outlier drags the mean but not the median.

Example
Worked example: quartiles and IQR

Find the range, quartiles, and IQR of the ordered data

3, 5, 7, 8, 12, 13, 14, 18, 21.3,\ 5,\ 7,\ 8,\ 12,\ 13,\ 14,\ 18,\ 21.

There are 99 values. Range =213=18= 21 - 3 = 18.

The median (Q2Q2) is the 55th value: 1212.

Lower half (values below the median): 3,5,7,83,5,7,8. Its median is Q1=5+72=6Q1 = \frac{5+7}{2} = 6.

Upper half (values above the median): 13,14,18,2113,14,18,21. Its median is Q3=14+182=16Q3 = \frac{14+18}{2} = 16.

IQR=Q3Q1=166=10.\text{IQR} = Q3 - Q1 = 16 - 6 = 10.
Tip

Tip: When the number of values is odd, do not include the middle value in either half when finding Q1Q1 and Q3Q3. When it is even, split the ordered list exactly in half.

Five-Number Summary & Box Plots

Concept
The five-number summary

The five-number summary lists, in order:

minimum,Q1,median,Q3,maximum.\text{minimum},\quad Q1,\quad \text{median},\quad Q3,\quad \text{maximum}.

A box-and-whisker plot draws these five numbers on a number line: a box stretches from Q1Q1 to Q3Q3 with a line at the median, and whiskers reach out to the minimum and maximum. The box holds the middle 50%50\% of the data.

Example
Reading a box plot

Using the example above, the five-number summary is

min=3,Q1=6,median=12,Q3=16,max=21.\min = 3,\quad Q1 = 6,\quad \text{median} = 12,\quad Q3 = 16,\quad \max = 21.

So the box runs from 66 to 1616, with a line at 1212. The left whisker reaches 33 and the right whisker reaches 2121. Because the right whisker (1616 to 2121) is a bit longer than the left, the data is slightly skewed right. Half of all values lie between 66 and 1616.

Tip

Outlier rule (advanced): A value is usually called an outlier if it is more than 1.5×IQR1.5 \times \text{IQR} below Q1Q1 or above Q3Q3.

Displaying Data & Describing Shape

Concept
Four ways to picture data
  • [leftmargin=1.4em,itemsep=2pt]
  • Dot plot: one dot per data value stacked above a number line. Great for small sets; the mode is the tallest stack.
  • Stem-and-leaf plot: each value is split into a stem (the leading digits) and a leaf (the last digit). Keeps every original value.
  • Frequency table: lists each value or interval and how many times it occurs (its frequency).
  • Histogram: a bar graph for intervals of data, with bars touching. The height of each bar is the frequency of that interval.
Example
Frequency table and stem-and-leaf

Test scores: 82,75,91,88,75,91,63,88,9182, 75, 91, 88, 75, 91, 63, 88, 91.

A frequency table (grouped by tens):

The same data as a stem-and-leaf plot (stem == tens digit):

The mode is 9191 (three leaves of 11 on the stem 99).

Concept
Describing the shape
  • [leftmargin=1.4em,itemsep=2pt]
  • Symmetric: the left and right sides roughly mirror each other (a “bell” shape peaks in the middle).
  • Skewed right: a long tail stretches toward the high values; most data sits on the left.
  • Skewed left: a long tail stretches toward the low values; most data sits on the right.
Tip

Tip: In a right-skewed set the mean is pulled above the median; in a left-skewed set the mean is pulled below the median. In a symmetric set the mean and median are about equal.

Scatter Plots & Correlation

Concept
Plotting paired data

A scatter plot graphs pairs of data (x,y)(x, y) as points. It shows whether two quantities are related. The correlation describes the pattern:

  • [leftmargin=1.4em,itemsep=2pt]
  • Positive: as xx increases, yy tends to increase (points rise from left to right).
  • Negative: as xx increases, yy tends to decrease (points fall from left to right).
  • No correlation: no clear upward or downward pattern.

Correlation can also be strong (points hug a line tightly) or weak (points are loosely scattered).

Example
Reading a scatter plot

A study records hours of sleep (x)(x) and a reaction-time score (y)(y) for several students. As sleep increases, the reaction-time score steadily rises, and the points cluster closely along a rising line. This is a strong positive correlation: more sleep is associated with better scores.

Tip

Big idea: correlation \neq causation. Two things can rise together without one causing the other. Ice-cream sales and swimming-pool accidents both climb in summer, but ice cream does not cause accidents --- hot weather (a “lurking variable”) drives both.

Line of Best Fit: Slope & Intercept

Concept
Trend lines and predictions

A line of best fit (or trend line) is a straight line that comes as close as possible to the points of a scatter plot with a linear pattern. Written as y=mx+by = mx + b:

  • [leftmargin=1.4em,itemsep=2pt]
  • The slope mm is the predicted change in yy for each 11-unit increase in xx (a rate).
  • The yy-intercept bb is the predicted value of yy when x=0x = 0 (a starting amount).

Plug an xx-value into the equation to predict a yy-value.

Example
Interpreting slope and intercept

A trend line for a plant's height (cm) after xx weeks is

y=3x+8.y = 3x + 8.

Predict the height at week 55:  y=3(5)+8=23\ y = 3(5) + 8 = 23 cm.

Slope =3= 3: the plant grows about 33 cm each week.

Intercept =8= 8: the plant was about 88 cm tall at week 00 (when it was planted).

Tip

Tip: Predictions made within the range of the data are usually reliable. Predicting far outside the data (called extrapolation) can give silly answers --- that plant will not keep growing 33 cm a week forever!

Two-Way Frequency Tables

Concept
Reading a two-way table

A two-way frequency table sorts data by two categories at once (rows and columns).

  • [leftmargin=1.4em,itemsep=2pt]
  • A joint frequency is a count inside the table (one row and one column).
  • A marginal frequency is a row total or column total (found in the margins).
  • The grand total (bottom-right corner) is the total number of items surveyed.
Example
A survey table

Students were asked whether they walk or ride the bus to school:

Joint: 1414 sixth-graders walk.   Marginal: 4040 students are in Grade 6, and 4747 students total ride the bus.   Grand total: 7070 students were surveyed.

Tip

Check: The row totals add to the grand total and the column totals add to the grand total. Here 40+30=7040 + 30 = 70 and 23+47=7023 + 47 = 70. If they don't match, recount!

Going Deeper: Advanced Statistics

Center and spread are only the beginning. This section pushes into the tools that show up on advanced exams and in real data analysis: variance and standard deviation, formal outlier fences, reading the correlation coefficient, making and judging predictions, weighted averages, and residuals.

One outlier drags the mean but not the median.

Concept
Variance & standard deviation: spread around the mean

The range and IQR describe spread using just a few values. Standard deviation uses every value, measuring the typical distance from the mean.

  • [leftmargin=1.4em,itemsep=2pt]
  • A deviation is how far one value sits from the mean: xxˉx - \bar{x} (where xˉ\bar{x} is the mean).
  • The variance σ2\sigma^2 is the average of the squared deviations. We square so that positive and negative gaps don't cancel out.
  • The standard deviation σ\sigma is the square root of the variance, returning to the original units.
σ2=(xxˉ)2n,σ=σ2.\sigma^2 = \frac{\sum (x - \bar{x})^2}{n}, \qquad \sigma = \sqrt{\sigma^2}.

A small standard deviation means values cluster near the mean; a large one means they are widely spread.

Example
Worked example: computing standard deviation

Find the standard deviation of  4, 8, 6, 5, 2\ 4,\ 8,\ 6,\ 5,\ 2.

Step 1 --- mean:  xˉ=4+8+6+5+25=255=5.\ \bar{x} = \dfrac{4+8+6+5+2}{5} = \dfrac{25}{5} = 5.

Step 2 --- squared deviations (organized in a table):

Step 3 --- variance: average the squared deviations:

σ2=1+9+1+0+95=205=4.\sigma^2 = \frac{1+9+1+0+9}{5} = \frac{20}{5} = 4.

Step 4 --- standard deviation:  σ=4=2.\ \sigma = \sqrt{4} = 2.

So the values sit, on average, about 22 units away from the mean of 55.

Tip

Population vs. sample: Dividing by nn gives the population standard deviation σ\sigma. When your data is only a sample of a larger group, statisticians divide by n1n-1 instead (the sample standard deviation ss); this slightly larger value corrects for the sample underestimating the true spread. Check which one a problem asks for.

Concept
Outlier fences: the 1.5×IQR1.5 \times \text{IQR} rule

Earlier we named outliers informally. Here is the formal test. From the five-number summary, compute IQR=Q3Q1\text{IQR} = Q3 - Q1, then build two fences:

lower fence=Q11.5(IQR),upper fence=Q3+1.5(IQR).\text{lower fence} = Q1 - 1.5\,(\text{IQR}), \qquad \text{upper fence} = Q3 + 1.5\,(\text{IQR}).

Any value below the lower fence or above the upper fence is an outlier. On a box plot, these are drawn as separate dots, and the whiskers only reach to the most extreme values still inside the fences.

Example
Worked example: hunting for an outlier

A data set has five-number summary

min=4,Q1=10,median=15,Q3=18,max=40.\min = 4,\quad Q1 = 10,\quad \text{median} = 15,\quad Q3 = 18,\quad \max = 40.

Step 1 --- IQR:  IQR=Q3Q1=1810=8.\ \text{IQR} = Q3 - Q1 = 18 - 10 = 8.

Step 2 --- fences:

lower fence=101.5(8)=1012=2,upper fence=18+1.5(8)=18+12=30.\begin{aligned} \text{lower fence} &= 10 - 1.5(8) = 10 - 12 = -2, \\ \text{upper fence} &= 18 + 1.5(8) = 18 + 12 = 30. \end{aligned}

Step 3 --- compare: The minimum 44 is above 2-2, so it is fine. But the maximum 4040 is above the upper fence of 3030, so 4040 is an outlier. On the box plot, the right whisker stops at the largest value at or below 3030, and 4040 is marked as its own dot.

Concept
The correlation coefficient rr

The words “strong” and “weak” can be made precise with the correlation coefficient rr, a number between 1-1 and 11 that measures how tightly points cluster around a straight line.

  • [leftmargin=1.4em,itemsep=2pt]
  • The sign of rr gives the direction: r>0r > 0 is positive correlation, r<0r < 0 is negative.
  • The size of r|r| gives the strength: near 11 (or 1-1) the points hug a line; near 00 there is little linear pattern.
  • r=1r = 1 or r=1r = -1 means the points lie exactly on a line; r=0r = 0 means no linear relationship.

Rough guide: r0.8|r| \ge 0.8 is strong, 0.5r<0.80.5 \le |r| < 0.8 is moderate, and r<0.5|r| < 0.5 is weak.

Tip

Warning --- rr measures linear fit only. A tight U-shaped or curved pattern can have rr near 00 even though the two variables are strongly related. And, as before, a large r|r| still does not prove causation --- it only measures how well a line describes the cloud of points. A lurking variable can inflate rr without either variable causing the other.

Example
Worked example: predicting with a line of best fit

A shop fits the trend line  y=2.5x+40\ y = 2.5x + 40 relating advertising spending xx (in hundreds of dollars) to weekly sales yy (in units), with r=0.86r = 0.86.

Predict sales when the shop spends $600600 on ads, so x=6x = 6:

y=2.5(6)+40=15+40=55 units.y = 2.5(6) + 40 = 15 + 40 = 55 \text{ units}.

Interpret the slope 2.52.5: each extra $100100 of advertising (a 11-unit rise in xx) is associated with about 2.52.5 more units sold per week.

Interpret the intercept 4040: with no advertising (x=0x = 0), the model predicts about 4040 units sold --- a baseline level of sales.

Judge the fit: r=0.86r = 0.86 means r0.8|r| \ge 0.8, a strong positive linear relationship, so this prediction is trustworthy within the data range. Predicting sales for $10,00010{,}000 of ads would be risky extrapolation.

Concept
Residuals: how wrong is a prediction?

A residual measures the error at a single data point:

residual=actual ypredicted y.\text{residual} = \text{actual } y - \text{predicted } y.
  • [leftmargin=1.4em,itemsep=2pt]
  • A positive residual means the actual value is above the line (the model under-predicted).
  • A negative residual means the actual value is below the line (the model over-predicted).
  • A residual of 00 means the point lands exactly on the line.

The line of best fit is precisely the line that makes the sum of the squared residuals as small as possible --- which is why it is also called the least-squares line.

Tip

Residual plots: Plot each residual against its xx-value. If the residuals scatter randomly above and below zero with no pattern, a line is a good model. If they curve or fan out, the data is not really linear and a line is the wrong tool. Example: for the plant line y=3x+8y = 3x + 8, if a plant was actually 2525 cm at week 55 (predicted 2323), its residual is 2523=+225 - 23 = +2 cm.

Concept
Weighted averages

An ordinary mean treats every value equally. A weighted average lets some values count more than others by assigning each a weight:

weighted average=(value×weight)weights.\text{weighted average} = \frac{\sum (\text{value} \times \text{weight})}{\sum \text{weights}}.

Weights often represent importance, frequency, or size --- like the number of credit hours behind each course grade, or the percentage each category contributes to a final grade.

Example
Worked example: a weighted grade

A class grade is 20%20\% homework, 30%30\% quizzes, and 50%50\% the final exam. A student earns 9595 on homework, 8080 on quizzes, and 7070 on the final. Find the course grade.

Using the weights as decimals (0.20, 0.30, 0.500.20,\ 0.30,\ 0.50, which sum to 11):

grade=95(0.20)+80(0.30)+70(0.50)0.20+0.30+0.50.\text{grade} = \frac{95(0.20) + 80(0.30) + 70(0.50)}{0.20 + 0.30 + 0.50}.
numerator=19+24+35=78,denominator=1,grade=781=78.\begin{aligned} \text{numerator} &= 19 + 24 + 35 = 78, \\ \text{denominator} &= 1, \\ \text{grade} &= \frac{78}{1} = 78. \end{aligned}

The weighted grade is 7878. Notice this is below the plain mean of the three scores (95+80+70381.7\frac{95+80+70}{3} \approx 81.7) because the low final exam carries the heaviest weight.

Tip

Sanity check: A weighted average always lands between the smallest and largest of the values (7070 and 9595 above). If your answer falls outside that range, you multiplied or divided by the wrong number. When the weights already add to 11 (or 100%100\%), the denominator is just 11 and you can skip dividing.

Formulas, Proofs & Tips

Tip
Mean, median, mode, range
xˉ=x1+x2++xnn\bar{x}=\frac{x_1+x_2+\cdots+x_n}{n}

What it means. The mean is the balancing point; the median is the middle value once sorted; the mode is the most frequent value; the range is largest minus smallest.

Example. For 3,5,5,93,5,5,9: mean =224=5.5=\tfrac{22}{4}=5.5, median =5=5, mode =5=5, range =93=6=9-3=6.

Why it works. The mean shares the total equally among the nn values: if everyone had xˉ\bar{x}, the total would still be nxˉ=xin\bar{x}=\sum x_i.

Tip. Sort the list before taking a median. With an even count the median is the average of the two middle values. One extreme outlier drags the mean but barely moves the median.