Foundations

Where every statistics course begins

Data and Variables

Everything downstream depends on knowing what kind of variable you have, and whether a number describes the whole population or just the sample in front of you.

Population and sampleWho the number describes
Parameter and statisticGreek for the population, Latin for the sample

The two groups

Population  →  sample  →  inference back to the population

Definitions

  1. Population — every individual the question is about
  2. Sample — the subset actually measured
  3. Census — measuring the entire population (rare, expensive)
  4. Inference — using the sample to say something about the population

Variables

  • N — population size
  • n — sample size
  • individual — one person, object or unit measured
  • variable — a characteristic recorded for each individual

Matching symbols

μ, σ, p, ρ, β  ↔  x̄, s, p̂, r, b

Rules

  1. A parameter is a fixed, usually unknown, number that describes the population
  2. A statistic is computed from the sample and varies from sample to sample
  3. Every inference formula uses a statistic to estimate or test a parameter

Variables

  • μ / x̄ — population mean / sample mean
  • σ / s — population SD / sample SD
  • p / p̂ — population proportion / sample proportion
  • ρ / r — population correlation / sample correlation
  • β1 / b1 — population slope / sample slope

The Three Branches

Descriptive statisticsSummarize what you have
Probability and inferenceReason about what you cannot see

Descriptive

Organize, display and summarize the data in hand: tables, graphs, measures of center (mean, median, mode), spread (range, IQR, variance, standard deviation) and position (percentiles, z-scores). No claims beyond the sample.

Where to look

Descriptive Statistics, Graphical Displays, Z-Scores and Position, and the Bivariate Data tabs.

Probability

The language of chance: how likely each outcome is, how random variables behave, and the named distributions (binomial, normal, t, chi-squared, F) that every test relies on.

Inferential

Confidence intervals estimate a parameter; hypothesis tests judge a claim about it. Both depend on a sampling distribution — how a statistic varies from sample to sample. Start at the Sampling Distributions tab.

Types of Data and Variables

Foundations

Descriptive vs Inferential

Descriptive statisticsDescribing what you have
Inferential statisticsReaching past the sample

Describe the data in front of you. They summarize patterns, averages, and variation without making any claim beyond the sample itself.

Examples

  • The mean of a class’s test scores
  • A boxplot of last month’s sales
  • The standard deviation of a sample

Use sample data to make predictions or draw conclusions about a larger population. They test hypotheses and estimate unknown values.

Examples

  • A confidence interval for a population mean
  • A hypothesis test comparing two groups
  • A regression model used to predict

Statistic vs Parameter

StatisticDescribes a sample — varies
ParameterDescribes a population — fixed

A value calculated from part of the population. Statistics are not fixed — they change depending on which sample you happened to draw. How a statistic varies across all possible samples is its sampling distribution.

Symbols

  • x̄ — sample mean (“x-bar”)
  • s — sample standard deviation
  • s2 — sample variance
  • p̂ — sample proportion
  • b — sample slope

A value describing the whole population, or a population model. Parameters appear in formulas, probability models, and inferential statistics. A parameter is a fixed quantity — you usually never get to see it.

Symbols

  • μ — population mean (lowercase mu)
  • σ — population standard deviation (lowercase sigma)
  • σ2 — population variance
  • p — population proportion
  • β — population slope (lowercase beta)

Small fix. Your notes call β “Greek uppercase beta.” The symbol used for a population slope is lowercase β. Uppercase beta is Β, which looks like a Latin B and is almost never used in statistics for exactly that reason.

Quantitative vs Qualitative

QuantitativeNumerical — how much or how many
QualitativeCategorical — which group

Measures or counts. These are numbers you can meaningfully do arithmetic on.

Discrete

Takes values with gaps in between. Counts are discrete — number of siblings, number of defective parts.

Continuous

Takes any value within an interval. Time, height, and weight can be continuous.

Data that can be classified into a group based on a non-numeric characteristic.

Examples

  • Eye color
  • Brand of phone
  • Yes / no responses
  • Zip code

A number is not automatically quantitative. Zip codes and jersey numbers are labels — averaging them is meaningless.

Levels of Measurement

The way a set of data is measured is its level of measurement, and it determines which statistical procedures are legitimate. Not every operation can be applied to every kind of data. There are four levels, each adding one capability to the one before it.

NominalNames only
OrdinalNames that can be ranked

Data consisting of names, labels, or categories only. It cannot be put in any meaningful order.

Examples

  • Favorite food
  • Phone manufacturer
  • Yes / no

What you can do

Count and find the mode. Nothing else. Ranking pizza above sushi is opinion, not data.

Also called rank-order. The data can be arranged in order, but the differences between values cannot be determined or are meaningless.

Examples

  • Survey responses: excellent, good, satisfactory, unsatisfactory
  • Top five national parks
  • Class rank

What you can do

Order and find the median. The gap between “good” and “excellent” is not a measurable quantity.

IntervalMeaningful differences, no true zero
RatioMeaningful differences and a true zero

Ordered data where differences can be found and are meaningful, but there is no natural zero point at which none of the quantity is present.

Examples

  • Temperature in °C or °F
  • Calendar years

The limitation

40° equals 100° minus 60°, so differences work. But 0° is not the absence of temperature — −10°F exists. So 80°C is not four times as hot as 20°C. Ratios are meaningless here.

Ordered data with meaningful differences and a natural zero, where zero means none of the quantity is present.

Examples

  • Exam scores out of 100
  • Height, weight, age
  • Income

What you gain

Ratios work. On a machine-graded exam, a score of 80 really is four times a score of 20, because 0 means no points earned.

Study Design and Sampling

Foundations

Sampling methods

A good sample is chosen by chance, not by convenience. Randomness is what lets the probability rules later describe the sampling error.

Probability samplesChance decides who is included
Non-probability samplesBias is built in

Four designs

  1. Simple random sample (SRS) — every group of n individuals is equally likely to be chosen; the gold standard behind every formula on this sheet
  2. Stratified — split the population into homogeneous strata (grade, region), then take an SRS inside each stratum
  3. Cluster — split the population into naturally occurring clusters (classrooms, city blocks), randomly pick whole clusters and measure everyone in them
  4. Systematic — pick a random start, then every k-th individual from a list

Stratified vs cluster

Stratified: sample from every stratum. Cluster: sample some clusters and take all of them. Strata are alike inside; clusters should look like mini-populations.

Designs to recognize and avoid

  1. Convenience — whoever is easiest to reach (the first 40 people in the hallway)
  2. Voluntary response — people choose themselves (online polls, call-in surveys); strong opinions over-respond
  3. Judgment — the researcher hand-picks “typical” cases

Why it matters

A biased sampling method produces an estimate that is systematically off in one direction. Taking a bigger biased sample makes the wrong answer more precise, not more correct.

Variables

  • sampling frame — the list the sample is drawn from
  • undercoverage — groups left out of the frame

Bias and confounding

Sources of biasSystematic error, not random error
Confounding and lurking variablesWhy association is not causation
  1. Selection bias — the method favors some individuals over others
  2. Undercoverage — part of the population cannot be chosen at all
  3. Nonresponse bias — chosen individuals cannot be reached or refuse, and they differ from those who answer
  4. Response bias — wording, interviewer effects, or sensitive questions push answers one way
  5. Measurement bias — the instrument reads consistently high or low

Random (sampling) error shrinks as n grows and is what margins of error describe. Bias does not shrink with n.

explanatory  →  response,  with a third variable pulling both

Definitions

  1. Explanatory variable — the suspected cause (x)
  2. Response variable — the measured outcome (y)
  3. Confounding variable — is related to the explanatory variable and affects the response, so their effects cannot be separated
  4. Lurking variable — a confounder that was not measured at all

Classic example: ice-cream sales and drownings rise together; summer heat drives both.

Experiments vs observational studies

Observational studyWatch, do not intervene
ExperimentImpose a treatment

What it is

Individuals are measured as they are. Surveys, record reviews and cohort studies are observational.

What it can show

Association only. Confounders are never fully controlled, so causation cannot be claimed.

Types

  1. Retrospective — look back at existing records
  2. Prospective — follow a group forward in time
  3. Cross-sectional — one snapshot

Principles of design

  1. Control — compare treatments to a control or placebo group so outside variables affect all groups alike
  2. Random assignment — chance decides who gets which treatment, which balances confounders on average
  3. Replication — enough subjects in each group to see past chance variation
  4. Blinding — subjects (single-blind) or subjects and evaluators (double-blind) do not know the treatment

Variables

  • factor — an explanatory variable the researcher sets
  • level — a specific value of a factor
  • treatment — a combination of factor levels
  • experimental unit — the subject a treatment is applied to
  • block — a group of similar units; randomize within each block

Random sampling lets you generalize to the population. Random assignment lets you claim cause and effect.

Descriptive Statistics

Summarizing data before inferring anything

Describing a Distribution

Distribution: a function showing the possible values a variable can take and how often they occur. In descriptive statistics it describes the frequency of the values; in inferential statistics it describes their probability.

C.U.S.S. — Center, Unusual features, Shape, Spread

Whenever you are asked to describe a distribution, hit all four, and do it in context. Naming the numbers without naming the variable and its units earns nothing.

CenterWhere the data sits
Unusual featuresWhat breaks the pattern

Measured by central tendency — a single value representing the center point, or central location, of the dataset. Mean, median, or mode.

Anything that is not shape, center, or spread: clusters, gaps, and outliers.

ShapeThe pattern of the distribution
SpreadHow stretched or squeezed

Symmetry, skewness, and peaks.

Also called dispersion. Measured by range, IQR, variance, or standard deviation.

Which numbers to reportMatch the summary to the shape
A model answerAll four letters, in context
  • symmetric, no outliers — mean for center, standard deviation for spread
  • skewed or outliers — median for center, IQR for spread (both resist extreme values)
  • skew direction — named by the long tail: right-skewed has the tail toward high values and the mean above the median
  • outlier rule — below Q1 − 1.5·IQR or above Q3 + 1.5·IQR

When comparing two groups, compare each letter directly: “group A’s median is higher, but its spread is also larger.”

Commute times for 40 employees: median 25 minutes, Q1 = 18, Q3 = 33, one value at 90.

“The distribution of commute times is right-skewed (shape) with a center near the median of 25 minutes. The middle half of employees commute between 18 and 33 minutes, an IQR of 15 minutes (spread). One employee’s 90-minute commute is a high outlier, well above Q3 + 1.5(15) = 55.5 minutes (unusual features).”

Every number is tied to the variable (commute time), the units (minutes) and the group (these 40 employees). “Skewed right, center 25, spread 15” alone is not a description.

Center and Spread

Descriptive Statistics

Center — Central Tendency

Central tendency is a single value that represents the center point of a dataset, sometimes called the central location. There are three ways to measure it.

MedianDenoted Md — rarely written
MeanDenoted x̄ for a sample, μ for a population

The measure that separates the data into two halves, upper and lower. It is the middle value of the list once the list is arranged in order.

Applies to

Quantitative data only.

Behavior

Resistant — a single extreme value barely moves it.

The arithmetic average of a set of values.

x̄ = Σxn

Applies to

Quantitative data only.

Behavior

Non-resistant — every value pulls on it, so outliers drag it toward the tail.

ModeDenoted Mo — rarely written

The most frequently occurring value in a set of data.

Applies to

Both quantitative and qualitative data — the only measure of center that works on categorical data. It is rarely useful for describing a quantitative distribution.

Handwritten calculation of mean, median, and mode
Worked example on the list 3, 7, 10, 8, 31, 10, 2 — mean 10.14, median 8, mode 10.

Typo in the original. The bullet under Mean reads “Median applies only to Quantitative Data” — copied down from the entry above it. It should say Mean.

Center and Skew

Three curves showing positive skew, symmetric, and negative skew
How mean, median, and mode sit relative to each other in skewed and symmetric distributions.
The relationshipsWhich measure ends up where

Positively skewed (right)

Mean ≥ Median ≥ Mode

Negatively skewed (left)

Mean ≤ Median ≤ Mode

Perfectly symmetric

Mean ≈ Median ≈ Mode

The mean is always the one dragged furthest toward the tail, because it is the only measure that uses every value. That is the whole rule — find the tail, and the mean is nearest it.

Correction. The negative-skew line in the original reads “Mode ≤ Mean ≤ Modde.” Besides the repeated word, the order is wrong. Negative skew reverses the positive case exactly: Mean ≤ Median ≤ Mode.

Unusual Features

Distinct ways to describe a distribution that are not shape, center, or spread.

Dotplot annotated with cluster, gap, and outlier
A dotplot of hours studying, showing a cluster, a gap, and a single outlier.
ClustersNatural subgroups
GapsHoles in the data

Natural subgroups into which the values fall. A cluster often means two different populations got mixed into one dataset.

Ranges where no values fall within a dataset.

OutliersAlso called extreme values

Data values that differ considerably from the bulk of a dataset. An outlier is not automatically an error — it may be the most interesting point you have — but it must be identified and mentioned.

Finding Outliers

Diagram of Q1, median, Q3 and the interquartile range
How the quartiles cut a dataset into four equal parts, with the IQR spanning the middle two.
QuartilesFour parts of roughly equal size
Interquartile rangeAlso called the midspread
  • Q1 — 25% of the data falls below this value
  • Median (Q2) — 50% falls below
  • Q3 — 75% falls below

The middle 50% of the data — the difference between the 75th and 25th percentiles.

IQR = Q3 − Q1
The 1.5 × IQR ruleThe standard outlier fences

High outlier

Multiply the IQR by 1.5, add it to Q3. Any value above that is a high outlier.

x > Q3 + 1.5(IQR)

Low outlier

Multiply the IQR by 1.5, subtract it from Q1. Any value below that is a low outlier.

x < Q1 − 1.5(IQR)

A second common rule flags anything more than two to three standard deviations from the mean. Use the IQR rule when the data is skewed, since it does not depend on the mean.

Shape

Six histograms showing common distribution shapes
Normal, skewed right, skewed left, uniform, and two bimodal shapes.
What to nameThree features

Symmetry

Two sides that are mirror images of each other.

Skewness

Noticeably more points on one side of the center than the other. The skew is named for the direction of the tail, not the bulk — a pile on the left with a long right tail is skewed right.

Peaks

Areas with higher data counts than the surrounding values. One peak is unimodal, two is bimodal.

Spread

Spread, or dispersion, is the extent to which a distribution is stretched or squeezed. Which measure you use is tied to which measure of center you chose.

Use IQR and medianWhen the mean would lie
Use mean and standard deviationWhen the mean is honest
  • If the data is skewed
  • If there are outliers
  • If the distribution is approximately or exactly normal
  • If there are no outliers and it is bell shaped
VarianceSquared units
Standard deviationSame units as the mean
s2 = Σ(x − x̄)2n − 1

The average of the squared differences between each value and the mean. Because the differences are squared, it is measured in squared units — different units from the data itself.

s = √Σ(x − x̄)2n − 1

The square root of the variance. Measured in the same units as the mean, which is why it is the better of the two for describing a distribution.

Correction. Both formulas in the original are missing the exponent on the deviation — they read Σ(x − x̄) rather than Σ(x − x̄)2. Without the square the numerator always sums to exactly zero, since deviations above and below the mean cancel. Squaring is what makes the whole thing work.

RangeA single number
Range = Maximum − Minimum

The range is one value. Writing “the range is 50 to 100” is not a range — that is an interval. The range is 50.

Two histograms comparing narrow and wide spread
The same center with a narrow spread and a wide spread.

Graphical Displays

Descriptive Statistics

Frequency Tables

FrequencyRaw counts
Relative frequencyProportions

The number of members of a population or sample falling into a particular category — or, for quantitative data, into a particular class.

Frequencies expressed as proportions of the whole. They always add up to 1, and can be written as percentages instead, in which case they add to 100%.

Cumulative frequencyRunning total
Cumulative relative frequencyRunning proportion

The running sum of the frequencies — every observation at or below this class.

The running sum expressed as a proportion of the total. The final entry is always 1, or 100%.

Frequency table with class intervals
A frequency table with class intervals and relative frequencies summing to 1.
Table showing cumulative and cumulative relative frequency
Frequency, cumulative frequency, and cumulative relative frequency side by side.

Displaying Categorical Data

Graphing the data from a frequency table. These displays are for categorical data — knowing which one to reach for is half the question.

Bar chartsThe default
Pie chartsUse sparingly
Bar chart of percentages within region
A bar chart comparing percentages across regions.
  • Always include spaces between the bars
  • Only for categorical data
  • Most time efficient to read
Pie chart of activities
A pie chart of daily activities; the slices sum to 100%.
  • Avoid if another option is available
  • The slices must sum to 100%, or 1
  • Humans compare angles poorly, which is why bar charts usually win

Displaying Numerical Data

StemplotsStem-and-leaf
Box plotsBox and whiskers
Stem and leaf plot of battery life
A back-to-back stemplot comparing two phone battery brands, with a key.

There is no mathematical rule for what counts as a stem and what counts as a leaf — the nature of the data decides. With two-digit scores you might take the first digit as the stem and the second as the leaf, so 42 becomes 4 | 2.

  • Splitting stems is also called back-to-back
  • Always include a key
  • Keeps every original value visible, unlike a histogram
Annotated boxplot
A boxplot of heights, labeled with Q1, median, Q3, IQR, and outliers.

Used to display a dataset through its median statistics. To construct one, draw a box above a number line:

  1. Left edge of the box at Q1
  2. Right edge of the box at Q3
  3. A line through the box at the median
  4. Whiskers from the center of each edge out to the minimum and maximum
Five number summaryWhat to state in context

When asked to describe a boxplot or give a five number summary, state the minimum, Q1, median, Q3, and maximum — in context, with units — and name any outliers.

More on box plots

  • Can be drawn vertically or horizontally
  • Only one axis, and it must be labeled
  • If there is an outlier, the whisker stops at the next largest value that is not an outlier
  • There can be more than one outlier
  • Useful for showing skew, and for comparing groups side by side
Comparative boxplots showing skew
Three boxplots showing symmetric, negatively skewed, and positively skewed data.

Histograms

Histogram: a diagram of rectangles whose area is proportional to the frequency of a variable, and whose width equals the class interval.

The formulaHeight is density, area is frequency
Frequency density = FrequencyClass width

Histograms are measured in relative areas — frequency densities — not relative heights. This only matters when bins have different widths, but that is exactly when students get it wrong.

  • Frequency tables can be displayed as histograms as long as the data is numerical, not categorical
  • The biggest distinction from a bar chart is that histograms have no spaces between bars

Worth tightening. The original writes “Area = frequency of a variable ÷ class interval.” That quantity is the bar’s height — its frequency density. The bar’s area is the frequency itself, since height × width = (frequency ÷ width) × width.

Width of the barsBins, classes, or intervals
Height of the barsFrequency of the bin
  • The width is also called bins, classes, or intervals
  • Bins cover a range of the variable of interest
  • The boundaries are the first and last values of each interval
  • The midpoints are the middle values between the boundaries
  • Bins in one histogram can be different lengths

The height measures the frequency of the bin — strictly, the frequency density when bin widths vary.

Histogram with its frequency table
An interval-and-frequency table with the histogram it produces.
Relative frequency histogramSame shape, different y-axis
Frequency density = Relative frequencyClass width
  • Heights can be written as percents or decimals
  • If percents, the heights must total 100%
  • If decimals, the heights must total 1
  • Converting a frequency histogram to a relative frequency histogram changes only the y-axis — the shape is identical
Relative frequency histogram
A relative frequency histogram of item prices.

Cumulative Frequency Plots

In a dataset, the cumulative frequency for a value x is the total number of scores less than or equal to x. A cumulative frequency plot draws those values graphically.

Reading themWhat the curve tells you
  • Histograms are usually the data drawn for cumulative frequency plots
  • Displays the number, percentage, or proportion of observations less than or equal to a particular value
  • A relative cumulative frequency plot is one where the y-values total 1, or 100%
  • The curve never decreases — a running total cannot go down
  • Steepest where the data is densest; flat across a gap
Two cumulative frequency plots
Histograms with their cumulative frequency curves overlaid.
Density curves paired with their cumulative curves
Common density shapes and the relative cumulative frequency curve each one produces.

Z-Scores and Position

Descriptive Statistics

Normalcy

Conditions for normalcyAll three must hold
StandardizingGetting to the standard normal

A distribution is considered approximately normal if it is:

  1. Symmetrical
  2. Unimodal
  3. Bell-shaped

Any roughly normal distribution can be standardized by converting its values into z-scores: subtract the mean from each value, then divide by the standard deviation.

Several normal curves with different means and standard deviations
Normal curves are all bell-shaped, but they can look very different from one another.
Standard normal distributionWhere μ = 0 and σ = 1

The bell curve, the Gaussian distribution, and the normal curve are all names for the same thing. The standard normal curve is the special case where the standard deviation is 1 and the mean is 0.

  • It is a theoretical probability distribution — use parameter terms
  • Like a histogram, the total area under the curve is always 1, or 100%
  • Used to approximate the position of a value within the data
  • The points of inflection — where the curve is steepest — sit exactly one standard deviation from the mean
Normal curve showing the empirical rule
The normal curve with the 68-95-99.7 bands marked.
The empirical rule68 – 95 – 99.7
  • ±1σ — about 68.3% of values fall within one standard deviation of the mean
  • ±2σ — about 95.4% fall within two
  • ±3σ — about 99.7% fall within three

Correction. The original ends with “the empirical rule only applies to standard normal distributions.” It applies to any approximately normal distribution, whatever its mean and standard deviation. That is the entire point of the rule — on a distribution with μ = 500 and σ = 100, roughly 68% of values still fall between 400 and 600. The standard normal is just the case where μ = 0 and σ = 1.

Z-Scores

The formulaUse parameter terms with raw data sets
z = x − μσ

A z-score describes the position of a raw score in terms of its distance from the mean, measured in standard deviation units.

Raw score

Data that has not been converted or altered in any way — the actual value of the unit of interest (x). The entire unaltered dataset is the raw data set.

Normal curve with z-scores and shaded tail areas
A standard normal curve with z = −1.74 and z = +1.74 marked, and the areas between and beyond them.
PropertiesWhat the number tells you
RearrangementsSolving for the other pieces
  • Positive if the value lies above the mean, negative if below
  • A z-score of 0 is the mean
  • In practice it rarely falls outside −3 to +3
  • Only use z-scores if the conditions for normalcy are met

From z = (x − x̄) ÷ SD, the following must be true:

x = (z)(SD) + x̄
SD = x − x̄z
x̄ = x − (z)(SD)

Correction. The third rearrangement in the original reads x̄ = (z)(SD) + x. Solving z = (x − x̄) ÷ SD for the mean gives x̄ = x − (z)(SD) — subtract, not add. Quick check with the first identity: if x = z·SD + x̄, then moving z·SD across gives x̄ = x − z·SD.

Z-score visualization mapping raw scores to standard deviations
A raw score scale of 61.3 to 108.7 with σ = 7.90, mapped onto z-scores −3 to +3.
Main usesWhat z-scores are for
  1. Showing approximately how many standard deviations a raw score sits from the mean
  2. With a z-table or calculator, showing what percentile a raw score falls in — how much of the data lies above or below it

A z-score of 0 is the 50th percentile.

Designating positionThree procedures, weakest to strongest

1. Simple ranking

Arrange the elements in order and note where a particular value falls. Needs the most additional information to be meaningful.

2. Percentile ranking

Indicates what percentage of all values fall at or below the value under consideration.

3. Z-score

States specifically how many standard deviations a value sits above or below the mean. The most precise of the three.

Z-Tables

A z-table, also called the standard normal table, gives the area under the curve to the left of a z-score — which is the same as the percentile. That area is the probability that a z-value falls in that region, and the total area under the standard normal curve is 1.

Reading the tableRaw score → z-score → percentage
Reading it backwardPercentage → z-score → raw score
  • Row and column headers define the z-score — row to the tenths, column to the hundredths
  • Table cells represent the area
  • The table is split into two sections, negative and positive z-scores
  • Negative z-scores are below the mean; positive are above
  • No z-score above 3.49 or below −3.49

Find the area you want inside the body of the table, then read the z-score off the row and column headers. Convert back to a raw score with x = (z)(SD) + x̄.

Other uses (later units)

  • Finding p-values
  • Sampling distributions
  • Finding probabilities across a range of z-scores
Standard normal table, positive z-scores
Positive z-table — areas to the left of z for z from 0.0 to 3.4.
Standard normal table, negative z-scores
Negative z-table — areas to the left of z for z from −3.4 to 0.0.

Probability

The language of chance

Foundations of Probability

Probability measures how likely an event is on a 0-to-1 scale. Every rule on the next tabs is built from the three axioms in the left cell.

Sample spaces and eventsThe vocabulary
Assigning probabilitiesTheoretical, empirical, subjective
0 ≤ P(A) ≤ 1     P(S) = 1

Definitions

  1. Experiment — any process with an uncertain outcome (roll a die, draw a card)
  2. Sample space S — the set of all possible outcomes
  3. Event A — any subset of S; it occurs if the outcome is in A
  4. Complement A′ (also Ac or Ā) — every outcome not in A

Axioms

  • P(A) = a number between 0 and 1 for every event
  • P(S) = 1 (something must happen)
  • P(A ∪ B) = P(A) + P(B) when A and B cannot both occur

Complement rule

P(A′) = 1 − P(A)
P(A) = number of outcomes in Anumber of outcomes in S

When the shortcut applies

  1. Every outcome in S is equally likely (fair die, well-shuffled deck)
  2. You can count both A and S (see Combinatorics)

Three ways to get a probability

  • theoretical — count equally likely outcomes, as in the formula above
  • empirical — relative frequency from data: (times A occurred) ⁄ (trials)
  • subjective — a personal degree of belief when neither is available

Law of large numbers

As the number of trials grows, the empirical relative frequency of A settles down to P(A). Short runs can look very different from the long-run value — that is the gambler’s fallacy.

Reading probability statements

Odds and probabilityTwo ways to say the same thing
Mutually exclusive vs independentStudents swap these constantly
odds for A = P(A)1 − P(A)     P(A) = odds1 + odds

Odds of 3 to 1 against means P(A) = 1⁄4. Odds of 3 to 1 for means P(A) = 3⁄4.

Mutually exclusive (disjoint)

A and B cannot happen together: P(A ∩ B) = 0. Knowing A happened tells you B did not — so disjoint events with positive probability are never independent.

Independent

Knowing A happened does not change the chance of B: P(B | A) = P(B), equivalently P(A ∩ B) = P(A)·P(B).

Rules and Set Language

Probability

Language of sets

Probability borrows its notation from set theory. Read ∪ as “or”, ∩ as “and”, and the prime as “not”.

SymbolRead asMeaningVenn picture
A ∪ BA or B (union)outcomes in A, in B, or in bothboth circles shaded
A ∩ BA and B (intersection)outcomes in both A and Bthe overlap only
A′, Acnot A (complement)outcomes in S that are not in Aeverything outside A
A ∩ B = ∅disjoint / mutually exclusiveA and B share no outcomescircles do not overlap
A ⊂ BA is a subset of Bevery outcome of A is also in BA sits inside B
P(A | B)A given Bprobability of A once B is known to have occurredshrink the space to circle B

Addition rules

General addition ruleAny two events
Special addition ruleMutually exclusive events
P(A ∪ B) = P(A) + P(B) − P(A ∩ B)

Why subtract

  1. Adding P(A) and P(B) counts the overlap twice
  2. Subtract P(A ∩ B) once to fix it

Variables

  • P(A ∪ B) — probability A or B (or both) occurs
  • P(A ∩ B) — probability both occur (the joint probability)

Example: P(king or heart) = 4⁄52 + 13⁄52 − 1⁄52 = 16⁄52.

P(A ∪ B) = P(A) + P(B)

Condition

  1. A and B are mutually exclusive: P(A ∩ B) = 0

Extends to many events

P(A1 ∪ A2 ∪ … ∪ Ak) = P(A1) + … + P(Ak)

Example: P(roll a 1 or a 6) = 1⁄6 + 1⁄6 = 2⁄6. Rolling a 1 and a 6 on one die cannot both happen.

Multiplication rules

General multiplication ruleAny two events
Special multiplication ruleIndependent events
P(A ∩ B) = P(A) · P(B | A)

Reading it

  1. The chance A happens, times the chance B happens given that A already did
  2. Order can be swapped: P(A ∩ B) = P(B) · P(A | B)

Variables

  • P(B | A) — conditional probability of B given A

Example (no replacement): P(two aces) = 4⁄52 · 3⁄51.

P(A ∩ B) = P(A) · P(B)

Condition

  1. A and B are independent: P(B | A) = P(B)

Extends to many events

P(A1 ∩ … ∩ Ak) = P(A1) · … · P(Ak)

Example (with replacement): P(two aces) = 4⁄52 · 4⁄52. Sampling with replacement, or from a huge population, makes draws (nearly) independent.

Conditional probability and the rule of at least one

Conditional probabilityRestrict the sample space
At least oneGo through the complement
P(A | B) = P(A ∩ B)P(B),   P(B) > 0

The denominator shrinks the sample space to the outcomes where B occurred. In a two-way table: divide the cell count by the row or column total you are conditioning on. Full treatment on the Conditional Probability tab.

P(at least one) = 1 − P(none)

Example: P(at least one six in four rolls) = 1 − (5⁄6)4 ≈ 0.518. Computing it directly would mean adding four separate cases.

Conditional Probability

Probability

Conditional probability

“Given” means you already know something happened. Throw out every outcome that contradicts it and re-scale what is left so it sums to 1.

DefinitionP(A | B)
From a two-way tableWhere most problems live
P(A | B) = P(A ∩ B)P(B)

Conditions

  1. P(B) > 0 (you cannot condition on something impossible)

Variables

  • P(A | B) — probability of A given that B occurred
  • P(A ∩ B) — joint probability of A and B
  • P(B) — marginal probability of the condition

Rearranged

P(A ∩ B) = P(B) · P(A | B) = P(A) · P(B | A)

P(A | B) and P(B | A) are different numbers. P(positive test | sick) is not P(sick | positive test).

P(A | B) = count in the A-and-B celltotal of the B row (or column)

Steps

  1. Find the row or column of the condition B
  2. Divide the cell that is also A by that row or column total
  3. Ignore the rest of the table

Law of total probability

P(A) = P(A | B)·P(B) + P(A | B′)·P(B′)

Add up the ways A can happen across every branch of the condition. This is the denominator in Bayes’ theorem.

Independence and Bayes

IndependenceThree equivalent tests
Bayes’ theoremReverse the condition
P(A | B) = P(A)  ⇔  P(B | A) = P(B)  ⇔  P(A ∩ B) = P(A)·P(B)

How to check

  1. Compute P(A | B) from the table or tree
  2. Compare it with the unconditional P(A)
  3. Equal (to rounding) means independent; different means associated

Watch for

  • disjoint ≠ independent — disjoint events with positive probability are always dependent
  • sampling without replacement — draws are dependent; with replacement they are independent
P(B | A) = P(A | B) · P(B)P(A | B)·P(B) + P(A | B′)·P(B′)

Steps

  1. Write the prior P(B) and the likelihoods P(A | B), P(A | B′)
  2. Multiply down each branch of a tree diagram
  3. Divide the branch you want by the total of every branch that produced A

Variables

  • P(B) — prior probability (before the evidence)
  • P(A | B) — likelihood of the evidence under B
  • P(B | A) — posterior probability (after the evidence)

Medical-test example: a 99%-accurate test for a 1-in-1000 disease still gives P(sick | positive) ≈ 0.09, because false positives from the healthy majority swamp the true positives.

Worked examples

From a two-way tableConditional vs joint vs marginal
Bayes with the numbers inThe medical-test calculation

200 students: 80 are seniors, of whom 60 have a job; of the 120 non-seniors, 30 have a job. So 90 have a job in all.

  • P(job) = 90⁄200 = 0.45 — marginal: divide by the grand total
  • P(senior ∩ job) = 60⁄200 = 0.30 — joint: a cell over the grand total
  • P(job | senior) = 60⁄80 = 0.75 — conditional: the cell over the senior row
  • P(senior | job) = 60⁄90 = 0.667 — same cell, other total

Independence check

P(job | senior) = 0.75 but P(job) = 0.45: not equal, so class year and employment are associated. Equivalently P(senior)·P(job) = 0.40(0.45) = 0.18 ≠ 0.30 = P(senior ∩ job).

Formula check: P(job | senior) = P(job ∩ senior)⁄P(senior) = 0.30⁄0.40 = 0.75, the same number the table gave directly.

Disease rate 1 in 1000; the test catches 99% of cases and gives a false positive for 1% of healthy people. A random person tests positive. P(sick | +)?

  1. Prior and likelihoods: P(sick) = 0.001, P(healthy) = 0.999, P(+ | sick) = 0.99, P(+ | healthy) = 0.01
  2. Branches: P(sick ∩ +) = 0.001 × 0.99 = 0.00099; P(healthy ∩ +) = 0.999 × 0.01 = 0.00999
  3. Total probability of a positive: P(+) = 0.00099 + 0.00999 = 0.01098
  4. Posterior: P(sick | +) = 0.00099⁄0.01098 = 0.090

Only 9% of positives are real cases: there are roughly ten healthy false positives for every true positive, because the healthy group is 999 times larger. In 100,000 people: 99 true positives and 999 false positives, 99⁄1098 = 0.090 again. Counting people is often the easiest way to run Bayes.

Combinatorics

Probability

Fundamental counting principle

Counting is how theoretical probabilities get their numerators and denominators. Every formula on this tab is the counting principle applied in a particular way.

Multiplication principleStages of a task
FactorialArranging everything
total ways = n1 · n2 · … · nk

Conditions

  1. The task happens in k stages
  2. Stage i can be done in ni ways no matter what happened before

Example: 3 shirts × 4 pants × 2 shoes = 24 outfits. A 4-digit PIN: 10 · 10 · 10 · 10 = 10,000.

n! = n · (n − 1) · (n − 2) · … · 2 · 1

Rules

  1. 0! = 1 by definition
  2. n! counts the ways to line up n distinct objects

Example: 5 books on a shelf: 5! = 120 orders. Growth is explosive — 10! = 3,628,800.

Permutations and combinations

PermutationsOrder matters
CombinationsOrder does not matter
nPr = n!(n − r)!

Conditions

  1. Choose r of n distinct objects
  2. Arrangement or position matters (1st, 2nd, 3rd; president then treasurer)
  3. No repetition

Variables

  • n — number of distinct objects available
  • r — number selected and arranged

Examples

Gold, silver, bronze from 8 runners: 8P3 = 8·7·6 = 336. With repetition allowed the count is nr instead.

nCr = nr = n!r!(n − r)!

Conditions

  1. Choose r of n distinct objects
  2. Only the group matters, not the order (a committee, a hand of cards)
  3. No repetition

Variables

  • nCr = nPr ⁄ r!   (divide out the r! orderings)
  • nC0 = nCn = 1
  • nCr = nCn−r

Examples

A 3-person committee from 8: 8C3 = 56. Probability of a 5-card flush: 4·13C5 ⁄ 52C5 ≈ 0.00198. The binomial coefficient on the Binomial tab is this same number.

Which one?

DecisionAsk two questions

1. Does order matter?

Yes → permutation (or nr if repeats are allowed). No → combination.

2. Are you choosing from several categories at once?

Count each category with its own combination and multiply: 2 women from 6 and 3 men from 9 is 6C2 · 9C3. “At least” problems are usually fastest through the complement.

Discrete Random Variables

Probability distributions you can list

Expected Value and Variance

A discrete random variable takes a countable set of values (0, 1, 2, …). Its probability distribution is a table of each value with its probability; the probabilities must each be between 0 and 1 and must add to exactly 1.

Expected value (mean)The long-run average
Variance and standard deviationThe long-run spread
μX = E(X) = Σ x · P(x)

Conditions

  1. X is discrete with a known distribution table
  2. Σ P(x) = 1 and every 0 ≤ P(x) ≤ 1

Variables

  • x — a possible value of X
  • P(x) — its probability, P(X = x)
  • μX — the mean of X; the balance point of the distribution

Steps

  1. Multiply each value by its probability
  2. Add the products

E(X) need not be a value X can take — the expected number of heads in 3 flips is 1.5.

σX2 = Σ (x − μX)2 · P(x)

Shortcut

σX2 = E(X2) − μX2 = Σ x2P(x) − μX2

Variables

  • σX2 — variance of X
  • σX = √σX2  (standard deviation, same units as X)

Steps

  1. Find μX first
  2. Square each deviation, weight it by P(x), add
  3. Square-root for the standard deviation

Rules for means and variances

Linear transformationY = a + bX
Sums and differencesIndependent X and Y
μY = a + bμX     σY2 = b2σX2     σY = |b|σX

Rules

  1. Adding a constant shifts the mean and leaves the spread alone
  2. Multiplying by b scales the mean by b and the SD by |b|

Example: converting °C to °F (F = 32 + 1.8C) multiplies the SD by 1.8; the 32 does nothing to it.

μX±Y = μX ± μY     σX±Y2 = σX2 + σY2

Conditions

  1. X and Y are independent (otherwise a covariance term appears)

Rules

  • means — always add or subtract
  • variances — always add, even for a difference
  • standard deviations — never add — add variances, then square-root

This is why the two-sample standard error is √σ12n1 + σ22n2 with a plus sign.

Binomial Distribution

Discrete Random Variables

When binomial applies

Fixed n, two outcomes, constant p, independent trials. If all four hold, X = the number of successes in the n trials is binomial.

Binomial settingThe four conditions
Probability formulaP(X = x)

Is a binomial distribution appropriate?

Conditions

  1. There are exactly 2 outcomes, usually called success and failure, for each trial
  2. The number of trials n is fixed in advance
  3. The trials are independent
  4. The probability of success p is the same for each trial

Variables

  • X — number of successes in n trials; X = 0, 1, 2, …, n
  • n — number of trials
  • p — probability of success on one trial
  • q — 1 − p, the probability of failure

Notation

X ~ B(n, p)

Sampling without replacement is not independent, but when the sample is under 10% of the population the binomial model is still used (the 10% condition).

P(X = x) = nx px (1 − p)n − x
x = 0, 1, 2, …, n

The pieces

  • nx = nCx = n!x!(n − x)!  — how many orders put the x successes among n trials
  • px — the x successes each happen with probability p
  • (1 − p)n−x — the n − x failures each happen with probability q

Calculator

  • binompdf(n, p, x) = P(X = x)
  • binomcdf(n, p, x) = P(X ≤ x)
  • P(X ≥ x) = 1 − binomcdf(n, p, x − 1)

Example: P(exactly 3 heads in 5 fair flips) = 5C3(0.5)3(0.5)2 = 10⁄32 = 0.3125.

Mean and variance

Mean and standard deviationNo sum needed
Shape and the normal approximationWhen n is large
μX = np     σX = √np(1 − p)

Variables

  • μX = np, the expected number of successes
  • σX2 = np(1 − p) = npq
  • σX = √npq

Example: 100 flips of a fair coin: μ = 50, σ = √25 = 5. Getting 65 heads is 3 standard deviations out.

X ≈ N(np, √np(1 − p))

Conditions

  1. np ≥ 10
  2. n(1 − p) ≥ 10

Shape

  • p = 0.5 — symmetric
  • p < 0.5 — skewed right (most counts are small)
  • p > 0.5 — skewed left
  • large n — approaches a normal curve whatever p is

The sample proportion p̂ = X⁄n inherits this: see Distribution of the Sample Proportion.

Geometric and Poisson

Discrete Random Variables

Geometric distribution

Same two-outcome, independent, constant-p setting as the binomial, but there is not a fixed number of trials: the trials continue until the first success is achieved, and X counts how many trials that took.

When geometric appliesTrial number of the first success
Mean and standard deviationWaiting time
P(X = k) = (1 − p)k − 1 p,   k = 1, 2, 3, …

Conditions

  1. Exactly 2 outcomes for each trial
  2. Trials are independent
  3. The probability of success p is the same for each trial
  4. There is no fixed number of trials — you stop at the first success

Variables

  • X — the trial on which the first success occurs
  • k — a specific trial number
  • (1 − p)k−1 — k − 1 failures first
  • p — then one success

Useful tails

P(X > k) = (1 − p)k     P(X ≤ k) = 1 − (1 − p)k

Calculator: geometpdf(p, k) and geometcdf(p, k).

μX = 1p     σX = √1 − pp

Variables

  • μX = 1⁄p, the expected number of trials to the first success
  • σX2 = (1 − p)⁄p2

Shape

Always skewed right: P(X = 1) = p is the tallest bar and each later bar is (1 − p) times the one before it.

Example: rolling a die until the first six: μ = 6 rolls, σ = √(5⁄6) ⁄ (1⁄6) ≈ 5.48. P(first six on roll 3) = (5⁄6)2(1⁄6) ≈ 0.116.

Poisson distribution

Counts of events in a fixed interval of time or space when the events occur independently at a constant average rate: calls per hour, typos per page, cars per minute.

Probability formulaP(X = k)
Mean, variance and approximationOne parameter does everything
P(X = k) = e−λ λkk!,   k = 0, 1, 2, …

Conditions

  1. Events occur one at a time (no two at the same instant)
  2. Events in non-overlapping intervals are independent
  3. The average rate λ is constant over the interval

Variables

  • X — number of events in the interval; no upper limit
  • λ — the mean number of events in that interval (rate × length)
  • e — 2.71828…

Calculator: poissonpdf(λ, k) and poissoncdf(λ, k). Scale λ to the interval asked about: 3 per hour is 1.5 per half hour.

μX = λ     σX2 = λ     σX = √λ

Approximating a binomial

  1. n is large (n ≥ 20) and p is small (p ≤ 0.05)
  2. Use λ = np

Shape

Skewed right for small λ; nearly normal once λ ≥ 10.

Example: a help desk averages 4 calls per hour. P(exactly 2 in an hour) = e−442⁄2! ≈ 0.147; P(none) = e−4 ≈ 0.018.

Continuous Random Variables

Probability as area

Density and Area

A continuous variable can take any value in an interval, so individual values have probability zero and probability lives in area under the density curve.

Density curveThe rules
Finding probabilitiesArea between two values
P(a < X < b) = area under f(x) from a to b

Conditions on a density f(x)

  1. f(x) ≥ 0 everywhere
  2. The total area under the curve is exactly 1

Consequences

  • P(X = a) = 0 for any single value
  • P(a ≤ X ≤ b) = P(a < X < b) — endpoints do not matter
  • P(X > a) = 1 − P(X < a)

The height of the curve is not a probability. Only areas are. A density can exceed 1 as long as its total area is 1.

P(a < X < b) = F(b) − F(a)

Variables

  • f(x) — probability density function (the curve)
  • F(x) — cumulative distribution function, P(X ≤ x), the area to the left of x
  • F(x) = ∫ f — the area accumulates from the far left; F runs from 0 up to 1

Steps

  1. Sketch the curve and shade the region
  2. Use geometry (uniform), the formula (exponential), or a table or calculator (normal, t, chi-squared, F)
  3. Subtract left areas to get a middle area

Center and spread of a continuous variable

Mean and medianBalance point vs equal-area point
Expected value and varianceThe integral versions

Mean

The point where the curve would balance. Pulled toward a long tail: for a right-skewed density the mean is to the right of the median.

Median

The point with area 0.5 on each side. For a symmetric density the mean and median coincide at the center.

μ = ∫ x f(x) dx     σ2 = ∫ (x − μ)2 f(x) dx

The sums from the discrete tab become integrals. In an intro course you will use the closed-form results on the next tabs rather than integrate — but every mean and SD listed there comes from these two expressions.

Worked example

Area by geometryA uniform density
Area by the CDFThe same answer from F

Bus waiting time X is equally likely anywhere from 0 to 20 minutes. The density is a flat line of height 1⁄20 = 0.05 over [0, 20] (total area 20 × 0.05 = 1).

  1. P(5 < X < 12) = width × height = 7 × 0.05 = 0.35
  2. P(X > 15) = 5 × 0.05 = 0.25
  3. P(X = 10) = 0: a single point has no width
  4. Mean = balance point = 10; median = the point with 0.5 on each side = 10

The height 0.05 is not a probability; if the interval were [0, 0.5] the height would be 2 and the total area still 1.

For this uniform, F(x) = P(X ≤ x) = x⁄20 for 0 ≤ x ≤ 20: the area accumulated from the left.

  1. F(12) = 0.60, F(5) = 0.25, so P(5 < X < 12) = F(12) − F(5) = 0.35
  2. P(X > 15) = 1 − F(15) = 1 − 0.75 = 0.25
  3. Percentiles run F backwards: the 90th percentile solves x⁄20 = 0.90, x = 18 minutes

Every continuous probability on the following tabs is this same subtraction: the normal table, normalcdf, tcdf and χ2cdf all return F(b) − F(a), the area between two values.

Uniform and Exponential

Continuous Random Variables

Continuous uniform

Every value between a and b is equally likely, so the density is a flat rectangle and probabilities are just lengths divided by the total length.

Density and probabilityX ~ U(a, b)
Mean and standard deviation
f(x) = 1b − a  for a ≤ x ≤ b

Probability

P(c < X < d) = d − cb − a

Conditions

  1. X is equally likely anywhere between a and b
  2. Nothing outside [a, b] is possible

Variables

  • a, b — the lower and upper limits
  • c, d — the values you are finding the probability between (clip them to [a, b])

Example: a bus arrives uniformly within 0 to 20 minutes. P(wait > 15) = 5⁄20 = 0.25.

μ = a + b2     σ = b − a√12

Variables

  • μ = the midpoint
  • σ2 = (b − a)212
  • median = also the midpoint (symmetric)
  • F(x) = x − ab − a

The 20-minute bus: μ = 10, σ = 20 ⁄ √12 ≈ 5.77 minutes.

Exponential distribution

The waiting time until the next event in a Poisson process. If events arrive at rate λ per unit time, the gap between events is exponential.

Density and probabilityX ~ Exp(λ)
Mean, standard deviation and memorylessness
f(x) = λ e−λx  for x ≥ 0

Probability

P(X > x) = e−λx     P(X ≤ x) = 1 − e−λx

Conditions

  1. Events occur independently at a constant average rate
  2. X is the time (or distance) until the next one

Variables

  • λ — the rate, events per unit time
  • x — a waiting time, x ≥ 0

Example: calls arrive 4 per hour. P(next call takes more than 30 minutes) = e−4(0.5) = e−2 ≈ 0.135.

μ = 1λ     σ = 1λ

Variables

  • μ = 1⁄λ, the average wait
  • σ = also 1⁄λ — the mean and SD are equal
  • median = ln(2)⁄λ ≈ 0.693⁄λ (below the mean: skewed right)

Memoryless property

P(X > s + t | X > s) = P(X > t)

Having already waited s minutes does not change the chance of waiting t more. The exponential is the only continuous distribution with this property; the geometric is its discrete twin.

(z) Standard Normal Distribution

Continuous Random Variables

The z-score

Any normal variable can be converted to the standard normal N(0, 1) by measuring how many standard deviations it sits from its mean. One table then serves every normal curve.

Standardizingx → z
The standard normal curveN(0, 1)
z = x − μσ

Conditions

  1. X is (approximately) normal with mean μ and SD σ
  2. μ and σ are the population values, not sample estimates

Variables

  • x — the raw value
  • μ — population mean
  • σ — population standard deviation
  • z — number of SDs that x lies above (+) or below (−) the mean

Back to x

x = μ + zσ

A z-score of −1.5 is 1.5 standard deviations below the mean, whatever the units. z-scores let you compare an SAT score to an ACT score.

μ = 0     σ = 1     total area = 1

Empirical rule (68–95–99.7)

  • P(−1 < Z < 1) = 0.68
  • P(−2 < Z < 2) = 0.95
  • P(−3 < Z < 3) = 0.997

Symmetry

P(Z < −z) = P(Z > z) = 1 − P(Z < z)

Common critical values: z = 1.645 cuts off 5% in one tail; 1.960 cuts off 2.5%; 2.576 cuts off 0.5%. These are the z* values for 90%, 95% and 99% confidence.

Finding areas and cutoffs

Area from a valueForward problem
Value from an areaInverse problem
P(a < X < b) = normalcdf(a, b, μ, σ)

Steps

  1. Sketch the curve, mark the mean, shade the region
  2. Standardize the endpoints if using a table: z = (x − μ)⁄σ
  3. Table gives area to the left. Right tail: 1 − left. Middle: left(b) − left(a)

Variables

  • normalcdf(low, high, μ, σ) — area between two values; use −1E99 or 1E99 for an open tail
  • z-table — left-tail areas for z from −3.49 to 3.49

Example: heights N(70, 3). P(X > 76) = P(Z > 2) = 1 − 0.9772 = 0.0228.

x = invNorm(area to the left, μ, σ)

Steps

  1. Convert the question into an area to the left (top 10% means left area 0.90)
  2. Find z* with invNorm(area, 0, 1) or by reading the table body backward
  3. Un-standardize: x = μ + z*σ

Variables

  • percentile — the value with that fraction of the area to its left
  • z* — the cutoff on the standard scale
  • middle 95% — cutoffs at z = ±1.96, i.e. areas 0.025 and 0.975

Example: the 90th percentile of N(70, 3): z* = 1.2816, x = 70 + 1.2816(3) ≈ 73.8 inches.

T-Distribution

Continuous Random Variables

Shape and degrees of freedom

When σ is replaced by the sample SD s, the standardized statistic picks up extra variability. The t-distribution is the normal curve with that extra uncertainty built in.

The t statisticStudent’s t
ShapeHeavier tails that shrink with df
t = x̄ − μs ⁄ √n

Conditions

  1. Random sample
  2. Population normal, or n ≥ 30 (robust to mild skew when n is moderate)
  3. σ unknown; s is used in its place

Variables

  • s — sample standard deviation
  • df — degrees of freedom; n − 1 for one sample
  • t* — critical value: invT(area to the left, df)

The t-distribution depends on df only. There is one normal curve but a whole family of t curves.

df → ∞  ⇒  t → N(0, 1)

Properties

  1. Symmetric and bell-shaped, centered at 0
  2. More spread than N(0, 1): heavier tails, lower peak
  3. Each extra degree of freedom pulls it closer to the normal curve; by df ≈ 30 the two are close, and tables stop around df = 1000

Critical values at 95%

  • df = 5 = t* = 2.571
  • df = 10 = t* = 2.228
  • df = 30 = t* = 2.042
  • df = ∞ = t* = 1.960 (the z value)

Smaller samples need wider intervals — the larger t* is the price of estimating σ from little data.

When to use t instead of z

Use tThe realistic case
Use zThe textbook case

Means

One-sample mean, paired differences, and two independent means whenever σ is unknown — which is almost always. Also the slope and intercept of a regression line (df = n − 2) and each coefficient in multiple regression (df = n − k − 1).

Degrees of freedom

  • one sample = n − 1
  • paired = npairs − 1
  • pooled two-sample = n1 + n2 − 2
  • Welch = the Welch–Satterthwaite formula (conservative shortcut: the smaller of n1 − 1 and n2 − 1)
  • regression slope = n − 2

Means with known σ

Only when the population standard deviation is given in the problem.

Proportions

Always z. The standard error of p̂ is computed from p (or p̂), not from an estimated σ, so there is no extra uncertainty to account for.

Rule of thumb

Means with s → t. Means with σ → z. Proportions → z. Counts → chi-squared.

Using the t table

Reading a critical valueRow = df, column = tail area
Worked exampleA 95% interval for a mean
  1. Find df (n − 1 for one sample). If the exact df is missing, use the next smaller df listed (a slightly larger, safer t*)
  2. Pick the column: for a confidence level C the one-tail area is (1 − C)⁄2, so 95% → 0.025, 90% → 0.05, 99% → 0.005. For a one-sided test at α use the column α; for a two-sided test use α⁄2
  3. Read t* where the row and column meet. Calculator: invT(1 − tail area, df)
  4. For a p-value by table, locate your t in the df row and bracket it between two columns; the p-value lies between those two tail areas (doubled for two-sided)

Example of bracketing: t = 2.40 with df = 15 sits between 2.131 (0.025) and 2.602 (0.01), so the one-sided p is between 0.01 and 0.025.

A random sample of n = 10 batteries lasts x̄ = 50 hours with s = 6 hours; battery life is roughly normal. Build a 95% confidence interval for the mean life μ.

  1. σ unknown, n small, population normal → t interval with df = 9
  2. t* for 95%, df 9: row 9, column 0.025 → t* = 2.262
  3. Standard error s⁄√n = 6⁄√10 = 6⁄3.162 = 1.897
  4. Margin of error t*·SE = 2.262(1.897) = 4.29
  5. Interval 50 ± 4.29 = (45.71, 54.29) hours

In words: we are 95% confident the mean life of all such batteries is between 45.7 and 54.3 hours. With z* = 1.960 instead, the margin would be 3.72, too narrow for ten observations; the t* of 2.262 is the honest price of estimating σ from s.

Chi-Squared Distribution

Continuous Random Variables

Shape and degrees of freedom

Square a standard normal variable and you get a chi-squared with 1 degree of freedom. Add k independent squared z’s and you get df = k. Because it is a sum of squares, it is never negative.

Definitionχ2 with k degrees of freedom
ShapeRight-skewed, becoming normal
χ2k = Z12 + Z22 + … + Zk2

Properties

  • mean = df
  • variance = 2 · df
  • mode = df − 2 (for df ≥ 2)
  • range = 0 to ∞

Critical values

  • χ2* — invχ²(area to the left, df) or the table, which is indexed by right-tail area
  • tests — almost always right-tailed: large values mean observed is far from expected

Variables with known SD: (n − 1)s2σ2 follows χ2 with n − 1 df when the population is normal. That is the basis of the variance test.

df ↑  ⇒  peak moves right and the curve becomes symmetric

Shape by df

  1. df = 1 or 2: starts high at 0 and decays (J-shaped)
  2. df = 3 and up: rises to a peak near df − 2, then a long right tail
  3. df > 30 or so: approximately normal with mean df and SD √2df

Critical values at α = 0.05 (right tail)

  • df = 1 = 3.841 (= 1.962)
  • df = 2 = 5.991
  • df = 4 = 9.488
  • df = 10 = 18.307

Notice df = 1 squares the familiar 1.96. A two-proportion z-test and the 2×2 chi-squared test are the same test for that reason.

Where it appears

Tests on countsChi-Squared Tests tab
Tests on varianceChi-Squared Tests tab
χ2 = Σ (O − E)2E
  • goodness of fit = one categorical variable; df = k − 1
  • independence = two variables, one sample; df = (r − 1)(c − 1)
  • homogeneity = one variable, several populations; df = (r − 1)(c − 1)
  • McNemar = paired yes/no; df = 1

Condition for all of them: every expected count at least 5 (some texts allow 80% of cells at 5 and none below 1).

χ2 = (n − 1)s2σ02
  • one-variance test = H0: σ2 = σ02; df = n − 1
  • CI for σ2 = from (n − 1)s2χ2right to (n − 1)s2χ2left

Unlike the count tests this one can be two-tailed, and it is sensitive to non-normality — the normal-population condition is not optional here.

Worked example

A confidence interval for a varianceTwo different critical values

A random sample of n = 15 fill weights from a normal process has s2 = 20 g2. Give a 95% interval for σ2 and for σ.

  1. df = n − 1 = 14; (n − 1)s2 = 14(20) = 280
  2. Two table values, because the curve is not symmetric: right-tail 0.025 gives χ2right = 26.119; right-tail 0.975 (left-tail 0.025) gives χ2left = 5.629
  3. Lower limit 280⁄26.119 = 10.72; upper limit 280⁄5.629 = 49.74. So 10.72 ≤ σ2 ≤ 49.74 g2
  4. Square-root both ends for σ: 3.27 to 7.05 g

The larger χ2 value goes in the lower limit; the interval is not centered on s2 = 20 and that is correct. For the one-variance test the same pieces give χ2 = 280⁄σ02: testing H0: σ2 = 12 against Ha: σ2 > 12 gives χ2 = 280⁄12 = 23.33, just short of the right-tail 0.05 value 23.685 for df 14, so at α = 0.05 you fail to reject, barely.

F-Distribution

Continuous Random Variables

Shape and two degrees of freedom

The F-distribution is the ratio of two independent chi-squared variables, each divided by its degrees of freedom. In practice: a ratio of two variances. It needs two df values — one for the top, one for the bottom.

DefinitionF(df1, df2)
ShapeRight-skewed, centered near 1
F = χ21 ⁄ df1χ22 ⁄ df2 = s12 ⁄ σ12s22 ⁄ σ22

Variables

  • df1 — numerator degrees of freedom (the variance on top)
  • df2 — denominator degrees of freedom
  • F* — critical value from the F table or invF; tables are indexed by right-tail area and both df

Conditions

  1. Both populations normal (F is sensitive to this)
  2. Independent samples

Reciprocal rule: F1−α(df1, df2) = 1 ⁄ Fα(df2, df1). Tables only print right tails for this reason.

F ≈ 1 when H0 is true

Properties

  1. Never negative; starts at 0
  2. Mean ≈ df2 ⁄ (df2 − 2), slightly above 1
  3. Skewed right; the skew eases as both df grow
  4. F with (1, df) is the square of t with df: F = t2

Reading a result

  • F near 1 — the two variances (or the between- and within-group spreads) are alike
  • F large — the numerator variance is much bigger — the evidence against H0

The regression F-test with one predictor gives exactly the square of the slope t-statistic, with the same p-value.

Where it appears

Comparing two variancesTests for Means tab
ANOVA and regressionANOVA and Regression tabs
F = s12s22,  larger s2 on top
  • H0 = σ12 = σ22
  • df = (n1 − 1, n2 − 1)
  • use — the gatekeeper before a pooled two-sample t-test; rejecting means unequal variances, so use Welch

Levene’s test is the robust alternative software reports when normality is doubtful.

F = MSBMSW    or    F = MSRMSE
  • one-way ANOVA = df = (k − 1, N − k)
  • two-way ANOVA = one F for each factor and one for the interaction
  • regression = df = (k, n − k − 1); tests whether the whole model explains anything

Every F here asks the same question: is the variation explained by the model large compared with the leftover (error) variation?

Worked example

Two variances, then the right t-testReading the F table with two df

Sample 1: n1 = 16, s1 = 6 (so s12 = 36). Sample 2: n2 = 10, s2 = 4 (s22 = 16). Both populations roughly normal. Can the variances be treated as equal? Use α = 0.05.

  1. H0: σ12 = σ22; Ha: σ12 ≠ σ22 (two-sided)
  2. Larger variance on top: F = 36⁄16 = 2.25
  3. df1 = 16 − 1 = 15 (numerator, the sample on top), df2 = 10 − 1 = 9
  4. Two-sided at α = 0.05 with the larger variance on top means the right-tail area 0.025: F* = F0.025(15, 9) = 3.77. The columns of the table are df1, the rows df2
  5. 2.25 < 3.77 (p ≈ 0.22): fail to reject. There is no evidence the spreads differ, so a pooled two-sample t-test with df = 24 is reasonable

Had F come out above 3.77, you would conclude the variances differ and run the Welch test instead. Putting the larger variance on top is what lets you use only the right tail; if a problem fixes which sample is “1” and the ratio is below 1, use the reciprocal rule to get the left critical value: F0.975(15, 9) = 1⁄F0.025(9, 15).

Sampling Distributions

The bridge between probability and inference

The Bridge to Inference

This is the concept that makes every formula after it make sense. A sampling distribution is the distribution of a statistic across all possible samples — not the distribution of the data.

Three distributions to keep apartPopulation, sample, sampling
Standard errorThe spread of a statistic

Which distribution is which

  1. Population distribution — the values of every individual; mean μ, SD σ; fixed and usually unseen
  2. Sample distribution — the values in your one sample; mean x̄, SD s; what the histogram of your data shows
  3. Sampling distribution — the values of a statistic (x̄, p̂, s, b1) over all possible samples of size n

Variables

  • sampling variability — a statistic changes from sample to sample purely by chance
  • unbiased — the mean of the sampling distribution equals the parameter: x̄ for μ, p̂ for p, s2 for σ2

A histogram of 1,000 sample means is a picture of the sampling distribution of x̄. It is much narrower than the population histogram.

σstatistic  →  estimated by  SE

Definitions

  1. The standard deviation of a statistic measures how far it typically falls from the parameter
  2. The standard error is that standard deviation estimated from the sample (s in place of σ, p̂ in place of p)

Variables

  • σx̄ = σ ⁄ √n
  • SEx̄ = s ⁄ √n
  • σp̂ = √p(1 − p)n
  • SEp̂ = √p̂(1 − p̂)n

Two levers

Spread shrinks with √n: four times the sample halves the standard error. It does not depend on the population size (as long as the sample is under 10% of it).

Why it matters

Confidence intervalsReverse the sampling distribution
Hypothesis testsCompare to the null sampling distribution

If 95% of all sample means fall within 1.96 standard errors of μ, then for 95% of samples the interval x̄ ± 1.96·SE captures μ. The margin of error is simply a multiple of the standard error.

Assume the null is true, build the sampling distribution it implies, and ask how unusual your statistic is in it. The test statistic z or t is the statistic’s position measured in standard errors; the p-value is its tail area.

Central Limit Theorem

Sampling Distributions

The theorem

Whatever shape the population has, the sampling distribution of the sample mean becomes approximately normal as the sample size grows. This is what lets z and t procedures work on skewed data.

StatementFor the sample mean
StatementFor the sample sum and the sample proportion
x̄ ≈ N(μ, σ√n)

Conditions

  1. Random sample (or random assignment)
  2. Independent observations: sample under 10% of the population when sampling without replacement
  3. Population normal (then it holds for any n), or n large enough — the usual cutoff is n ≥ 30

Variables

  • μx̄ = μ — exact, for any n
  • σx̄ = σ ⁄ √n — exact, for any n
  • shape — the only part that needs the theorem

The mean and spread of x̄ are facts about averages; only the normal shape is the Central Limit Theorem.

ΣX ≈ N(nμ, σ√n)

Sum version

Multiply the mean result by n: total of n values has mean nμ and SD σ√n. Spread of a sum grows with √n, not n.

Proportion version

p̂ ≈ N(p, √p(1 − p)n)

A proportion is the mean of 0/1 values, so the same theorem applies. Large enough here means np ≥ 10 and n(1 − p) ≥ 10 rather than n ≥ 30, because the 0/1 population is as skewed as p is far from 0.5.

Why n ≥ 30

Where 30 comes fromA rule of thumb, not a law
What the theorem does not sayCommon misreadings
  1. If the population is already normal, x̄ is exactly normal for n = 2
  2. Mild skew washes out by n ≈ 15
  3. Strong skew or heavy tails may need n of 40, 50 or more
  4. Thirty is the textbook compromise that is safe for the moderately skewed populations most problems use

Look at the data. A histogram with extreme outliers or a very long tail deserves a bigger n or a nonparametric method.

  1. It does not say the data become normal as n grows — a skewed population stays skewed; only the distribution of x̄ is normal
  2. It does not make σx̄ smaller than σ ⁄ √n — that formula is exact regardless
  3. It does not rescue a biased sample. Normal shape around the wrong center is still wrong

Example: household income is heavily right-skewed. The mean of a random sample of 50 households is nonetheless close to normally distributed around the population mean.

Distribution of the Sample Mean

Sampling Distributions

Center and spread of x̄

Take every possible sample of size n, compute each mean, and look at how those means are distributed. Their center matches the population; their spread is smaller by a factor of √n.

Mean and standard deviation of x̄Exact for any n
Standardizing x̄The z-score for a mean
μx̄ = μ     σx̄ = σ√n

Conditions

  1. Random sample of n independent observations
  2. 10% condition when sampling without replacement (otherwise multiply by the finite-population correction √N − nN − 1)

Variables

  • μ — population mean
  • σ — population standard deviation
  • n — sample size
  • σx̄ — standard deviation of the sample mean (the standard error when σ is known)

Shape

Normal if the population is normal; approximately normal for n ≥ 30 by the Central Limit Theorem.

z = x̄ − μσ ⁄ √n

Steps

  1. Check that x̄ is (approximately) normal
  2. Compute σx̄ = σ⁄√n — not σ
  3. Standardize and use the normal table or normalcdf

Variables

  • z — how many standard errors the observed mean is from μ
  • P(x̄ > a) — normalcdf(a, 1E99, μ, σ⁄√n)

Example: IQ ~ N(100, 15). For one person, P(X > 110) = P(Z > 0.67) = 0.25. For the mean of 25 people, σx̄ = 3 and P(x̄ > 110) = P(Z > 3.33) = 0.0004. Averages are far less variable than individuals.

Standard error of the mean

When σ is unknownThe practical version
Reading the formulaWhat moves the standard error
SEx̄ = s√n

Variables

  • s — sample standard deviation, standing in for σ
  • SE — the estimated standard deviation of x̄

Consequence

Replacing σ with s adds uncertainty, so the standardized statistic x̄ − μs ⁄ √n follows a t-distribution with n − 1 df instead of N(0, 1). Every t-interval and t-test on the later tabs is this formula at work.

  • larger n — smaller SE, but only by √n: 4× the data for half the SE
  • larger σ — more variable population, larger SE
  • population size N — no effect, once the sample is under 10% of it

Precision is bought with sample size, and the price rises quickly: cutting a margin of error to a third needs nine times the data.

Distribution of the Sample Proportion

Sampling Distributions

Center and spread of p̂

A proportion is a count divided by n: p̂ = X ⁄ n with X binomial. Dividing the binomial mean and SD by n gives everything below.

Mean and standard deviation of p̂From the binomial
Standardizing p̂The z-score for a proportion
μp̂ = p     σp̂ = √p(1 − p)n

Conditions

  1. Random sample
  2. Independent trials: 10% condition when sampling without replacement
  3. Large counts for a normal shape: np ≥ 10 and n(1 − p) ≥ 10

Variables

  • p — population proportion
  • p̂ — sample proportion, X ⁄ n
  • X — number of successes, B(n, p)
  • σp̂ — standard deviation of the sample proportion

From the binomial

μX ⁄ n = np ⁄ n = p     σX ⁄ n = √np(1 − p) ⁄ n = √p(1 − p)n
z = p̂ − p√p(1 − p)n

Steps

  1. Verify np ≥ 10 and n(1 − p) ≥ 10
  2. Compute σp̂ with the population p
  3. Standardize; use the normal table or normalcdf

Variables

  • z — standard errors between the observed proportion and p
  • P(p̂ > a) — normalcdf(a, 1E99, p, √p(1 − p)n)

Example: 60% of voters favor a measure; poll 400. σp̂ = √(0.6·0.4⁄400) = 0.0245. P(p̂ < 0.55) = P(Z < −2.04) = 0.021.

Standard error of a proportion

For a confidence intervalUse p̂
For a hypothesis testUse p0
SEp̂ = √p̂(1 − p̂)n

The population p is unknown (it is what you are estimating), so the sample p̂ stands in. Conditions use p̂ too: np̂ ≥ 10 and n(1 − p̂) ≥ 10. This is the Wald standard error; the One-Sample Proportion Methods tab has the better alternatives.

σp̂ = √p0(1 − p0)n

A test assumes H0: p = p0 is true, so the hypothesized p0 goes into both the standard deviation and the large-count check. Mixing these two up changes the answer slightly and is a very common error.

Shape of p̂

Most skewed when p is near 0 or 1, which is why the large-count condition is on both np and n(1 − p). At p = 0.5 the binomial is symmetric and the normal approximation works for small n.

Confidence Intervals

Estimating a population parameter

Confidence Intervals

point estimate ± margin of error

Purpose: to estimate a population parameter using a sample statistic.

The form depends on: whether the variable is quantitative or categorical, whether the population standard deviation is known, the sample size, and how many samples are involved.

One sample means

One sample mean Standard deviation unknown — t
One sample mean Standard deviation known — z

Confidence interval
(t-interval)

x̄ ± t* · s√n

Conditions

  1. Random sample
  2. Normality, or n ≥ 30
  3. Population σ is unknown

Variables

  • x̄ — sample mean (the point estimate)
  • s — sample standard deviation
  • n — sample size
  • SE = s√n
  • df = n − 1
  • t* = invT(CL, df)
  • ME = t* · SE

Formula

x̄ ± ME
x̄ ± t* · SE

Confidence interval
(z-interval)

x̄ ± z* · σ√n

Conditions

  1. Random sample
  2. Normality, or n ≥ 30
  3. Population σ is known

Variables

  • x̄ — sample mean (the point estimate)
  • σ — population standard deviation
  • n — sample size
  • SE = σ√n
  • z* = invNorm(CL, 0, 1)
  • ME = z* · SE

Formula

x̄ ± ME
x̄ ± z* · SE

Two sample means — independent

Two sample means Independent, equal variances
Two sample means Independent, unequal variances

Confidence interval
(pooled t-interval)

(x̄1 − x̄2) ± t* · sp · √1n1 + 1n2

Pooled standard deviation

sp = √(n1−1)s12 + (n2−1)s22n1 + n2 − 2

Conditions

  1. Random samples
  2. Independent samples
  3. Normality, or n ≥ 30
  4. Equal variances: σ12 = σ22

Variables

  • x̄1, x̄2 — the two sample means
  • s1, s2 — the two sample standard deviations
  • sp — pooled standard deviation
  • df = n1 + n2 − 2
  • t* = invT(CL, df)

Point estimate is the difference of the means.

Confidence interval
(Welch’s method)

(x̄1 − x̄2) ± t* · √s12n1 + s22n2

Conditions

  1. Random samples
  2. Independent samples
  3. Normality, or n ≥ 30
  4. Unequal variances: σ12 ≠ σ22

Variables

  • x̄1, x̄2 — the two sample means
  • s1, s2 — the two sample standard deviations
  • df — from the Welch–Satterthwaite formula; let the calculator compute it
  • t* = invT(CL, df)

This is the default two-sample interval when you cannot justify equal variances.

Two sample means — dependent

Two sample means Dependent — paired

Confidence interval
(paired t-interval)

d̄ ± t* · sd√n

Conditions

  1. Random sample of pairs
  2. Each pair is matched or repeated on the same subject
  3. The differences are approximately normal, or n ≥ 30

Variables

  • d̄ — mean of the paired differences (the point estimate)
  • sd — standard deviation of the differences
  • n — number of pairs
  • df = n − 1
  • t* = invT(CL, df)

Compute each difference first, then treat the differences as a single sample.

Proportions

One sample proportion One proportion z-interval
Two sample proportions Two proportion z-interval

Confidence interval

p̂ ± z* · √p̂(1 − p̂)n

Conditions

  1. Random sample
  2. Normality: np̂ ≥ 10 and n(1 − p̂) ≥ 10

Variables

  • p̂ — sample proportion (the point estimate)
  • n — sample size
  • SE = √p̂(1−p̂)n
  • z* = invNorm(CL, 0, 1)
  • ME = z* · SE

Formula

p̂ ± ME
p̂ ± z* · SE

Confidence interval

(p̂1 − p̂2) ± z* · √p̂1(1−p̂1)n1 + p̂2(1−p̂2)n2

Conditions

  1. Random samples
  2. Independent samples
  3. Normality in both groups: np̂ ≥ 10 and n(1 − p̂) ≥ 10

Variables

  • p̂1, p̂2 — the two sample proportions
  • n1, n2 — the two sample sizes
  • z* = invNorm(CL, 0, 1)

Do not pool the proportions here. Pooling belongs to the two proportion hypothesis test, not the interval.

Two corrections from the original sheet. The proportion intervals were written with σ∕√n, which is the formula for a mean. A proportion has no separate σ — its standard error is built from p̂ itself, as shown above. The two proportion interval was also missing its z* multiplier.

One-Sample Proportion Methods

Confidence Intervals

Four ways to build a confidence interval for one population proportion p. They share the same data (x successes in n trials) and the same z*, and differ in where the interval is centered and how its width is computed. All of them need a random sample and independence (10% condition).

Wald (textbook)

The method most intro texts present. Under-covers when p̂ is near 0 or 1 or when n is small, because it centers on p̂ and uses p̂ to estimate its own standard error.

One sample proportionWald — z
Why it misbehavesAnd when it is fine

Confidence interval
(z-interval)

p̂ ± z* · √p̂(1 − p̂)n

Conditions

  1. Random sample
  2. Normality: np̂ ≥ 10 and n(1 − p̂) ≥ 10
  3. Independence: sample under 10% of the population

Variables

  • p̂ — x ⁄ n, the sample proportion (the point estimate)
  • x — number of successes
  • n — sample size
  • SE = √p̂(1 − p̂)n
  • CL — confidence level
  • z* = invNorm(CL, 0, 1), the z critical value
  • ME = z* · SE

Formula

p̂ ± ME
p̂ ± z* · SE

Note the standard error is √p̂(1 − p̂)n, not σ⁄√n: a proportion has no separate σ — its spread is fixed by p itself.

The problem

  1. p̂ can land at 0 or 1, giving SE = 0 and an interval of zero width
  2. Bounds can run below 0 or above 1
  3. Actual coverage of a “95%” interval is often 85–92% for small n or extreme p, and it does not improve smoothly as n grows

When it is acceptable

Large n with p̂ between about 0.3 and 0.7 — in that zone all four methods agree to two decimals.

Example (used on all four methods)

x = 12 successes in n = 40, 95% confidence (z* = 1.96). p̂ = 0.30, SE = √(0.30·0.70⁄40) = 0.0725, ME = 0.142. Wald: (0.158, 0.442).

Wilson (score)

Generally the best default. The plain Wald interval treats p̂ as approximately normal and centers the interval at p̂; that is unstable when n is small or p̂ is near 0 or 1. The Wilson derivation inverts the score test instead, which pulls the center a little toward 0.5 (by z2⁄2n) and inflates the denominator by 1 + z2⁄n. The result: better coverage (the probability that the interval contains the true p), bounds that stay inside [0, 1], and intervals shorter on average than the exact method but more accurate than Wald.

One sample proportionWilson score — z
Reading the piecesp̂ and p̃ play different roles

Confidence interval
(score interval)

p̃ ± ME

Adjusted center

p̃ = p̂ + z22n1 + z2n

Margin of error

ME = z1 + z2n · √p̂(1 − p̂)n + z24n2

Conditions

  1. Random sample
  2. Works for any n and any p̂, including x = 0 or x = n; the np ≥ 10 check is not required
  3. Independence: sample under 10% of the population

Variables

  • p̂ — observed sample proportion, x ⁄ n
  • p̃ — Wilson-adjusted center, created by inverting the score test
  • z — the same critical value z* as Wald (1.96 for 95%)
  • n — sample size

Same data, different role

p̂ is the observed proportion and remains the point estimate you report. p̃ is only the center of the interval: it is p̂ regularized toward 0.5 by a small amount, and the regularization fades as n grows (z2⁄n → 0, so p̃ → p̂).

Why it works

The score test uses the hypothesized p, not p̂, in its standard error — exactly as the one-proportion z-test does. Wilson is the set of all p0 that test would not reject, so interval and test agree.

Example

x = 12, n = 40, z = 1.96: p̃ = (0.30 + 0.0480)⁄(1.0960) = 0.3175; ME = (1.96⁄1.0960)·√(0.00525 + 0.00060) = 1.788·0.0765 = 0.137. Wilson: (0.181, 0.454). Narrower on the low side than Wald, and shifted toward 0.5.

Agresti–Coull (plus-four)

Add two successes and two failures, then run Wald on the adjusted counts. It is a simplified Wilson that keeps almost all of the coverage benefit and is easy to do by hand.

One sample proportionAgresti–Coull — z
Why adding four worksAnd how it compares

Confidence interval
(plus-four interval)

p̃ ± z* · √p̃(1 − p̃)ñ

Adjusted counts

x̃ = x + 2     ñ = n + 4     p̃ = x + 2n + 4

Conditions

  1. Random sample
  2. n ≥ 10 is enough; no np ≥ 10 check is needed
  3. Independence: sample under 10% of the population
  4. Use 95% confidence (the “+4” is z2 ≈ 4 for z = 1.96; for other levels add z2⁄2 successes and z2⁄2 failures)

Variables

  • p̃ — adjusted proportion, the center
  • ñ — adjusted sample size
  • SE = √p̃(1 − p̃)ñ
  • z* = invNorm(CL, 0, 1)
  • ME = z* · SE

Formula

p̃ ± ME

The idea

Two phantom successes and two phantom failures pull the center toward 0.5 by about the same amount as Wilson does (its center is exactly p̃ when z = 2), and keep the standard error away from zero when x = 0 or x = n.

Compared with the others

  • vs Wald — same algebra, far better coverage; never a zero-width interval
  • vs Wilson — same center at 95%; slightly wider because it uses p̃ in the SE; a hair conservative for small n
  • report — still report p̂ = x⁄n as the point estimate

Example

x = 12, n = 40: p̃ = 14⁄44 = 0.318, SE = √(0.318·0.682⁄44) = 0.0702, ME = 0.138. Agresti–Coull: (0.181, 0.456). Almost identical to Wilson.

Clopper–Pearson (exact)

Guaranteed coverage, but conservative — intervals run wide. Instead of a normal approximation it inverts the binomial distribution itself: the interval is every p for which the observed x would not be in either 2.5% tail.

One sample proportionClopper–Pearson — binomial
Why it is exact and why that costs width

Confidence interval
(exact binomial interval)

(pL, pU)

Defining equations

P(X ≥ x | p = pL) = α⁄2     P(X ≤ x | p = pU) = α⁄2

Closed form (beta quantiles)

pL = Beta(α⁄2; x, n − x + 1)     pU = Beta(1 − α⁄2; x + 1, n − x)

Conditions

  1. Random sample
  2. Binomial setting (independent trials, constant p); no sample-size requirement at all
  3. If x = 0 take pL = 0; if x = n take pU = 1

Variables

  • x — observed successes
  • n — trials
  • α — 1 − CL (0.05 for 95%)
  • Beta(q; a, b) — the q-quantile of a Beta(a, b) distribution: BETA.INV(q, a, b) in a spreadsheet, qbeta(q, a, b) in R

There is no p̂ ± ME form; the interval is not symmetric around p̂.

Exact

For every true p the interval captures p at least 95% of the time — no approximation can fail. That is the guarantee.

Conservative

Because X is discrete, hitting exactly 95% is impossible; the actual coverage is often 97–99%, which shows up as an interval wider than Wilson’s. Rule of thumb: Clopper–Pearson when coverage must never fall short (safety, regulatory work, very small n); Wilson for everything else.

Example

x = 12, n = 40: pL = Beta(0.025; 12, 29) = 0.166, pU = Beta(0.975; 13, 28) = 0.465. Clopper–Pearson: (0.166, 0.465), the widest of the four.

All four on the same data

MethodCenterIntervalWidth
Wald0.300(0.158, 0.442)0.284
Wilson0.318(0.181, 0.454)0.273
Agresti–Coull0.318(0.181, 0.456)0.275
Clopper–Pearson—(0.166, 0.465)0.299

Determining Sample Size

Confidence Intervals

Work the margin-of-error formula backward: decide how precise the interval must be (ME) and how confident (z*), then solve for n. Always round up to the next whole number — rounding down would miss the target margin.

Sample size for a mean

Estimating a meanto within a margin ME
Where σ comes fromAnd a worked example

Required sample size

n = z* · σME2    → round up

Derivation

ME = z* · σ√n  ⇒  √n = z* · σME

Conditions

  1. A value for σ is available (known, or from a pilot study or past data)
  2. The resulting n is large enough for the normal approximation, or the population is normal

Variables

  • ME — the largest margin of error you will accept (half the interval width)
  • z* = invNorm(CL, 0, 1): 1.645, 1.960, 2.576 for 90%, 95%, 99%
  • σ — population standard deviation or its best estimate
  • n — the minimum sample size

Estimating σ

  • pilot sample — use its s
  • earlier studies — use their reported SD
  • range rule — σ ≈ range ⁄ 4 (or ⁄ 6 for a very large population)

z* is used rather than t* because n is not known yet, so no df exists. If the final n is small, repeat the calculation with t* for that df.

Example

Estimate mean commute time to within 2 minutes with 95% confidence; a pilot gave s = 12. n = (1.96·12⁄2)2 = (11.76)2 = 138.3 → 139 people. Halving ME to 1 minute needs 553 — four times as many.

Sample size for a proportion

Estimating a proportionto within a margin ME
The conservative choiceWhen no estimate exists

Required sample size

n = p̂(1 − p̂) · z*ME2    → round up

Derivation

ME = z* · √p̂(1 − p̂)n  ⇒  n = z*2 · p̂(1 − p̂)ME2

Conditions

  1. Random sampling is planned
  2. A guess for p̂ from a pilot or prior study, or use 0.5 (right cell)
  3. Check np̂ ≥ 10 and n(1 − p̂) ≥ 10 for the planned n

Variables

  • ME — desired margin of error, as a proportion (0.03 for ±3 points)
  • z* = invNorm(CL, 0, 1)
  • p̂ — a prior estimate of the proportion
  • n — the minimum sample size
n = 0.25 · z*ME2

Why 0.5

p̂(1 − p̂) is largest at p̂ = 0.5, where it equals 0.25. Using it guarantees the margin no matter what the true p turns out to be; it over-samples only if p is far from 0.5.

Example

A poll wants ±3 points at 95% with no prior estimate: n = 0.25(1.96⁄0.03)2 = 0.25(4268.4) = 1067.1 → 1068 voters. That is why national polls run about 1,000 people. With a prior p̂ = 0.2: n = 0.16(4268.4) = 683 → 683.

Watch the units

ME and p̂ are proportions, not percentages. Writing ME = 3 instead of 0.03 gives a nonsense n less than 1.

Hypothesis Testing

Tests, errors, and decision rules

Hypothesis Testing — Fundamentals

Stating the hypotheses Null and alternative
Test statistic and p-value Measuring the evidence

Null hypothesis (H0)

A claim of no effect or status quo. Always stated with equality: μ = μ0 or p = p0.

Alternative (Ha)

A claim of a difference, an effect, or a directional change.

Two-tailed

Ha: μ ≠ μ0

“Is there evidence the average salary differs from $60,000?”

Right-tailed

Ha: μ > μ0

“Is the new drug more effective than the standard?”

Left-tailed

Ha: μ < μ0

“Did the training reduce average completion time?”

Test statistic

estimate − hypothesized valuestandard error

It counts how many standard errors the sample result sits from the null value.

Standard error

The standard deviation of the sampling distribution.

P-value

The probability of observing a result at least as extreme as the sample result, assuming H0 is true. It is not the probability that H0 is true.

Significance level (α)

The threshold set before the test. Common values are 0.10, 0.05, and 0.01.

Decision rule Reject or fail to reject
Errors Type I and Type II

If p ≤ α

Reject H0. There is sufficient statistical evidence to reject the null hypothesis in favor of the alternative.

If p > α

Fail to reject H0. There is not enough statistical evidence to reject the null hypothesis.

Wording

Never say you “accept” the null or that you “proved” anything. Failing to reject means the evidence was insufficient, not that H0 is true.

Type I error (α)

Rejecting H0 when it is actually true. A false alarm — concluding an effect exists when it does not. Its probability is exactly α.

Type II error (β)

Failing to reject H0 when it is actually false. A missed detection — a real effect goes unnoticed.

Power

Power = 1 − β

The probability of correctly detecting a real effect. Power rises with larger n, larger effect size, and larger α.

Choosing Pooled-t or Welch

Before running a two-sample t-test you have to decide whether the two population variances can be treated as equal. That decision is itself a hypothesis test, and its outcome only tells you which t-test to run next.

F-test for two variances The test that picks your t-test
F = s12s22

Hypotheses

H0: σ12 = σ22
Ha: σ12 ≠ σ22

Degrees of freedom

df1 = n1 − 1 (numerator), df2 = n2 − 1 (denominator). Put the larger variance on top.

The counterintuitive part

Rejecting the null here means the variances are unequal. So rejection sends you to Welch, and failing to reject sends you to pooled-t.

If variances are equal Fail to reject — use pooled-t
If variances are unequal Reject — use Welch

Pooled standard deviation

sp = √(n1−1)s12 + (n2−1)s22n1 + n2 − 2

Both samples contribute to one shared estimate of spread, weighted by their degrees of freedom.

Unpooled standard error

√s12n1 + s22n2

Each sample keeps its own variance. Degrees of freedom come from the Welch–Satterthwaite approximation.

Correction from the original sheet. The original used a chi-square test to compare the two variances. Chi-square tests a single variance against a fixed value; comparing two variances is an F-test, since the ratio of two sample variances follows an F-distribution. The chi-square test for one variance still appears below under Chi-Squared Tests.

Tests for Means

Hypothesis Testing

Hypothesis Tests — Means

One sample mean σ unknown — t-test
One sample mean σ known — z-test
t = x̄ − μ0s√n

Conditions

  1. Random sample
  2. Normality, or n ≥ 30
  3. σ unknown

Variables

  • μ0 — the value claimed by H0
  • s — sample standard deviation
  • df = n − 1

Calculator: T-Test.

z = x̄ − μ0σ√n

Conditions

  1. Random sample
  2. Normality, or n ≥ 30
  3. σ known

Variables

  • μ0 — the value claimed by H0
  • σ — population standard deviation

Calculator: Z-Test.

Two sample means Equal variances — pooled-t test
Two sample means Unequal variances — Welch
t = x̄1 − x̄2sp · √1n1 + 1n2

Conditions

  1. Random, independent samples
  2. Normality, or n ≥ 30
  3. Equal variances

Degrees of freedom

df = n1 + n2 − 2

Calculator: 2-SampTTest with Pooled: Yes.

t = x̄1 − x̄2√s12n1 + s22n2

Conditions

  1. Random, independent samples
  2. Normality, or n ≥ 30
  3. Unequal variances

Degrees of freedom

Welch–Satterthwaite approximation. Let the calculator handle it.

Calculator: 2-SampTTest with Pooled: No.

Dependent samples Paired t-test
t = d̄ − μdsd√n

Conditions

  1. Random sample of matched pairs
  2. The differences are approximately normal, or n ≥ 30

Variables

  • d̄ — mean of the paired differences
  • μd — hypothesized mean difference, usually 0
  • sd — standard deviation of the differences
  • n — number of pairs
  • df = n − 1

Calculator: build a list of differences, then run T-Test on that list.

Running any test for a mean Six steps, in order
Welch degrees of freedom When you must do it by hand
  1. Hypotheses. H0: μ = μ0 (or μ1 − μ2 = 0, or μd = 0). Ha uses <, > or ≠, chosen from the wording of the question before looking at the data. Write both in words too: “the mean wait is 4 minutes” vs “the mean wait is longer than 4 minutes.”
  2. Conditions. Random sample; normal population or n ≥ 30 (for two samples, each group); independent groups, or paired data turned into one list of differences. σ given → z; otherwise s and t.
  3. Statistic. (estimate − null value) ÷ standard error, using the formula in the matching cell above.
  4. Degrees of freedom. n − 1; n1 + n2 − 2 (pooled); Welch (right); number of pairs − 1. Not needed for z.
  5. P-value or critical value. P-value: the tail area beyond the statistic in the t (or z) curve with that df, doubled for ≠. Critical value: t* with the same df and the tail area α (α/2 per tail for ≠).
  6. Decision and conclusion. Reject H0 if p ≤ α (equivalently |t| ≥ t*). Then one sentence in context: “At α = 0.05 there is (not) sufficient evidence that the mean … is …”
df = (s12⁄n1 + s22⁄n2)2(s12⁄n1)2n1 − 1 + (s22⁄n2)2n2 − 1

How to use it

  1. Compute each sample’s s2⁄n (these are the two pieces under the Welch square root)
  2. Square their sum for the numerator; square each one, divide by its own n − 1, and add for the denominator
  3. Round down to a whole number if you are using a table; software keeps the decimal

Example

s1 = 1.2, n1 = 16 gives 1.44⁄16 = 0.09; s2 = 2.0, n2 = 10 gives 4⁄10 = 0.40. Numerator (0.49)2 = 0.2401. Denominator 0.0081⁄15 + 0.16⁄9 = 0.00054 + 0.01778 = 0.01832. df = 0.2401⁄0.01832 = 13.1, so use df = 13.

The answer always lands between the smaller of n1 − 1 and n2 − 1 (here 9, the conservative shortcut) and n1 + n2 − 2 (here 24).

Worked example One-sample t-test, start to finish

A café claims its mean wait is 4 minutes. A random sample of n = 16 customers waits x̄ = 4.6 minutes with s = 1.2 minutes; waits look roughly normal. Is the mean wait longer than claimed? Use α = 0.05.

  1. H0: μ = 4 (the claim holds). Ha: μ > 4 (waits are longer). Right-tailed, because the question asks “longer.”
  2. Random sample, n < 30 but no strong skew, σ unknown → one-sample t-test.
  3. Standard error s⁄√n = 1.2⁄√16 = 1.2⁄4 = 0.3. Statistic t = (4.6 − 4)⁄0.3 = 0.6⁄0.3 = 2.00.
  4. df = n − 1 = 15.
  5. Critical value: t* = 1.753 (df 15, one tail 0.05). P-value: P(T15 > 2.00) = 0.032.
  6. 2.00 > 1.753 and 0.032 < 0.05, so reject H0. At the 5% level there is sufficient evidence that the mean wait is longer than 4 minutes. The sample mean sits two standard errors above the claim, which happens about 3 times in 100 if the claim were true.

Had the alternative been μ ≠ 4, the p-value would be 2(0.032) = 0.064 > 0.05 and you would fail to reject: same data, different tail, different conclusion.

Watch out. Use s and the t-distribution unless σ is literally given; the n ≥ 30 rule relaxes the normality condition, it does not turn t into z. Before and after measurements on the same people are paired — running a two-sample test on them ignores the pairing and usually hides a real effect. The standard error shrinks with √n, not with n: quadrupling the sample only halves it.

Tests for Proportions

Hypothesis Testing

Hypothesis Tests — Proportions

One sample proportion One proportion z-test
Two sample proportions Two proportion z-test
z = p̂ − p0√p0(1 − p0)n

Conditions

  1. Random sample
  2. np0 ≥ 10 and n(1 − p0) ≥ 10

Variables

  • p̂ — sample proportion
  • p0 — the value claimed by H0

The standard error uses p0, not p̂ — the test assumes H0 is true. This is the one place the test and the interval differ.

z = p̂1 − p̂2√p̂c(1−p̂c)1n1 + 1n2

Pooled proportion

p̂c = x1 + x2n1 + n2

Conditions

  1. Random, independent samples
  2. At least 10 successes and 10 failures in each group

Variables

  • x1, x2 — number of successes in each sample
  • n1, n2 — the two sample sizes
  • p̂1, p̂2 = x1⁄n1, x2⁄n2 — the sample proportions
  • p̂c — pooled proportion: all successes over all trials

Hypotheses

H0: p1 = p2    Ha: p1 < p2, > p2, or ≠ p2

Under H0 the two proportions are equal, so the successes are combined into one pooled estimate.

Running a proportion test Same six steps as for means
Worked example One-sample z-test for p
  1. Hypotheses. H0: p = p0, in words “the true proportion of … is p0”; Ha with <, > or ≠ from the question.
  2. Conditions. Random sample; sample under 10% of the population (independence); np0 ≥ 10 and n(1 − p0) ≥ 10, checked with p0, not p̂.
  3. Statistic. p̂ = x⁄n; z = (p̂ − p0) ÷ √p0(1 − p0)⁄n.
  4. No degrees of freedom. Proportions always use the standard normal curve.
  5. P-value. Tail area beyond z from the z table or normalcdf, doubled for ≠. Or compare |z| with z* = 1.645 (one tail, α = 0.05), 1.960 (two tails, α = 0.05), 2.326 or 2.576 (α = 0.01).
  6. Conclusion in context, naming the population proportion.

For two proportions, swap in p̂1 − p̂2, the pooled standard error, and the 10-successes-and-10-failures check in each group.

A politician claims half the city supports a new tax. In a random sample of n = 200 residents, x = 116 support it. Test at α = 0.05 whether support differs from 50%.

  1. H0: p = 0.5. Ha: p ≠ 0.5 (“differs” is two-sided).
  2. np0 = n(1 − p0) = 100 ≥ 10; 200 residents is under 10% of a city.
  3. p̂ = 116⁄200 = 0.58. Standard error √0.5(0.5)⁄200 = √0.00125 = 0.03536. z = (0.58 − 0.50)⁄0.03536 = 2.26.
  4. P-value = 2·P(Z > 2.26) = 2(0.0119) = 0.024. Critical value z* = 1.960.
  5. 0.024 < 0.05 (and 2.26 > 1.960): reject H0. There is sufficient evidence at the 5% level that the proportion of residents supporting the tax differs from one half; the sample points to more than half.

Two-sample version: 45 of 150 men and 30 of 150 women support it. p̂1 = 0.30, p̂2 = 0.20, p̂c = 75⁄300 = 0.25. SE = √0.25(0.75)(1⁄150 + 1⁄150) = √0.0025 = 0.05. z = 0.10⁄0.05 = 2.00, two-sided p = 2(0.0228) = 0.046: reject at α = 0.05, barely.

Watch out. The test’s standard error uses p0 (or the pooled p̂c) because it is computed assuming H0; the confidence interval’s uses p̂ (or the two separate p̂’s). Work in decimals, not percents, inside the square root. And report the count conditions with numbers (“np0 = 100 ≥ 10”), not just the words “conditions met.”

Chi-Squared Tests

Hypothesis Testing

Chi-Squared Tests

Independence and homogeneity Two-way contingency tables
Goodness of fit One categorical variable
χ2 = Σ (O − E)2E

Conditions

  1. Random sample
  2. All expected counts ≥ 5
  3. Categories are mutually exclusive
  4. Observations are independent

Expected frequency

Eij = (row totali)(column totalj)grand total

Degrees of freedom

df = (r − 1)(c − 1)

Independence tests one sample on two variables. Homogeneity tests several samples on one variable. The arithmetic is identical; only the wording of the conclusion changes.

χ2 = Σ (O − E)2E

Conditions

  1. Random sample
  2. All expected counts ≥ 5
  3. Categories are mutually exclusive
  4. Observations are independent

Expected frequency

Ei = n · pi

Degrees of freedom

df = k − 1

Variables

  • O — observed frequency
  • E — expected frequency
  • pi — expected theoretical proportion
  • k — number of categories
McNemar’s test Paired dichotomous outcomes
Test for variance Chi-square for a single σ2
χ2 = (b − c)2b + c

Conditions

  1. Paired, matched, or repeated samples
  2. The response has two outcomes
  3. At least 10 discordant pairs: b + c ≥ 10

Variables

  • b — subjects who changed No → Yes
  • c — subjects who changed Yes → No

Degrees of freedom

df = 1

Only the discordant pairs carry information. Subjects who did not change are ignored.

Example

100 voters polled before and after a debate: 15 switched No → Yes (b), 5 switched Yes → No (c), 80 did not change. H0: the proportion saying Yes is the same before and after. χ2 = (15 − 5)2⁄(15 + 5) = 100⁄20 = 5.0 with df = 1; critical value 3.841, p ≈ 0.025. Reject: support shifted, toward Yes. The 80 unchanged voters never enter the arithmetic.

χ2 = (n − 1)s2σ02

Hypotheses

H0: σ2 = σ02

Ha is >, <, or ≠ depending on the tail.

Conditions

  1. Random sample
  2. The population is normal — this test is very sensitive to that

Degrees of freedom

df = n − 1

This compares one variance to a fixed value. To compare two variances, use the F-test.

Running a chi-squared test on counts The steps
Worked example Goodness of fit: is the die fair?
  1. Hypotheses in words. Goodness of fit: H0: the category proportions equal the claimed p1, …, pk; Ha: at least one differs. Independence: H0: the two variables are independent (not associated); Ha: they are associated. Homogeneity: H0: the distribution of the variable is the same in every population.
  2. Expected counts. E = n·pi, or (row total)(column total)⁄grand total. Keep decimals; check every E ≥ 5.
  3. Statistic. For each cell compute (O − E)2⁄E, then add. Large values mean observed is far from expected.
  4. Degrees of freedom. k − 1 for goodness of fit; (r − 1)(c − 1) for a table. The df depends on the number of categories, never on n.
  5. P-value or critical value. Always the right tail: P(χ2df > statistic), or compare with the table value for α in the right tail.
  6. Conclusion in context. A rejection says the pattern differs from H0; look at which cells have the largest (O − E)2⁄E to say how.

A die is rolled 60 times: faces 1 to 6 come up 8, 12, 9, 14, 6, 11 times. Test at α = 0.05 whether the die is fair.

  1. H0: each face has probability 1⁄6. Ha: at least one face has a different probability.
  2. E = 60(1⁄6) = 10 for every face; all ≥ 5.
  3. (O − E)2⁄E: 4⁄10, 4⁄10, 1⁄10, 16⁄10, 16⁄10, 1⁄10. Sum: χ2 = 42⁄10 = 4.20.
  4. df = k − 1 = 5.
  5. Critical value χ2* = 11.070 (df 5, right tail 0.05). P-value = P(χ25 > 4.20) ≈ 0.52.
  6. 4.20 < 11.070, p > 0.05: fail to reject H0. The counts are consistent with a fair die; this much unevenness arises by chance about half the time in 60 rolls.

Independence, 2×2: 30 of 50 men and 20 of 50 women say yes. Row totals 50, 50; column totals 50 yes, 50 no; grand total 100, so every E = 50·50⁄100 = 25. Each cell contributes (5)2⁄25 = 1, so χ2 = 4.00 with df = (2 − 1)(2 − 1) = 1. Critical value 3.841, p = 0.046: reject; gender and response are associated. This is exactly z2 = 2.002 from the two-proportion test of 0.60 vs 0.40.

Watch out. Use raw counts, never percentages, and never round expected counts to whole numbers. The condition is on the expected counts, not the observed. If the question gives percentages and a sample size, convert to counts first (12% of 250 is 30). And do not pool categories to meet the ≥ 5 rule without saying so, because it changes the df.

ANOVA

Hypothesis Testing

ANOVA

ANOVA compares three or more group means at once by asking whether the variation between groups is large relative to the variation within groups.

One-way ANOVA F-test across k groups
F = MSTMSE = SSAk − 1SSEN − k

Hypotheses

H0: μ1 = μ2 = … = μk

Ha: at least one mean differs. Not “all means differ.”

Conditions

  1. Random sample from each group
  2. Independent samples, not paired
  3. Normally distributed populations
  4. Equal population variances (homogeneity of variance)

Sums of squares

  • SSA — between groups: Σ ni(x̄i − x̄grand)2
  • SSE — within groups: Σ (ni − 1)si2
  • SST = SSA + SSE

Degrees of freedom

  • Between = k − 1
  • Within = N − k
  • Total = N − 1

Mean squares

  • MST = SSAk − 1
  • MSE = SSEN − k

k is the number of groups, N is the total number of observations across all groups.

Two-way ANOVA Two factors plus interaction
Post-hoc tests After a significant F

What it tests

Three F-tests at once: a main effect for factor A, a main effect for factor B, and an interaction between them.

Sums of squares

SST = SSA + SSB + SSAB + SSE

Interaction

A significant interaction means the effect of one factor depends on the level of the other. Interpret it before the main effects.

When to use

A significant ANOVA says at least one mean differs, but not which. A post-hoc test finds the specific pairs while controlling the family-wise error rate.

Common tests

  • Tukey HSD — all pairwise comparisons
  • Bonferroni — divides α by the number of comparisons
  • Scheffé — most conservative, handles complex contrasts

Running many individual t-tests instead inflates the Type I error rate.

RCBD Randomized complete block design

When to use

When a known nuisance variable adds variation you want removed. Subjects are grouped into blocks that are similar on that variable, and every treatment appears once in every block.

Sums of squares

SST = SStreatment + SSblock + SSE

Degrees of freedom

Treatments: k − 1. Blocks: b − 1. Error: (k − 1)(b − 1).

Blocking pulls variation out of SSE, which shrinks MSE and raises the power of the test.

Running a one-way ANOVA The steps and the table
Worked example Three teaching methods, four students each
  1. Hypotheses. H0: μ1 = μ2 = … = μk (“all group means are equal”); Ha: at least one differs.
  2. Conditions. Independent random samples; roughly normal groups (or each ni large); equal spreads — rule of thumb, largest si under twice the smallest.
  3. Group means and the grand mean x̄grand (all N values together, not the average of the group means unless the ni are equal).
  4. Sums of squares. SSA = Σ ni(x̄i − x̄grand)2; SSE = Σ(ni − 1)si2, or add each value’s squared deviation from its own group mean.
  5. Mean squares and F. MST = SSA⁄(k − 1), MSE = SSE⁄(N − k), F = MST⁄MSE.
  6. Decision. P-value is the right tail of F(k − 1, N − k); or compare with the table F* for α. Reject if F ≥ F*. Conclude in context; if you reject, a post-hoc test says which means differ.

The ANOVA table

  • Between — SSA, df k − 1, MST, F, p
  • Within (error) — SSE, df N − k, MSE
  • Total — SST, df N − 1

Given a partial table, fill it with SST = SSA + SSE and the df identity N − 1 = (k − 1) + (N − k); each MS is its SS over its df.

Scores — A: 10, 12, 11, 13; B: 14, 15, 13, 14; C: 9, 8, 10, 9. Test at α = 0.05 whether the methods differ in mean score.

  1. H0: μA = μB = μC; Ha: at least one mean differs. k = 3, N = 12.
  2. Group means 11.5, 14, 9; grand mean (46 + 56 + 36)⁄12 = 138⁄12 = 11.5.
  3. SSA = 4(11.5 − 11.5)2 + 4(14 − 11.5)2 + 4(9 − 11.5)2 = 0 + 25 + 25 = 50.
  4. SSE: A: 2.25 + 0.25 + 0.25 + 2.25 = 5; B: 0 + 1 + 1 + 0 = 2; C: 0 + 1 + 1 + 0 = 2. SSE = 9. SST = 59.
  5. df 2 and 9. MST = 50⁄2 = 25; MSE = 9⁄9 = 1. F = 25⁄1 = 25.0.
  6. F* = 4.26 (df 2, 9; α = 0.05); p = P(F2,9 > 25) ≈ 0.0002. Reject H0: there is strong evidence that mean scores are not the same for the three methods. The group means suggest B highest and C lowest; Tukey’s HSD would confirm which pairs differ.

Reading the result: the between-group spread (MST = 25) is 25 times the typical within-group spread (MSE = 1). Under H0 that ratio should be near 1.

Watch out. The ANOVA F-test is always right-tailed; a tiny F means the means are unusually alike, never evidence against H0. Rejecting does not say every mean differs, only that they are not all equal, and the fix is a post-hoc test, not a round of pairwise t-tests at α = 0.05 each (three groups give three comparisons and a family-wise error rate near 14%).

Nonparametric Tests

Hypothesis Testing

Nonparametric Tests

These tests drop the normality assumption. They work on ranks or signs instead of raw values, so they handle skewed data and outliers, and they test medians rather than means.

Runs test Randomness of a sequence
Sign test Single sample median
Z = R − μRσR

When to use

To check whether a two-outcome sequence is random — plus and minus signs, male and female, defective and good.

Variables

  • R — observed number of runs
  • μR = 2n1n2n1 + n2 + 1 — expected runs under randomness
  • σR = √2n1n2(2n1n2 − n1 − n2)(n1 + n2)2(n1 + n2 − 1)
  • n1, n2 — how many of each outcome; the normal approximation needs both above about 10

A run is an unbroken streak of the same outcome. Too few runs suggests clustering; too many suggests alternation.

Example

Ten pluses and ten minuses in R = 6 runs. μR = 2(100)⁄20 + 1 = 11; σR2 = 2(100)(200 − 20)⁄(400·19) = 4.737, σR = 2.18. Z = (6 − 11)⁄2.18 = −2.30, two-sided p = 0.022: reject randomness at α = 0.05; the signs come in clusters.

Z = x − np√npq

When to use

To test whether a population median equals a hypothesized value, with no assumption of normality.

Variables

  • x — number of values above the hypothesized median
  • p = q = 0.5 under H0

Use the exact binomial for small n; the normal approximation for large n.

Steps

  1. H0: median = m0; Ha: <, > or ≠
  2. Mark each value + if above m0, − if below; drop values equal to m0 and reduce n
  3. Count the pluses x. Under H0, x ~ Binomial(n, 0.5)
  4. P-value: the binomial tail probability of x or more extreme (double it for ≠)

Example

Claim: median delivery time is 30 minutes. Of 12 deliveries, 10 took longer, 2 shorter, none exactly 30. For Ha: median > 30, p = P(X ≥ 10) = (66 + 12 + 1)⁄4096 = 0.019 < 0.05: reject; the median delivery time exceeds 30 minutes. Two-sided p would be 0.039.

Wilcoxon signed-rank Paired samples
Mann–Whitney U Two independent samples
T = Σ positive signed ranks

When to use

To compare two related or paired samples for a difference in medians. The nonparametric counterpart to the paired t-test.

Rank the absolute differences, reattach the signs, then sum the positive ranks. It uses the size of the differences, not just their direction, which makes it more powerful than the sign test.

Variables

  • n — number of pairs with a nonzero difference (zeros are dropped)
  • T — compare with the Wilcoxon table; small n uses the smaller of T+ and T−
  • μT = n(n + 1)⁄4,  σT = √n(n + 1)(2n + 1)⁄24 — for the normal approximation Z = (T − μT)⁄σT when n > about 20

Tied absolute differences share the average of the ranks they would have occupied.

U = n1n2 + n1(n1 + 1)2 − R1

When to use

To compare two independent samples for a difference in medians. The nonparametric counterpart to the two-sample t-test.

Variables

  • R1 — sum of ranks in sample 1
  • n1, n2 — the two sample sizes

Rank all observations together, ignoring which group they came from.

Steps

  1. Pool both samples and rank from 1 (smallest) to n1 + n2; ties get the average rank
  2. Add the ranks of sample 1 to get R1; compute U as above (and U2 = n1n2 − U); use the smaller for the table
  3. Large samples: Z = (U − μU)⁄σU with μU = n1n2⁄2 and σU = √n1n2(n1 + n2 + 1)⁄12

If the two groups did not differ, each would hold about half the ranks and U would be near n1n2⁄2. A U far from that is the evidence.

Spearman’s rho Rank correlation
Kruskal–Wallis Three or more groups
rs = 1 − 6 Σ di2n(n2 − 1)

When to use

To measure monotonic association between two variables when the relationship is not linear or the data are ordinal.

Variables

  • di — difference between the two ranks for observation i
  • n — number of paired observations

Ranges from −1 to 1, read the same way as Pearson’s r.

Example

Five employees ranked by a manager and by a client: manager 1, 2, 3, 4, 5; client 2, 3, 1, 5, 4. Differences d = −1, −1, 2, −1, 1; Σd2 = 1 + 1 + 4 + 1 + 1 = 8. rs = 1 − 6(8)⁄(5·24) = 1 − 0.40 = 0.60: a moderate positive agreement between the two rankings. Rank each variable separately before differencing, and remember Σd is always 0, so a nonzero total means a ranking slip.

H = 12N(N + 1) Σ Ri2ni − 3(N + 1)

When to use

To compare medians across three or more independent groups. The nonparametric counterpart to one-way ANOVA.

Variables

  • Ri — sum of ranks in group i
  • ni — size of group i
  • N — total observations
  • df = k − 1

H follows a chi-square distribution when each group has at least five observations.

Example (arithmetic only; real groups need ni ≥ 5)

Nine values ranked 1 to 9 fall into groups A: ranks 1, 2, 4 (RA = 7); B: 3, 5, 7 (RB = 15); C: 6, 8, 9 (RC = 23). Check 7 + 15 + 23 = 45 = 9(10)⁄2. H = 12⁄(9·10) × (72⁄3 + 152⁄3 + 232⁄3) − 3(10) = 0.1333(267.67) − 30 = 5.69. With df = 2 the critical value is 5.991, so fail to reject at α = 0.05 (p ≈ 0.058): not quite enough evidence that the group medians differ.

Watch out. Every test here ranks the data first; working with the raw values gives a different (wrong) statistic. Rank from the smallest value upward, give tied values the average of the ranks they span, and check the rank total equals N(N + 1)⁄2 before going on. These tests trade a little power for robustness: when the data really are normal, the t-test will reject more often.

Regression

Modeling a relationship

Regression

Test for slope Is there a linear relationship
Test for intercept Is the intercept nonzero
t = b1 − β1SE(b1)

Hypotheses

H0: β1 = 0
Ha: β1 ≠ 0

Conditions

  1. Linearity
  2. Independent observations
  3. Constant variance of residuals
  4. Normally distributed residuals

Degrees of freedom

df = n − 2

Standard error of the slope

SE(b1) = se√Σ(x − x̄)2
  • b1 — the sample slope (“Coef” in software output)
  • β1 — the true slope; H0 sets it to 0, so t = b1⁄SE(b1)
  • se — residual standard error, √SSE⁄(n − 2)
  • SE(b1) — “SE Coef”: how much the slope would vary from sample to sample

Confidence interval for the slope

b1 ± t*·SE(b1),  df = n − 2

H0: β1 = 0 says “x has no linear relationship with y in the population.” Rejecting it says the sample slope is too far from zero to be sampling noise.

t = b0 − β0SE(b0)

Hypotheses

H0: β0 = 0
Ha: β0 ≠ 0

Degrees of freedom

df = n − 2

Usually less interesting than the slope. The intercept is only meaningful when x = 0 falls inside the observed range of the data.

Overall significance F-test for the model
F = MSRMSE = SSRkSSEn − k − 1

Hypotheses

H0: all slopes = 0

Ha: at least one slope is nonzero.

Variables

  • SSR — regression sum of squares, explained variation
  • SSE — error sum of squares, unexplained variation
  • k — number of predictors
  • r2 = SSRSST — proportion of variation explained

In simple linear regression this F-test and the slope t-test give identical p-values, because F = t2.

Worked example Slope test and interval from computer output

A regression of exam score on hours studied for n = 20 students prints: Constant 61.0 (SE 3.9); Hours 2.30 (SE 0.80). Is there a linear relationship between hours and score? Use α = 0.05.

  1. H0: β1 = 0 (no linear relationship between hours studied and score). Ha: β1 ≠ 0.
  2. Conditions: the scatterplot is roughly linear, the residual plot shows no curve or fan, residuals roughly normal, students sampled independently.
  3. t = b1⁄SE(b1) = 2.30⁄0.80 = 2.875.
  4. df = n − 2 = 18.
  5. P-value = 2·P(T18 > 2.875) = 0.010. Critical value t* = 2.101.
  6. 0.010 < 0.05 (and 2.875 > 2.101): reject H0. There is evidence of a linear relationship; each extra hour studied is associated with about 2.3 more points on average.

95% interval for the slope: 2.30 ± 2.101(0.80) = 2.30 ± 1.68, or (0.62, 3.98) points per hour. It excludes 0, which agrees with the test. Software prints the two-sided p-value; for a one-sided Ha whose direction matches the sign of b1, halve it.

Watch out. The p-value in the slope row answers “is the slope zero?”, not “is the fit good?”; a tiny slope with a huge n can be significant and useless, so read r2 and se as well. Do not divide the slope by se or by sx: the test statistic uses SE(b1), the standard error of the slope. And a significant slope is still only association unless x was randomly assigned.

Simple Linear Regression

Regression

The least-squares line

One quantitative explanatory variable x predicts one quantitative response y with a straight line. “Least squares” means the line that makes the sum of the squared vertical residuals as small as possible.

Fitted lineŷ = b0 + b1x
The model being estimatedy = β0 + β1x + ε

Slope and intercept

b1 = r · sysx = Σ(x − x̄)(y − ȳ)Σ(x − x̄)2
b0 = ȳ − b1x̄

Variables

  • b1 — slope: predicted change in y for a one-unit increase in x
  • b0 — intercept: predicted y when x = 0 (meaningful only if x = 0 is in the data range)
  • r — correlation coefficient
  • sx, sy — standard deviations of x and y
  • ŷ — predicted (fitted) value of y

Facts about the line

  1. It always passes through (x̄, ȳ)
  2. The slope has the sign of r
  3. Residuals sum to zero: Σei = 0
  4. Prediction outside the x-range of the data is extrapolation — avoid it

Population model

y = β0 + β1x + ε,   ε ~ N(0, σ)

Conditions (LINE)

  1. Linear — the scatterplot and residual plot show no curve
  2. Independent observations — random sample, no time-order pattern
  3. Normal residuals — roughly normal, no extreme outliers
  4. Equal variance — residual spread is the same across x (no fan)

Variables

  • β0, β1 — the true intercept and slope, estimated by b0, b1
  • ε — random error; its SD σ is estimated by se
  • se = √SSEn − 2  — typical size of a residual

Inference on the slope — the t-test and the confidence interval b1 ± t*·SEb1 with df = n − 2 — is on the Regression tab.

Worked exampleBuilding the line from summary statistics

For 30 cars, weight x (in thousands of pounds) has x̄ = 3.0 and sx = 0.5; fuel use y (gallons per 100 miles) has ȳ = 4.0 and sy = 0.8; r = 0.75.

  1. Slope b1 = r·sy⁄sx = 0.75(0.8⁄0.5) = 0.75(1.6) = 1.2 gallons per 100 miles for each extra thousand pounds
  2. Intercept b0 = ȳ − b1x̄ = 4.0 − 1.2(3.0) = 0.4
  3. Line: ŷ = 0.4 + 1.2x. Check: at x = 3.0 it gives 4.0, the mean of y, as it must
  4. Predict for a 3,500-pound car (x = 3.5): ŷ = 0.4 + 1.2(3.5) = 4.6 gallons per 100 miles. If that car actually used 5.0, its residual is 5.0 − 4.6 = +0.4
  5. r2 = 0.752 = 0.5625: about 56% of the variation in fuel use is explained by the linear relationship with weight

Interpretation sentences to copy: “For each additional thousand pounds, predicted fuel use rises by 1.2 gallons per 100 miles.” “The intercept 0.4 is the predicted fuel use of a car weighing nothing, which is outside the data and not meaningful.” Slopes are always predicted or average changes, never guaranteed ones.

Residuals and r²

ResidualsWhat the line misses
Coefficient of determinationr2
e = y − ŷ = observed − predicted

Reading residuals

  • positive — the point lies above the line; the line under-predicted
  • negative — the point lies below; the line over-predicted
  • residual plot — residuals against x (or against ŷ): a shapeless band means the linear model fits

Patterns that break the model

  1. A curve → the relationship is not linear; transform or add a term
  2. A fan → unequal variance
  3. One far-off point → an outlier; a far-off x pulls the line (high leverage, influential)
r2 = SSRSST = 1 − SSESST

Variables

  • SST = Σ(y − ȳ)2, total variation in y
  • SSR = Σ(ŷ − ȳ)2, variation explained by the line
  • SSE = Σ(y − ŷ)2, unexplained (residual) variation
  • SST = SSR + SSE

Interpretation

“r2 = 0.64: 64% of the variation in y is explained by the linear relationship with x.” Always in context, always as a percentage of the variation in the response. r2 is the square of the correlation; it cannot tell you the direction — look at the sign of b1 for that.

Multiple Regression and OLS

Regression

Multiple regression

Predicts one dependent variable using several independent variables. Each slope is the effect of its own predictor holding the others fixed, which is what makes multiple regression different from running several simple regressions.

The modelk predictors
Testing itOverall F and individual t
ŷ = b0 + b1x1 + b2x2 + … + bkxk

Conditions

  1. Linear in the coefficients; each predictor relates linearly to y
  2. Independent observations
  3. Residuals normal with constant variance
  4. No perfect multicollinearity among the predictors
  5. n comfortably larger than k (a common guide: at least 10 observations per predictor)

Variables

  • bj — partial slope: change in ŷ per unit of xj with all other predictors held constant
  • k — number of predictors
  • n — number of observations
  • dummy variable — a 0/1 predictor that puts a categorical variable into the model; a category with m levels needs m − 1 dummies
  • interaction — a product term x1x2: the effect of one predictor depends on the level of another

Overall significance

F = MSRMSE = SSR ⁄ kSSE ⁄ (n − k − 1)
  • H0 = β1 = β2 = … = βk = 0 (the model explains nothing)
  • Ha = at least one βj ≠ 0
  • df = (k, n − k − 1)

Each coefficient

t = bjSEbj,   df = n − k − 1
  • H0 = βj = 0, given the other predictors are in the model
  • CI = bj ± t* · SEbj

A significant F with no significant t’s usually means two predictors carry the same information (multicollinearity).

OLS rules

Ordinary least squaresWhat the fit minimizes
Judging the fitR2 and adjusted R2
minimize SSE = Σ(yi − ŷi)2

Properties of the OLS solution

  1. Residuals sum to zero and are uncorrelated with every predictor
  2. The fitted surface passes through the point of means (x̄1, …, x̄k, ȳ)
  3. Under the conditions above the estimates are unbiased and have the smallest variance of any linear unbiased estimator (Gauss–Markov)

Variables

  • MSE = SSE ⁄ (n − k − 1), the estimate of σ2
  • se = √MSE, the residual standard error
  • dferror = n − k − 1 — one df per estimated coefficient, including the intercept
R2 = SSRSST
R2adj = 1 − (1 − R2) · n − 1n − k − 1

Why adjust

  1. R2 never decreases when a predictor is added, even a useless one
  2. Adjusted R2 charges a penalty for each predictor, so it can fall when a variable adds nothing
  3. Compare models with different k using R2adj, not R2

Variables

  • R2 — fraction of the variation in y explained by all predictors together
  • R2adj — the same, corrected for the number of predictors

Interpretation stays the same as r2: “72% of the variation in salary is explained by the model with experience, education and hours.”

Model diagnostics

Checking the conditionsResidual plots do the work
Multicollinearity and influenceTwo problems the plots miss
  1. Residuals vs fitted — a flat, shapeless band confirms linearity and equal variance; a curve means a missing term, a fan means unequal variance
  2. Normal Q-Q plot of residuals — points near the line confirm normality
  3. Residuals vs each predictor — a pattern means that predictor needs a transformation or a squared term
  4. Residuals in time order — a drift or cycle means dependence

Fixes: transform y (log is common for right-skewed responses), add x2 or an interaction, or drop influential points only with a stated reason.

VIFj = 11 − Rj2

Multicollinearity

  • Rj2 — R2 from regressing xj on the other predictors
  • VIF > 5 (or 10) — xj is largely predictable from the others; its slope and SE are unstable
  • fix — drop or combine redundant predictors

Influence

  • leverage — how unusual a point’s x-values are
  • Cook’s distance — how much the fit changes if the point is removed; values near or above 1 deserve a look

Related multivariate methods

Multiple regression is one member of a family. The sheet’s definitions, for recognizing which tool a problem is asking for:

MethodWhat it doesTell-tale wording
Multiple RegressionPredicts a single dependent variable using multiple independent variables.“predict y from x1, x2, …”; one numeric response
Multivariate Analysis of Variance (MANOVA)Tests for differences in two or more dependent variables across groups defined by one or more categorical independent variables.several outcomes compared across treatment groups at once
Cluster AnalysisGroups similar data points or observations together based on their characteristics.“segment”, “find natural groups”; no response variable
Factor AnalysisReduces a large number of observed variables into a smaller set of unobserved (latent) variables or factors.many survey items summarized into a few underlying traits

Choosing the Right Test

A decision guide for picking the right procedure

The Flowchart

Work top to bottom, one question at a time. Beige boxes are questions, cream boxes are the tests, and every test on this sheet appears exactly once. The highlighted box is the gatekeeper of the independent two-sample branch: before choosing between pooled-t and Welch, you test the sample variances. Rejecting that test means the variances are unequal — which sends you to Welch.

What kind of variable are you measuring? categorical — you are counting how many fall in each group How many samples, and how many categories? One-proportion z-test one sample, two outcomes Two-proportion z-test two independent samples McNemar’s test same subjects, yes/no measured twice Chi-squared goodness of fit one variable, 3 or more categories Chi-squared test of independence two variables in a two-way table (homogeneity: same test, several populations) quantitative — you are measuring a number (means, medians, spread) How many groups? one group What are you testing? One-sample z-test mean, σ known One-sample t-test mean, σ unknown, df = n − 1 Sign test median, or data far from normal Chi-squared test for one variance σ² or σ against a claimed value two groups Paired or independent? paired — each value has a partner Are the differences roughly normal? Paired t-test yes — differences, df = n − 1 Wilcoxon signed-rank no — ranks of the differences independent — two separate samples Both samples roughly normal, or n ≥ 30? Mann–Whitney U no — compares the ranks of the two samples yes First, test the variances F = s₁² ⁄ s₂² H₀: σ₁² = σ₂²  (larger s² on top) the standard-deviation test Pooled t-test equal — fail to reject H₀ df = n₁ + n₂ − 2 Welch’s t-test unequal — reject H₀ Welch df three or more groups How many factors, and is the data normal? One-way ANOVA one factor, normal, equal variances then a post-hoc test Kruskal–Wallis one factor, not normal — ranks Two-way ANOVA two factors, plus their interaction Randomized block (RCBD) one factor plus a blocking variable a relationship between two variables, or a pattern in one sequence What kind of relationship? Correlation and slope t-tests two quantitative variables, linear F-test for the whole model Spearman’s rho monotonic but not linear, or ranks Runs test is one sequence of outcomes random?
Twenty-two procedures, one tree. Categorical data lead to proportion and chi-squared tests; quantitative data split by the number of groups, with a nonparametric (rank-based) option wherever normality fails; relationships and sequences have their own branch. The highlighted F-test on the two sample variances decides between pooled-t and Welch — rejection means unequal, which means Welch.

Start Here

Most students can run a t-test. The hard part is knowing that it is a t-test. Work down these five questions in order and the test picks itself.

Question 1What kind of variable are you measuring?

Categorical

Group labels — yes/no, brand, party. You are working with proportions or counts. One sample with two outcomes is a one-proportion z-test; two independent samples a two-proportion z-test; the same subjects answering yes/no twice is McNemar. Three or more categories in one variable is a goodness-of-fit test; two categorical variables in a two-way table is the chi-squared test of independence (or homogeneity, when the rows are separate populations).

Quantitative

Numbers you can average — height, salary, test score. You are working with means, or medians when the data are far from normal. Go to question 2.

A relationship or a pattern

Two quantitative variables measured on each unit: correlation and regression (t-tests for r and the slope, F for the whole model), or Spearman’s rho when the relationship is monotonic but not linear. One sequence of outcomes in order, asking whether it is random: the runs test.

Question 2How many groups?

One

Testing a mean: one-sample t-test, or z-test if σ is known (question 3). Testing a median, or data that are clearly not normal: sign test. Testing a variance or standard deviation: chi-squared test for one variance.

Two

Two-sample test. Go to question 4 to decide which one.

Three or more

One factor: one-way ANOVA, followed by a post-hoc test (Tukey or Bonferroni) to find which pairs differ; Kruskal–Wallis if the groups are not roughly normal. Two factors: two-way ANOVA, which also tests their interaction. One factor plus a nuisance variable you blocked on: randomized block design.

Question 3Do you know the population standard deviation?

Yes — σ is given

Use z. In practice this almost never happens outside a textbook.

No — you only have s

Use t. This is the realistic case and the default.

Question 4Are the two samples related?

Paired

Same subjects measured twice, or matched pairs. Compute the differences and run a paired t-test on that single list. If the differences are far from normal, use the Wilcoxon signed-rank test on them instead.

Independent

Two separate samples. If either sample is small and clearly non-normal, use the Mann–Whitney U test. Otherwise go to question 5.

Question 5Are the two variances equal?

Run the F-test first

F = s12 ⁄ s22 with the larger variance on top, df = (n1 − 1, n2 − 1). Failing to reject supports equal variances.

Equal variances

Pooled t-test, df = n1 + n2 − 2.

Unequal variances

Welch’s t-test. This is the safer default when you are unsure or the sample sizes are very different.

Common Mix-Ups

Paired or independentThe most common error
Interval or testThey use different standard errors

Ask whether each value in group one has a natural partner in group two. Before-and-after on the same person is paired. Two separate classrooms are independent. Equal sample sizes do not make data paired.

For proportions, a confidence interval uses p̂ in the standard error, while a hypothesis test uses p0, because the test assumes the null is true. Using the wrong one is a quiet error that still produces a plausible number.

Independence or goodness of fitBoth are chi-squared
Parametric or nonparametricWhen normality fails

Count the variables. One categorical variable compared against claimed proportions is goodness of fit, df = k − 1. Two categorical variables cross-tabulated is independence (or homogeneity), df = (r − 1)(c − 1). Paired yes/no responses on the same people are neither — that is McNemar.

Every mean test has a rank-based twin: one-sample t → sign test, paired t → Wilcoxon signed-rank, two-sample t → Mann–Whitney U, one-way ANOVA → Kruskal–Wallis, Pearson r → Spearman’s rho. Switch when the data are badly skewed, have outliers, or are ordinal, and n is too small for the Central Limit Theorem to help.

Bivariate Data

Two variables at once

Two Variable Data Analysis

Univariate analysis describes one variable at a time. Bivariate analysis asks whether two variables move together — and the tools you use depend entirely on whether those variables are categorical or quantitative.

Two categorical variablesAssociation
Two quantitative variablesCorrelation

Displayed in contingency tables, segmented bar charts, and mosaic plots. Summarized with joint, marginal, and conditional frequencies.

Go to

  • Contingency Tables
  • Relative Frequency Tables
  • Conditional Distributions

Displayed in scatterplots. Summarized with the correlation coefficient r and modeled with the least squares regression line.

Go to

  • Scatterplots
  • Correlation Coefficient
  • Least Squares Regression
  • Residuals and Sums of Squares

Associated vs Correlated

These are not synonyms, and using the wrong one on a free response question costs points.

CorrelationLinear only
AssociationLinear or nonlinear

Describes a linear relationship, and only between two quantitative variables. It is measured by r.

Describes any relationship, linear or not. This is the word to use for categorical variables, because there is no line to fit — categories have no numeric order to be linear about.

Contingency Tables

Bivariate Data

Contingency Tables

Qualitative data often involves two categorical variables that may or may not have a dependent relationship. These are displayed in a two-way table, also called a contingency table.

Contingency table of sport by gender
A two-way table of sport preference by gender. The grand total sits in the bottom right cell.
AnatomyThe parts of the table
TotalsWhere the sums live
  • Columns — vertical set of data (Baseball)
  • Rows — horizontal set of data (Male)
  • Cells — a single box where a row and column intersect

A cell representing the sum of a row or a column. The grand total is always the bottom right cell.

Joint Frequencies

Contingency table with inner cells highlighted
The joint frequencies are the inner cells — one row crossed with one column.
Joint frequencyOne cell, inside the table

Think of prisoners who are in the “joint” — the answer is always inside the table, never on the edge.

  • A joint frequency is just one cell
  • A joint relative frequency is an inner cell divided by the grand total

It answers “how many are both A and B” — both conditions at once.

Marginal Frequencies

Contingency table with row and column totals circled
The marginal frequencies are the row and column subtotals along the edges.
Marginal frequencyThe subtotals on the edge

Think of the margins of a page — the margins are on the outside.

  • Marginal frequencies are the subtotals, not the grand total
  • A marginal relative frequency is a subtotal divided by the grand total

It answers “how many are A” while ignoring the other variable entirely.

Conditional Frequencies

Contingency table with one row highlighted as a subpopulation
A conditional frequency restricts attention to one row or column — a subpopulation.
Conditional frequencyRestricted to a subpopulation

Think of the everyday meaning of condition — a limit. You limit yourself to one row or one column, and that becomes your whole world.

  • The row or column you restrict to is the subpopulation
  • The variable you then read across is the character of interest

It answers “given that someone is A, how many are B” — which is exactly conditional probability, arriving early.

Relative Frequency Tables

Bivariate Data

Relative Frequency Contingency Tables

Just like a contingency table, except every cell is divided by the grand total. The new values can be written as a percent or a decimal.

Contingency table of vehicle type by gender, raw counts
The original counts, before any division.
Relative frequency table dividing all cells by the grand total
Whole-table relative frequencies — every cell divided by the grand total of 240.

Conditional Relative Frequencies

Conditional relative frequencies divide by the row or column total instead of the grand total. That is the entire difference.

Row relative frequenciesDivide each row by its own total
Column relative frequenciesDivide each column by its own total
Row relative frequency table
Each row divided by its own total, so every row sums to 1.00.

Answers “of the males, what fraction chose each vehicle.”

Column relative frequency table
Each column divided by its own total, so every column sums to 1.00.

Answers “of the SUV owners, what fraction were male.”

Rules that always holdQuick checks
  • No value can be above 1, or 100%
  • The total of whichever direction you divided by is always 1, or 100%
  • Determining a marginal distribution is just finding the marginal relative frequency of each categorical variable

If your row percentages do not sum to 100%, you divided by the wrong total. That is the fastest error check in this unit.

Worked exampleOne table, three kinds of percentage

100 café orders: morning 40 coffee, 10 tea (row total 50); afternoon 20 coffee, 30 tea (row total 50). Column totals: 60 coffee, 40 tea.

  • joint — morning-and-coffee: 40⁄100 = 40% of all orders (divide by the grand total; the four joint percentages 40 + 10 + 20 + 30 sum to 100)
  • marginal — coffee overall: 60⁄100 = 60%; morning overall: 50⁄100 = 50% (a row or column total over the grand total)
  • row conditional — coffee given morning: 40⁄50 = 80%; coffee given afternoon: 20⁄50 = 40% (each row sums to 100)
  • column conditional — morning given coffee: 40⁄60 = 67% (each column sums to 100)

The phrase after “of” or “given” names the total to divide by: “of the morning orders” means the morning row. Because coffee’s share differs by time of day (80% vs 40%), time of day and drink are associated; if the rows had matched, they would be independent.

Conditional Distributions

Bivariate Data

Displaying Conditional Distributions

Grouped bar chartsBars side by side
Segmented bar chartsOne bar per group

Each subpopulation gets its own cluster of bars. Easiest for comparing a single category across groups.

Like a pie chart, except the data set is represented by a rectangular bar rather than a circle. Each bar totals 100%, so you are comparing shares rather than counts.

Mosaic Plots

Mosaic plotAlso called a Marimekko diagram

A special type of stacked bar chart. For two variables, the width of each column is proportional to the number of observations at that level of the horizontal variable, while the height within the column shows the conditional distribution.

  • Similar to a segmented bar graph, except area carries meaning as well as height
  • Spaces must be added between the rectangles

The payoff over a segmented bar chart: you can see group size and group composition in one picture. A wide narrow-striped column is a big group with a lopsided split.

Independence and Simpson’s Paradox

Perfect independenceNo association

Perfect independence is when all the conditional frequency distributions are identical — that is, no association.

Even if two variables are completely independent, it is very rare that a resulting two-way table will show perfect independence. Sampling variation alone guarantees some wobble. That gap between “independent in the population” and “identical in the table” is exactly what the chi-squared test later measures.

Simpson’s paradoxWhen aggregating reverses the answer

An association that holds within every subgroup can reverse direction when the subgroups are combined into one table. Nothing is miscalculated — both results are arithmetically correct.

Why it happens

A lurking variable is distributed unevenly across the groups. When you pool, that imbalance dominates the comparison.

Classic example

A hospital with worse overall survival rates than another may have better rates for both mild and severe cases — because it treats far more severe cases. Pooling hides the case mix.

What it means practically

Always ask what was aggregated away before trusting a two-way table. This is the strongest argument in the whole unit for looking at conditional distributions rather than totals.

Scatterplots

Bivariate Data

Explanatory and Response Variables

Sketch showing how light affects plant growth
Sunlight is the independent variable; plant growth is the dependent variable.
Explanatory variableAlso: independent, predictor, x
Response variableAlso: dependent, predicted, y

The expected cause — it explains the result. Its value does not depend on the other variable.

The result — it is what is being explained. Its value depends on changes in the explanatory variable.

Two memory hooksWorth keeping

Which explains which

The (Ex)planatory variable (ex)plains the response variable.

Which axis

E-(x)-planatory = x-axis. The response goes on the y-axis.

Axes labeled with response and explanatory variables
The response variable goes on the y-axis; the explanatory variable goes on the x-axis.

Worth softening. The original defines the independent variable as “the cause.” That holds in a controlled experiment, where the researcher assigns the treatment. In an observational study — which is most data students meet — the explanatory variable is only the suspected cause, and a lurking variable may be doing the real work. Since correlation-versus-causation is the most heavily tested idea in this unit, it is safer to say the explanatory variable is the one you use to predict, not the one that causes.

Describing a Scatterplot

D.U.F.S. + contextDirection, Unusual features, Form, Strength

Direction

Positive or negative. Larger values of one variable associated with larger values of the other means positively associated.

Unusual features

Outliers, clusters, gaps — and points with high influence on the line.

Form

Linear or nonlinear. Curved, exponential, or something else.

Strength

How tightly the points cling to the pattern — strong, moderate, or weak.

All four in context, naming the variables and their units. The same discipline as C.U.S.S. in Unit 1.

Correlation Coefficient (r)

Bivariate Data

The Correlation Coefficient (r)

What scatterplots are used for is determining correlation. The symbol is r, the correlation coefficient.

Three scatterplots showing positive, negative, and no correlation
Positive correlation, negative correlation, and no correlation.
The formulaAn average of paired z-scores
r = 1n − 1 Σ xi − x̄sx · yi − ȳsy

Each bracket is a z-score, so this is the same as r = 1n−1 Σ (zx)(zy). Changing units does not change r, because z-scores have no units.

Correction. The original writes this denominator as (n∕1) in one place — “r = (1/(n/1)) sum of (Zx)(Zy).” It is n − 1, matching the sample standard deviation. Dividing by n∕1 = n would inflate every r.

Six Properties of r

Sign and rangeWhat values are possible
StrengthReading the magnitude
  1. r is negative or positive, and exactly zero when there is no linear correlation
  2. All r values fall in −1 ≤ r ≤ 1
Table mapping r values to strong, moderate, and weak
Conventional strength bands for r.
Four more propertiesThe ones that get tested

3. Order does not matter

It does not matter which variable is x and which is y. r depends on the paired points, not on which is treated as the ordered pair’s first entry. Swapping the axes leaves r unchanged — but it does not leave the regression line unchanged.

4. r is unitless

Not dependent on units. Convert a graph from hours to minutes and r stays identical, because it is built from z-scores.

5. r is not resistant

It is based on the mean, so extreme values pull it. This is exactly why you look at the scatterplot and not just the number.

6. Positive association

Larger values of one variable associated with larger values of the second means the variables are positively associated.

Correction. The original states the range as −1 ≤ r ≥ 1. The second symbol points the wrong way — as written it says r is both at least −1 and at least 1, which would force r = 1 every time. It should read −1 ≤ r ≤ 1.

Context Beats the Number

Why the strength bands are only a guideThe most important note on this page

A correlation of 0.9 might not be good enough in a cancer study, where a treatment decision rides on it. A correlation of 0.1 might be grounds for a major financial change, if the position is large enough that a slight edge compounds.

The bands are a convention for describing a scatterplot, not a standard for deciding whether a relationship matters. What counts as strong depends on the stakes and on what else is known.

Least Squares Regression

Bivariate Data

The Least Squares Regression Line

Scatterplot with a fitted regression line
The least squares regression line through a scatterplot.
DefinitionWhy “least squares”
ŷ = a + bx

Of all possible lines, the LSRL is the one with the smallest sum of the squared residuals — the lowest possible SSE. There are various lines of best fit; this is the one this course uses.

Why the residuals are squared

Squaring stops positive and negative residuals from cancelling, and gives more weight to large misses, so the line is penalized harder for being badly wrong about one point than slightly wrong about several.

Finding it

In practice a calculator or program computes it. By hand you need r, both means, and both standard deviations.

Slope

b — slope of the regression linePredicted change in y per one unit of x
b = r · sysx

Variables

  • r — correlation coefficient
  • sx — standard deviation of x
  • sy — standard deviation of y

Read it as a weighted ratio of spread in y to spread in x, with r acting as a correction factor for how much of that spread is actually shared.

Template for interpretation

“There is a predicted increase / decrease of ______ (slope, in units of y) for every 1 (unit of x).”

The big three

  • Context
  • Correct definition
  • The word predicted

Correction. The slope formula appears twice in the original with the fraction inverted the second time — once as r(sy∕sx) and once as r(sx∕sy). Only the first is right. Sanity check: slope carries units of y per unit of x, so sy must be on top.

Y-Intercept

a — the y-interceptValue of ŷ when x = 0
Finding it from point-slopeThe line through (x̄, ȳ)

It is reasonable, intuitive, and correct that the best-fitting line always passes through the point (x̄, ȳ).

Template for interpretation

“The predicted value of (y in context) is ______ when (x in context) is 0 (units in context).”

A caution

The y-intercept is not always meaningful in context. If x = 0 lies outside the observed data, reporting it is extrapolation.

ŷ − ȳ = b(x − x̄)

Solving for ŷ:

ŷ = bx + (−bx̄ + ȳ)

The expression in parentheses is the y-intercept, a. To find any predicted value, plug the x of interest into this equation.

Correction. The original labels the point-slope variables as “y1 = not predicted variable” and “x1 = predicted variable,” which has it backwards — ŷ is the predicted value, and (x1, y1) is the known point the line passes through, namely (x̄, ȳ).

Equations Worth Memorizing

The lineThree equivalent forms
In standardized unitsThe elegant version
ŷ = a + bx
ŷ − ȳ = b(x − x̄)
b = r · sysx
zy = r · zx

Converted to z-scores, the regression line has slope r and passes through the origin. This is why r is called the correlation coefficient — in standardized units it literally is the slope.

It also shows regression toward the mean: since |r| ≤ 1, a point one SD above average in x is predicted less than one SD above average in y.

Calculator tipFrom the original notes

Use LinReg option 8 rather than option 2. The AP exam writes the model as y = a + bx, and option 8 matches that ordering, so you do not have to rearrange your output.

Residuals

Bivariate Data

Residuals

The difference between the observed and predicted value is the residual. Remember the order with actual minus predicted — like AP courses, the order matters.

The formulaObserved minus predicted
residual = yi − ŷi
  • yi — actual value
  • ŷi — predicted value
  • ε — the Greek letter epsilon, used for the error

The term y0 − ŷ0 = ε0 is called the error or residual. It is not an error in the sense of a mistake.

Scatterplot showing the vertical distance between a point and the fitted line
The residual is the vertical distance from the data point to the line.
Sign of a residualAbove or below the line
PropertiesTwo that always hold

A data point above the line gives a positive residual — the model underestimated the actual value.

A data point below the line gives a negative residual — the model overestimated it.

  • The sum of the residuals is always zero
  • The absolute value of a residual measures the vertical distance between the actual data point and the predicted point on the line

Residual vs Variance

ResidualModel versus reality
VarianceSpread around a mean
yi − ŷi

The difference between what a model predicted and the true value from the data. Measured vertically, against the line.

s2 = Σ(xi − x̄)2n − 1

The variability of the data around its own mean. Measured against a horizontal line, not a fitted one.

Correction. The original lists the “variance formula” as xi − x̄. That is a single deviation, not a variance. Variance squares those deviations, sums them, and divides by n − 1 — the same formula from Unit 1.

Residual Plots

Three residual plots against the explanatory variable
Residual plots: A shows no pattern, B shows curvature, C shows fanning.
Reading a residual plotWhat each pattern means

No pattern

Random scatter around zero. A linear model is appropriate.

Curvature

A visible arc means the relationship is not linear. Consider a transformation.

Fanning

Spread that widens or narrows across the plot means non-constant variance. The line may be fine but its predictions are less reliable at one end.

Residuals can be plotted against either the x-values or the ŷ values. Because ŷ is a linear transformation of x, the two plots are identical except for scale and a possible left-right reversal.

Sums of Squares

Bivariate Data

The Three Sums of Squares

Diagram of SST, SSR, and SSE on a scatterplot
SST is the total distance from the mean line, SSR the part the model explains, SSE the part it misses.
The identityTotal = explained + unexplained
SST = SSR + SSE

Every bit of variation in y is either accounted for by the model or left over. That is the whole idea, and it is what makes r² interpretable as a percentage.

SSTTotal sum of squares
SSRRegression sum of squares
SST = Σ(yi − ȳ)2

Total variation in y, measured from the mean of y. How wrong you would be using ȳ alone as your prediction.

SSR = Σ(ŷi − ȳ)2

Variation the model explains — how far the line moves away from the flat mean line. Also written ESS, explained sum of squares.

SSESum of squared errors, or residual sum of squares
SSE = Σ(yi − ŷi)2

A measure of how far a set of data points is from the fitted regression line, found by summing the squared differences between observed and predicted values. A smaller SSE indicates a better fit — and minimizing it is precisely what defines the least squares line.

If SSR equals SST, the model captures all observed variability and SSE is zero — a perfect fit.

Formulas for SST, SSR, and SSE
The three sums written out.
Worked exampleFive points, all three sums

x = 1, 2, 3, 4, 5 and y = 2, 4, 5, 4, 5. Means x̄ = 3, ȳ = 4.

  1. Slope b1 = Σ(x − x̄)(y − ȳ)⁄Σ(x − x̄)2 = (4 + 0 + 0 + 0 + 2)⁄10 = 0.6; intercept b0 = 4 − 0.6(3) = 2.2. Line: ŷ = 2.2 + 0.6x
  2. Fitted values ŷ = 2.8, 3.4, 4.0, 4.6, 5.2
  3. SST = Σ(y − 4)2 = 4 + 0 + 1 + 0 + 1 = 6
  4. SSR = Σ(ŷ − 4)2 = 1.44 + 0.36 + 0 + 0.36 + 1.44 = 3.6
  5. SSE = Σ(y − ŷ)2 = 0.64 + 0.36 + 1.00 + 0.36 + 0.04 = 2.4
  6. Check: 3.6 + 2.4 = 6 = SST. Then r2 = SSR⁄SST = 3.6⁄6 = 0.60, and r = +√0.60 = 0.775 (positive because the slope is)

In words: the line explains 60% of the variation in y; the remaining 40% (SSE⁄SST) is scatter around the line. The residual standard error is se = √2.4⁄3 = 0.894, the typical size of a miss.

Labels swapped in the original. On the sums page the headings SSR and SST sit next to each other’s formulas. Match them by what is inside the parentheses: (yi − ȳ) is SST, (ŷi − ȳ) is SSR, and (yi − ŷi) is SSE. Actual minus mean, predicted minus mean, actual minus predicted.

Coefficient of Determination

Bivariate Data

Coefficient of Determination (r²)

The formulaExplained over total
r2 = SSRSST = Σ(ŷi − ȳ)2Σ(yi − ȳ)2

Equivalently, since SST = SSR + SSE:

r2 = 1 − SSESST

And it really is r squared:

r2 = (1n − 1 Σ x − x̄sx y − ȳsy)2

Important correction. The original writes r² = SSE∕SST. It is SSR∕SST. Notably the expanded fraction written underneath it — Σ(ŷi−ȳ)² over Σ(yi−ȳ)² — is SSR∕SST, so the math was right and only the label was wrong. But a student who trusts the label will compute the fraction of variation the model fails to explain and report it as success. Sanity check: a perfect fit has SSE = 0, and r² must be 1, not 0.

Interpreting r²

What it meansPercentage of variation explained
Squaring changes the scaleWhy r and r² feel different

r² gives the percentage of variation in the response variable that is explained by the linear relationship with the explanatory variable. It is one minus the unexplained proportion.

Usually reported as a percentage. An r² of 100% is a perfect fit, with all variation in y explained by variation in x.

Rough expectations

Controlled experiments often aim for r² above 90%. In observational studies, 10% to 20% can still be genuinely informative.

r = 0.6 is double the correlation of r = 0.3. But squared, 0.36 versus 0.09 — 36% is four times 9%.

Doubling r quadruples the variation explained. This is why a correlation that sounds moderate can explain surprisingly little, and why r and r² should never be described in the same words.

Transforming Data

Bivariate Data

When a Line Does Not Fit

Sometimes a linear model is a poor fit and a nonlinear model is better. The two this course covers are exponential and power models. Polynomial regression exists but requires linear algebra and is beyond this course.

How you knowThe residual plot tells you first

A high r² does not mean a line is appropriate. Curvature in the residual plot does mean it is not. Always look at the residual plot before trusting a linear model.

In this course, the only relationship of concern is the linear one — everything else is handled by transforming the data until it becomes linear.

Linearizing by Transformation

Exponential modely = a · bx
Power modely = a · xb

What to transform

Take the natural log of the response column only.

ln(y) = ln(a) + x · ln(b)

Plotting ln(y) against x gives a straight line. Growth by a constant factor per step.

What to transform

Take the natural log of both columns.

ln(y) = ln(a) + b · ln(x)

Plotting ln(y) against ln(x) gives a straight line.

The linearized modelAnd getting back

A linearized model is what you have once you have logged the data. Fit the LSRL to the transformed values, then undo the log to state the model in the original units.

The standard format for an exponential equation is y = a · bx, so a and b are what you are solving for.

The check

The transformation worked if the residual plot of the transformed data shows no pattern. That, not r², is the test.

Worked exampleExponential: undoing the log
Worked examplePower: undoing both logs

A linear fit to ln(y) against x gives ln(ŷ) = 0.693 + 0.405x.

  1. Match to ln(y) = ln(a) + x·ln(b): ln(a) = 0.693, ln(b) = 0.405
  2. Undo each with e: a = e0.693 = 2.00, b = e0.405 = 1.50
  3. Model in original units: ŷ = 2.00(1.50)x
  4. Predict at x = 4 either way: 2(1.5)4 = 10.1, or e0.693 + 0.405(4) = e2.313 = 10.1

Reading b: y multiplies by 1.5, a 50% increase, for every one-unit increase in x. The slope 0.405 on the log scale is not a rate you can quote directly.

A linear fit to ln(y) against ln(x) gives ln(ŷ) = 1.609 + 0.5·ln(x).

  1. Match to ln(y) = ln(a) + b·ln(x): ln(a) = 1.609, b = 0.5
  2. Undo only the intercept: a = e1.609 = 5.00; the slope b is already the exponent
  3. Model: ŷ = 5.00·x0.5 = 5√x
  4. Predict at x = 16: 5(4) = 20; and you must plug ln(16) = 2.773, not 16, into the linearized line

Exponential: log y only, straight against x. Power: log both, straight against log x. If the log-y plot is still curved, try the log-log plot.

Watch out. Use the same base to undo the log that you used to take it (ln pairs with e, log10 with 10x). Only the intercept is exponentiated in the power model; exponentiating b too is the classic slip. And the r2 the calculator reports belongs to the transformed data, not to the curve in original units.

Set 1: descriptive statistics and displays

Statistics · Practice problems 1 to 15

Problems 1 to 15

One hundred introductory statistics problems: descriptive statistics, probability and distributions, sampling distributions, confidence intervals and hypothesis tests, and chi-square, ANOVA and regression. Each opens to a full worked solution with the answer highlighted; critical values used are quoted in the solution.

1Nine students scored the following on a 10-point quiz: \(7,\ 9,\ 6,\ 8,\ 9,\ 5,\ 9,\ 7,\ 3\). Find (a) the mean, (b) the median and (c) the mode.

Solution

The mean is the total divided by the count. Adding the nine scores gives \(7 + 9 + 6 + 8 + 9 + 5 + 9 + 7 + 3 = 63\), so

\[\bar{x} = \frac{63}{9} = 7.\]

The median needs the data in order: \(3,\ 5,\ 6,\ 7,\ 7,\ 8,\ 9,\ 9,\ 9\). With \(n = 9\) (odd) the median is the middle value, the 5th one:

\[\text{median} = 7.\]

The mode is the most frequent value. The score 9 appears three times and no other score appears more than twice, so the mode is 9.

Here the mean and median agree: the low score of 3 pulls the mean down, but the three 9s pull it back up by the same amount.

(a) \(\bar{x} = 7\); (b) median \(7\); (c) mode \(9\)

Review: ·

2The stem-and-leaf plot below shows the one-way commute times, in minutes, of 12 employees (key: \(2 \mid 5\) means 25 minutes). \[\begin{array}{r|l} 1 & 8 \\ 2 & 2\ 5\ 5\ 7 \\ 3 & 0\ 1\ 4\ 6 \\ 4 & 0\ 5 \\ 5 & \\ 6 & 2 \end{array}\] Find (a) the median, (b) the first quartile \(Q_1\), (c) the third quartile \(Q_3\) and (d) the interquartile range. (Take \(Q_1\) and \(Q_3\) to be the medians of the lower and upper halves of the data.)

Solution

Read the plot row by row to recover the data, already sorted:

\[18,\ 22,\ 25,\ 25,\ 27,\ 30,\ 31,\ 34,\ 36,\ 40,\ 45,\ 62.\]

With \(n = 12\) (even) the median is the average of the 6th and 7th values:

\[\text{median} = \frac{30 + 31}{2} = 30.5 \text{ minutes}.\]

The lower half is the first six values, \(18, 22, 25, 25, 27, 30\); its median is the average of its 3rd and 4th values, \(Q_1 = \dfrac{25 + 25}{2} = 25\). The upper half is \(31, 34, 36, 40, 45, 62\), with median \(Q_3 = \dfrac{36 + 40}{2} = 38\).

\[\mathrm{IQR} = Q_3 - Q_1 = 38 - 25 = 13 \text{ minutes}.\]

So the middle half of the commutes runs from 25 to 38 minutes, a spread of 13 minutes. The range, \(62 - 18 = 44\), is much larger because the single 62-minute commute stretches it; the IQR ignores that one value.

(a) \(30.5\) min; (b) \(Q_1 = 25\); (c) \(Q_3 = 38\); (d) \(\mathrm{IQR} = 13\)

Review: ·

3The selling prices (in thousands of dollars) of ten houses on one street were \(180,\ 195,\ 210,\ 215,\ 220,\ 230,\ 240,\ 250,\ 265,\ 410\). (a) Find the interquartile range. (b) Find the upper fence \(Q_3 + 1.5\,\mathrm{IQR}\). (c) Which price, if any, is an outlier by the 1.5 IQR rule? (Take \(Q_1\) and \(Q_3\) to be the medians of the lower and upper halves.)

Solution

The data are already sorted and \(n = 10\). The lower half is \(180, 195, 210, 215, 220\), whose middle value is \(Q_1 = 210\). The upper half is \(230, 240, 250, 265, 410\), whose middle value is \(Q_3 = 250\).

\[\mathrm{IQR} = 250 - 210 = 40.\]

The fences sit \(1.5\) IQRs beyond the quartiles:

\[\text{lower fence} = 210 - 1.5(40) = 150\] \[\text{upper fence} = 250 + 1.5(40) = 310.\]

Any value below 150 or above 310 is an outlier. Nothing is below 150, but \(410 \gt 310\), so the $410,000 house is an outlier. On a boxplot the upper whisker would stop at 265, the largest value inside the fences, and 410 would be drawn as a separate point.

(a) \(\mathrm{IQR} = 40\); (b) upper fence \(310\); (c) \(410\) (thousand dollars) is the only outlier

Review: ·

4A sample of five customers waited \(4,\ 8,\ 6,\ 5,\ 12\) minutes for service. Find (a) the sample variance \(s^2\) and (b) the sample standard deviation \(s\), to three decimals.

Solution

Start with the mean:

\[\bar{x} = \frac{4 + 8 + 6 + 5 + 12}{5} = \frac{35}{5} = 7.\]

The deviations from the mean are \(-3,\ 1,\ -1,\ -2,\ 5\). They add to zero, which is a quick check on the mean. Squaring them gives \(9,\ 1,\ 1,\ 4,\ 25\), with sum \(40\).

\[s^2 = \frac{\sum (x - \bar{x})^2}{n - 1} = \frac{40}{4} = 10.\] \[s = \sqrt{10} \approx 3.162 \text{ minutes}.\]

Divide by \(n - 1 = 4\), not by \(5\), because these five waits are a sample and we want an unbiased estimate of the population variance. A typical wait is about 3.2 minutes away from the mean of 7 minutes.

(a) \(s^2 = 10\); (b) \(s = \sqrt{10} \approx 3.162\)

Review:

5Daily high temperatures in a greenhouse over one month have mean \(20^\circ\)C and standard deviation \(5^\circ\)C. The readings are converted to Fahrenheit with \(F = 1.8C + 32\). For the Fahrenheit readings find (a) the mean, (b) the standard deviation and (c) the variance.

Solution

A linear change of units \(y = ax + b\) acts on the summary statistics in a predictable way: the mean is transformed by the same rule, while the standard deviation is only multiplied by \(|a|\). Adding \(b\) shifts every value by the same amount and does not change how spread out they are.

\[\text{mean}_F = 1.8(20) + 32 = 36 + 32 = 68^\circ\text{F}.\] \[s_F = 1.8 \times 5 = 9^\circ\text{F}.\]

The variance is the square of the standard deviation, so it picks up the factor \(a^2 = 1.8^2 = 3.24\):

\[s_F^2 = 9^2 = 81 \quad(\text{equivalently } 3.24 \times 25 = 81).\]

(a) \(68^\circ\)F; (b) \(9^\circ\)F; (c) \(81\)

Review: ·

6Ana scored 82 on a chemistry exam whose class mean was 70 with standard deviation 8. Ben scored 90 on a physics exam whose class mean was 80 with standard deviation 10. (a) Find Ana’s z-score. (b) Find Ben’s z-score. (c) Relative to their own classes, who did better?

Solution

A z-score measures how many standard deviations a value lies above its mean: \(z = \dfrac{x - \mu}{\sigma}\).

\[z_{\text{Ana}} = \frac{82 - 70}{8} = \frac{12}{8} = 1.5\] \[z_{\text{Ben}} = \frac{90 - 80}{10} = \frac{10}{10} = 1.0.\]

Ana is 1.5 standard deviations above her class mean, Ben only 1.0 above his. Even though Ben’s raw score of 90 is higher, Ana’s performance is more unusual within her class, so Ana did better relative to her classmates. Comparing z-scores is the standard way to compare values from two different distributions.

(a) \(z = 1.5\); (b) \(z = 1\); (c) Ana

Review:

7Resting pulse rates of adults have mean 72 beats per minute and standard deviation 10. (a) Find the z-score of a pulse rate of 90. (b) What pulse rate has \(z = -2.5\)? (c) Using the rule that values more than 2 standard deviations from the mean are unusual, what is the highest pulse rate that is not unusual?

Solution

(a) Standardize:

\[z = \frac{90 - 72}{10} = \frac{18}{10} = 1.8.\]

(b) Solve \(z = \dfrac{x - \mu}{\sigma}\) for \(x\): \(x = \mu + z\sigma\).

\[x = 72 + (-2.5)(10) = 72 - 25 = 47 \text{ beats per minute}.\]

(c) Values within 2 standard deviations of the mean are considered usual. The upper limit is

\[\mu + 2\sigma = 72 + 2(10) = 92.\]

Pulse rates above 92 (or below \(72 - 20 = 52\)) would be flagged as unusual by this rule.

(a) \(z = 1.8\); (b) \(47\) bpm; (c) \(92\) bpm

Review:

8Twenty exam scores, already sorted: \(41, 48, 52, 55, 58, 61, 63, 65, 67, 70, 72, 74, 75, 78, 80, 83, 85, 88, 92, 97\). Use these conventions: the percentile rank of a value is (number of scores below it)\(/n \times 100\); to find \(P_k\), compute the locator \(L = \frac{k}{100}\,n\); if \(L\) is a whole number, \(P_k\) is the average of the \(L\)th and \((L+1)\)th sorted values, otherwise round \(L\) up and take that value. Find (a) the percentile rank of the score 80, (b) \(P_{25}\), (c) \(P_{90}\).

Solution

(a) Count the scores below 80: \(41, 48, 52, 55, 58, 61, 63, 65, 67, 70, 72, 74, 75, 78\), which is 14 scores.

\[\text{percentile rank} = \frac{14}{20}\times 100 = 70.\]

A score of 80 is at the 70th percentile: it beats 70% of the class.

(b) The locator is \(L = \frac{25}{100}(20) = 5\), a whole number, so average the 5th and 6th values:

\[P_{25} = \frac{58 + 61}{2} = 59.5.\]

(c) \(L = \frac{90}{100}(20) = 18\), again a whole number, so average the 18th and 19th values:

\[P_{90} = \frac{88 + 92}{2} = 90.\]

(a) 70th percentile; (b) \(P_{25} = 59.5\); (c) \(P_{90} = 90\)

Review:

9A histogram of household incomes in a county has a single tall peak near $45,000 and a long, thin tail stretching to the right toward $300,000. (a) What shape does this describe? (b) Which is larger, the mean income or the median income? (c) Which measure of center better describes a typical household?

Solution

(a) Skewness is named for the direction of the long tail, not the peak. The tail points to the right (toward large incomes), so the distribution is right-skewed, also called positively skewed.

(b) The mean is the balance point of the histogram and gets dragged toward the tail by the few very large incomes; the median is simply the middle value and is unaffected by how far out the tail reaches. In a right-skewed distribution the order is

\[\text{mode} \lt \text{median} \lt \text{mean}\]

so the mean is larger than the median.

(c) Because the mean is inflated by a handful of very high incomes, the median is the better description of a typical household. This is why income statistics are nearly always reported as medians.

(a) right-skewed; (b) the mean; (c) the median

Review: ·

10A survey of 20 households recorded the number of pets in each: six households had 0 pets, eight had 1 pet, four had 2 pets and two had 3 pets. Find (a) the mean, (b) the median and (c) the mode of the number of pets.

Solution

With data in a frequency table, multiply each value by its frequency to get the total:

\[\sum x f = 0(6) + 1(8) + 2(4) + 3(2) = 0 + 8 + 8 + 6 = 22\] \[\bar{x} = \frac{22}{20} = 1.1 \text{ pets}.\]

For the median, \(n = 20\) is even, so we need the average of the 10th and 11th values in sorted order. Use cumulative counts: the six households with 0 pets occupy positions 1–6, and the eight with 1 pet occupy positions 7–14. Both the 10th and the 11th values are therefore 1:

\[\text{median} = \frac{1 + 1}{2} = 1.\]

The mode is the value with the largest frequency. The frequency 8 (for 1 pet) is the largest, so the mode is 1.

(a) \(1.1\) pets; (b) \(1\); (c) \(1\)

Review: ·

11Classify each variable as categorical (nominal), categorical (ordinal), quantitative discrete or quantitative continuous. (a) The ZIP code of a customer’s address. (b) The number of siblings a student has. (c) The time, in seconds, a swimmer takes to finish a race. (d) A restaurant rating of poor, fair, good or excellent.

Solution

Two questions settle the type. First: does arithmetic on the values mean anything? If not, the variable is categorical, and it is ordinal when the categories have a natural order and nominal when they do not. If arithmetic does make sense, the variable is quantitative, and it is discrete when the values come from counting (separated values such as \(0, 1, 2, \dots\)) and continuous when they come from measuring (any value in an interval).

(a) A ZIP code is made of digits, but it is only a label: averaging two ZIP codes is meaningless, and there is no natural order. Categorical, nominal.

(b) Siblings are counted: \(0, 1, 2, 3, \dots\), with no value such as 1.5 possible. Quantitative, discrete.

(c) A race time can be any value in a range (58.31 s, 58.312 s, …), limited only by the precision of the clock. Quantitative, continuous.

(d) Poor, fair, good, excellent are categories with a clear order, but the gap between “poor” and “fair” is not a measurable amount. Categorical, ordinal.

(a) nominal; (b) discrete; (c) continuous; (d) ordinal

Review:

12Name the sampling method used in each case. (a) A store manager surveys every 20th customer who leaves the store. (b) A university sorts its students by class year and selects a random sample from each year. (c) A school district picks five of its schools at random and surveys every teacher in those five schools. (d) A news site posts a poll and counts the votes of whoever chooses to respond.

Solution

(a) Choosing every \(k\)th member of a list or stream, after a random start, is a systematic sample.

(b) The population is split into groups (strata) that are similar within themselves, and a random sample is taken from every group. That is a stratified sample; it guarantees every class year is represented.

(c) Here the groups (schools) are chosen at random and everyone in the chosen groups is surveyed. That is a cluster sample. The difference from stratified sampling: stratified takes some from each group, cluster takes all from a few groups.

(d) People decide for themselves whether to take part, so the respondents are those with strong opinions and spare time. That is a voluntary response sample, a form of convenience sampling, and it is biased: it does not produce a sample that represents all visitors.

(a) systematic; (b) stratified; (c) cluster; (d) voluntary response

Review:

13Two studies. Study I: a researcher randomly assigns 60 tomato plants to receive either a new fertilizer or plain water and records each plant’s yield. Study II: researchers examine hospital records and compare the recovery times of patients who chose a vegetarian diet with those who did not. (a) Is Study I an experiment or an observational study? (b) Is Study II an experiment or an observational study? (c) In Study II the vegetarian patients might also exercise more, and the exercise could be the real reason for faster recovery. What is such a variable called?

Solution

(a) The researcher decides which plants get the fertilizer and which get plain water, and uses random assignment to decide. Imposing the treatment makes Study I an experiment. The plain-water plants form the control group, and because the assignment was random, any large difference in yield can be attributed to the fertilizer.

(b) In Study II the researchers only record choices the patients already made; nobody was assigned a diet. That is an observational study. It can show an association between diet and recovery time, but not that the diet causes faster recovery.

(c) A variable such as exercise that is associated with the explanatory variable (diet) and also affects the response (recovery time) is a confounding variable (also called a lurking variable). Its effect cannot be separated from the effect of diet, which is exactly why observational studies cannot establish cause and effect, and why random assignment in an experiment is so valuable: it spreads such variables evenly across the groups.

(a) experiment; (b) observational study; (c) a confounding (lurking) variable

Review:

14In a course, homework counts 20%, the midterm 30% and the final exam 50%. Priya has a homework average of 92 and a midterm score of 78. (a) If she scores 85 on the final, what is her course average? (b) What final-exam score would she need for a course average of exactly 90?

Solution

A course average with unequal weights is a weighted mean: multiply each score by its weight (as a decimal) and add. The weights \(0.2 + 0.3 + 0.5 = 1\), so no further division is needed.

\[\text{average} = 0.20(92) + 0.30(78) + 0.50(85) = 18.4 + 23.4 + 42.5 = 84.3.\]

(b) The homework and midterm contribute a fixed \(18.4 + 23.4 = 41.8\) points. Let \(F\) be the final-exam score:

\[41.8 + 0.50F = 90\] \[\Longrightarrow\ 0.50F = 48.2\] \[\Longrightarrow\ F = 96.4.\]

She needs about 96.4 on the final. Because the final carries half the weight, each point on it is worth half a point of course average.

(a) \(84.3\); (b) \(96.4\)

Review: ·

15Heights of adult women are approximately bell-shaped with mean 64 inches and standard deviation 2.5 inches. Use the empirical (68–95–99.7) rule to find the proportion of women who are (a) between 59 and 69 inches tall, (b) taller than 66.5 inches, (c) between 61.5 and 69 inches tall. Give each answer as a decimal.

Solution

First express each height as a number of standard deviations from the mean: \(59 = 64 - 2(2.5)\), \(61.5 = 64 - 1(2.5)\), \(66.5 = 64 + 1(2.5)\) and \(69 = 64 + 2(2.5)\).

(a) From 59 to 69 is \(\mu \pm 2\sigma\), which by the empirical rule holds about 95% of the data:

\[P(59 \lt X \lt 69) \approx 0.95.\]

(b) About 68% of the data lie within \(\mu \pm 1\sigma\), so 32% lie outside, split equally between the two tails by symmetry. The proportion above \(\mu + \sigma = 66.5\) is half of 32%:

\[P(X \gt 66.5) \approx 0.16.\]

(c) From \(\mu - \sigma\) up to the mean is half of 68%, which is 34%; from the mean up to \(\mu + 2\sigma\) is half of 95%, which is 47.5%. Add them:

\[P(61.5 \lt X \lt 69) \approx 0.34 + 0.475 = 0.815.\]

(a) \(0.95\); (b) \(0.16\); (c) \(0.815\)

Review: ·

Set 2: probability, counting and discrete distributions

Statistics · Practice problems 16 to 40

Problems 16 to 40

One hundred introductory statistics problems: descriptive statistics, probability and distributions, sampling distributions, confidence intervals and hypothesis tests, and chi-square, ANOVA and regression. Each opens to a full worked solution with the answer highlighted; critical values used are quoted in the solution.

16One card is drawn at random from a standard 52-card deck. Find, as exact fractions, (a) the probability that it is a heart or a face card (jack, queen or king) and (b) the probability that it is neither a heart nor a face card.

Solution

Let \(H\) be “heart” and \(F\) be “face card”. There are 13 hearts and 12 face cards (three in each suit), and the two events overlap in the jack, queen and king of hearts, so \(P(H \text{ and } F) = 3/52\). The general addition rule subtracts that overlap so it is not counted twice:

\[P(H \text{ or } F) = \frac{13}{52} + \frac{12}{52} - \frac{3}{52} = \frac{22}{52} = \frac{11}{26} \approx 0.4231.\]

Check by counting: the 13 hearts plus the 9 face cards that are not hearts make 22 favourable cards.

(b) “Neither a heart nor a face card” is the complement of “a heart or a face card”:

\[P(\text{neither}) = 1 - \frac{11}{26} = \frac{15}{26} \approx 0.5769.\]

(a) \(\dfrac{11}{26} \approx 0.4231\); (b) \(\dfrac{15}{26} \approx 0.5769\)

Review: ·

17In a survey of commuters, 45% drive to work (event \(D\)), 30% listen to podcasts during the commute (event \(L\)) and 12% do both. Find (a) \(P(D \text{ or } L)\), (b) the probability that a commuter does neither, (c) \(P(D \mid L)\). (d) Are \(D\) and \(L\) independent, mutually exclusive, or neither?

Solution

(a) General addition rule:

\[P(D \text{ or } L) = P(D) + P(L) - P(D \text{ and } L) = 0.45 + 0.30 - 0.12 = 0.63.\]

(b) “Neither” is the complement of “at least one”:

\[P(\text{neither}) = 1 - 0.63 = 0.37.\]

(c) Conditional probability restricts attention to the podcast listeners:

\[P(D \mid L) = \frac{P(D \text{ and } L)}{P(L)} = \frac{0.12}{0.30} = 0.4.\]

(d) Independence would require \(P(D \mid L) = P(D)\), but \(0.4 \ne 0.45\) (equivalently \(P(D)P(L) = 0.135 \ne 0.12\)), so the events are not independent: drivers are a little less likely to listen to podcasts. Mutually exclusive events cannot happen together, which would require \(P(D \text{ and } L) = 0\), but it is 0.12. So the answer is neither.

(a) \(0.63\); (b) \(0.37\); (c) \(0.4\); (d) neither

Review: ·

18A particular gene variant is carried by 15% of the plants in a large population, and plants are selected at random. (a) Find, to four decimals, the probability that at least one of 6 selected plants carries the variant. (b) How many plants must be selected so that the probability of finding at least one carrier is at least 0.95?

Solution

“At least one” is easiest through its complement, “none”. Each plant is a non-carrier with probability 0.85, and the selections are independent (the population is large), so

\[P(\text{no carriers among 6}) = 0.85^6 \approx 0.3771\] \[P(\text{at least one}) = 1 - 0.3771 = 0.6229.\]

(b) With \(n\) plants we need \(1 - 0.85^n \ge 0.95\), i.e. \(0.85^n \le 0.05\). Take logarithms (dividing by the negative number \(\ln 0.85\) flips the inequality):

\[n \ge \frac{\ln 0.05}{\ln 0.85} = \frac{-2.9957}{-0.1625} \approx 18.43.\]

So \(n = 19\) plants are needed. Check: \(0.85^{18} \approx 0.0536 \gt 0.05\) is not enough, while \(0.85^{19} \approx 0.0456 \le 0.05\) works.

(a) \(0.6229\); (b) \(19\) plants

Review: ·

19Of 200 students surveyed, 80 are first-years and 120 are upperclassmen. Twenty of the first-years and 66 of the upperclassmen own a car. A student is chosen at random. Find (a) \(P(\text{owns a car})\), (b) \(P(\text{owns a car} \mid \text{upperclassman})\), (c) \(P(\text{first-year} \mid \text{does not own a car})\), to four decimals. (d) Are owning a car and being an upperclassman independent?

Solution

Organize the counts: first-years split 20 with a car and \(80 - 20 = 60\) without; upperclassmen split 66 with and \(120 - 66 = 54\) without. In total \(20 + 66 = 86\) own a car and \(60 + 54 = 114\) do not.

(a) Out of all 200 students:

\[P(\text{car}) = \frac{86}{200} = 0.43.\]

(b) Conditioning on “upperclassman” shrinks the denominator to the 120 upperclassmen:

\[P(\text{car} \mid \text{upper}) = \frac{66}{120} = 0.55.\]

(c) Now restrict to the 114 students without a car, of whom 60 are first-years:

\[P(\text{first-year} \mid \text{no car}) = \frac{60}{114} = \frac{10}{19} \approx 0.5263.\]

(d) If the two were independent, knowing a student is an upperclassman would not change the chance of owning a car, so we would have \(P(\text{car} \mid \text{upper}) = P(\text{car})\). But \(0.55 \ne 0.43\): upperclassmen are more likely to own a car, so the events are not independent.

(a) \(0.43\); (b) \(0.55\); (c) \(\dfrac{10}{19} \approx 0.5263\); (d) no

Review: ·

20A bag holds 5 red and 7 blue marbles. Two marbles are drawn at random without replacement. Find, as exact fractions, (a) the probability that both are red, (b) the probability of one marble of each colour, (c) the probability that the second marble is red.

Solution

Without replacement the second draw depends on the first, so multiply along the branches of a tree: \(P(\text{1st and 2nd}) = P(\text{1st})\,P(\text{2nd} \mid \text{1st})\).

(a) After one red is removed, 4 of the remaining 11 are red:

\[P(RR) = \frac{5}{12}\cdot\frac{4}{11} = \frac{20}{132} = \frac{5}{33}.\]

(b) “One of each” happens in two orders, red-then-blue or blue-then-red, and the two branches have the same probability:

\[P(RB) + P(BR) = \frac{5}{12}\cdot\frac{7}{11} + \frac{7}{12}\cdot\frac{5}{11} = \frac{35}{132} + \frac{35}{132} = \frac{70}{132} = \frac{35}{66}.\]

(c) The second marble is red on the branches \(RR\) and \(BR\):

\[P(\text{2nd red}) = \frac{20}{132} + \frac{35}{132} = \frac{55}{132} = \frac{5}{12}.\]

That equals \(P(\text{1st red})\). Before you look at any marble, each draw is equally likely to be any of the 12 marbles, so the unconditional probability is the same for every position.

(a) \(\dfrac{5}{33}\); (b) \(\dfrac{35}{66}\); (c) \(\dfrac{5}{12}\)

Review: ·

21A hospital has two backup generators that fail independently, each with probability 0.05, during a power outage. For an outage find (a) the probability that both fail, (b) the probability that at least one works, (c) the probability that exactly one fails.

Solution

Independence lets us multiply probabilities. Let \(F_1, F_2\) be the failure events, each with probability 0.05, so each generator works with probability 0.95.

(a)

\[P(F_1 \text{ and } F_2) = 0.05 \times 0.05 = 0.0025.\]

(b) “At least one works” is the complement of “both fail”:

\[P(\text{at least one works}) = 1 - 0.0025 = 0.9975.\]

This is the point of a backup: one generator fails 5% of the time, but the pair leaves the hospital without power only 0.25% of the time.

(c) Exactly one fails in two ways, first fails and second works, or first works and second fails:

\[P(\text{exactly one fails}) = 0.05(0.95) + 0.95(0.05) = 0.0475 + 0.0475 = 0.095.\]

Check: \(P(\text{neither fails}) = 0.95^2 = 0.9025\), and \(0.9025 + 0.095 + 0.0025 = 1\).

(a) \(0.0025\); (b) \(0.9975\); (c) \(0.095\)

Review:

22Each morning Jordan takes the bus with probability 0.7 and otherwise walks. When he takes the bus he is late with probability 0.10; when he walks he is late with probability 0.25. Find (a) the probability that he takes the bus and arrives on time, (b) the probability that he is late, (c) the probability that he walked, given that he was late (to four decimals).

Solution

Draw a tree: the first branching is bus (0.7) or walk (0.3); the second is late or on time, with probabilities that depend on the first branch. The probability of a path is the product along it.

(a) Bus, then on time with probability \(1 - 0.10 = 0.90\):

\[P(\text{bus and on time}) = 0.7 \times 0.90 = 0.63.\]

(b) He can be late on either branch; add the two paths (total probability):

\[P(\text{late}) = 0.7(0.10) + 0.3(0.25) = 0.07 + 0.075 = 0.145.\]

(c) Bayes’ rule is just the conditional probability formula with the joint probability from the tree:

\[P(\text{walk} \mid \text{late}) = \frac{P(\text{walk and late})}{P(\text{late})} = \frac{0.075}{0.145} = \frac{15}{29} \approx 0.5172.\]

Although he walks only 30% of mornings, walking accounts for more than half of his late arrivals because it is so much riskier.

(a) \(0.63\); (b) \(0.145\); (c) \(\dfrac{15}{29} \approx 0.5172\)

Review: ·

23A disease affects 1% of a population. A screening test is positive for 95% of people who have the disease (its sensitivity) and negative for 90% of people who do not (its specificity). A person is selected at random and tested. Find, to four decimals, (a) the probability that the test is positive, (b) the probability that the person has the disease given a positive test, (c) the probability that the person does not have the disease given a negative test.

Solution

Let \(D\) be “has the disease” and \(+\) a positive test. We are given \(P(D) = 0.01\), \(P(+ \mid D) = 0.95\) and \(P(- \mid D^c) = 0.90\), so the false-positive rate is \(P(+ \mid D^c) = 0.10\).

(a) A positive test arises from the two causes, true positives and false positives:

\[P(+) = P(D)P(+ \mid D) + P(D^c)P(+ \mid D^c) = 0.01(0.95) + 0.99(0.10) = 0.0095 + 0.099 = 0.1085.\]

(b) Bayes’ rule:

\[P(D \mid +) = \frac{P(D)P(+ \mid D)}{P(+)} = \frac{0.0095}{0.1085} \approx 0.0876.\]

Only about 9% of positive results are true cases. The disease is rare, so even a 10% false-positive rate applied to the 99% of healthy people produces far more false positives (0.099) than true positives (0.0095).

(c) \(P(-) = 1 - 0.1085 = 0.8915\), and a healthy person tests negative with probability \(0.99 \times 0.90 = 0.891\):

\[P(D^c \mid -) = \frac{0.891}{0.8915} \approx 0.9994.\]

A negative result is very reassuring: the chance of a missed case is only about 0.06%.

(a) \(0.1085\); (b) \(0.0876\); (c) \(0.9994\)

Review: ·

24(a) In how many ways can gold, silver and bronze medals be awarded among 8 runners? (b) How many distinct arrangements are there of the letters of the word STATISTICS? (c) How many 4-digit PINs use four different digits?

Solution

(a) The medals are different, so the order of the top three matters. Any of 8 runners can take gold, then 7 remain for silver, then 6 for bronze:

\[{}_8P_3 = 8 \cdot 7 \cdot 6 = \frac{8!}{5!} = 336.\]

(b) STATISTICS has 10 letters: S three times, T three times, I twice, and A and C once each. If all 10 letters were different there would be \(10!\) arrangements; swapping identical letters does not create a new word, so divide by the factorials of the repeat counts:

\[\frac{10!}{3!\,3!\,2!} = \frac{3{,}628{,}800}{6 \cdot 6 \cdot 2} = \frac{3{,}628{,}800}{72} = 50{,}400.\]

(c) Order matters in a PIN and no digit repeats: 10 choices for the first digit, then 9, 8, 7:

\[10 \cdot 9 \cdot 8 \cdot 7 = 5{,}040.\]

(a) \(336\); (b) \(50{,}400\); (c) \(5{,}040\)

Review:

25A committee of 4 is to be chosen from 7 faculty members and 5 students. (a) How many different committees are possible? (b) How many of them contain exactly 2 students? (c) If the committee is chosen at random, what is the probability (to four decimals) that it contains exactly 2 students?

Solution

(a) A committee is an unordered group, so use combinations. There are 12 people:

\[\binom{12}{4} = \frac{12 \cdot 11 \cdot 10 \cdot 9}{4 \cdot 3 \cdot 2 \cdot 1} = 495.\]

(b) Choose the 2 students from 5 and, separately, the other 2 members from the 7 faculty; multiply the two counts:

\[\binom{5}{2}\binom{7}{2} = 10 \cdot 21 = 210.\]

(c) All 495 committees are equally likely, so

\[P(\text{exactly 2 students}) = \frac{210}{495} = \frac{14}{33} \approx 0.4242.\]

(a) \(495\); (b) \(210\); (c) \(\dfrac{14}{33} \approx 0.4242\)

Review: ·

26A system password consists of 3 letters followed by 2 digits. (a) How many passwords are possible if letters and digits may repeat? (b) How many are possible if no letter and no digit may be repeated? (c) If a password is generated at random with repeats allowed, what is the probability (to four decimals) that it has no repeated letter and no repeated digit?

Solution

By the multiplication principle, count the choices for each position and multiply.

(a) With repeats, every letter slot has 26 options and every digit slot has 10:

\[26 \cdot 26 \cdot 26 \cdot 10 \cdot 10 = 17{,}576 \cdot 100 = 1{,}757{,}600.\]

(b) Without repeats the options shrink as slots are filled: 26, 25, 24 for the letters and 10, 9 for the digits:

\[26 \cdot 25 \cdot 24 \cdot 10 \cdot 9 = 15{,}600 \cdot 90 = 1{,}404{,}000.\]

(c) Each of the \(1{,}757{,}600\) passwords is equally likely, and \(1{,}404{,}000\) of them have no repeats:

\[P(\text{no repeats}) = \frac{1{,}404{,}000}{1{,}757{,}600} \approx 0.7988.\]

So about 80% of random passwords happen to have no repeated character; the restriction in (b) removes only a fifth of them.

(a) \(1{,}757{,}600\); (b) \(1{,}404{,}000\); (c) \(0.7988\)

Review:

27A box contains 10 light bulbs, 4 of which are defective. An inspector picks 3 bulbs at random. Find (a) the probability that none of the three is defective, (b) the probability that at least one is defective, (c) the probability that exactly 2 are defective.

Solution

Every set of 3 bulbs is equally likely, and there are \(\binom{10}{3} = 120\) such sets. Count the favourable sets with combinations, choosing the defective and the good bulbs separately.

(a) All three must come from the 6 good bulbs:

\[P(\text{none defective}) = \frac{\binom{6}{3}}{\binom{10}{3}} = \frac{20}{120} = \frac{1}{6}.\]

(b) Complement of (a):

\[P(\text{at least one defective}) = 1 - \frac{1}{6} = \frac{5}{6}.\]

(c) Choose 2 of the 4 defective bulbs and 1 of the 6 good ones:

\[P(\text{exactly 2 defective}) = \frac{\binom{4}{2}\binom{6}{1}}{120} = \frac{6 \cdot 6}{120} = \frac{36}{120} = \frac{3}{10}.\]

The same answers come from a tree: for (a), \(\frac{6}{10}\cdot\frac{5}{9}\cdot\frac{4}{8} = \frac{120}{720} = \frac{1}{6}\).

(a) \(\dfrac{1}{6}\); (b) \(\dfrac{5}{6}\); (c) \(\dfrac{3}{10}\)

Review: ·

28Let \(X\) be the number of cars owned by a randomly chosen household in a town, with distribution \(P(X = 0) = 0.10\), \(P(X = 1) = 0.35\), \(P(X = 2) = 0.40\), \(P(X = 3) = 0.15\). Find (a) the mean \(\mu\), (b) the variance \(\sigma^2\), (c) the standard deviation \(\sigma\) (to three decimals).

Solution

The probabilities add to \(0.10 + 0.35 + 0.40 + 0.15 = 1\), as they must. The mean of a discrete random variable is the probability-weighted average of its values:

\[\mu = \sum x\,P(x) = 0(0.10) + 1(0.35) + 2(0.40) + 3(0.15) = 0 + 0.35 + 0.80 + 0.45 = 1.6.\]

For the variance use the shortcut \(\sigma^2 = \sum x^2 P(x) - \mu^2\):

\[\sum x^2 P(x) = 0(0.10) + 1(0.35) + 4(0.40) + 9(0.15) = 0.35 + 1.60 + 1.35 = 3.3\] \[\sigma^2 = 3.3 - 1.6^2 = 3.3 - 2.56 = 0.74.\] \[\sigma = \sqrt{0.74} \approx 0.860 \text{ cars}.\]

So a typical household owns about 1.6 cars, give or take roughly 0.86.

(a) \(\mu = 1.6\); (b) \(\sigma^2 = 0.74\); (c) \(\sigma \approx 0.860\)

Review:

29A random variable \(X\) takes the values 1, 2, 5 and 10 with \(P(1) = 0.4\), \(P(2) = 0.3\), \(P(5) = k\) and \(P(10) = 0.1\). (a) Find \(k\). (b) Find \(E(X)\). (c) Find \(P(X \gt 2)\).

Solution

(a) The probabilities of all the values must add to 1:

\[0.4 + 0.3 + k + 0.1 = 1\] \[\Longrightarrow\ k = 0.2.\]

(b) Expected value:

\[E(X) = 1(0.4) + 2(0.3) + 5(0.2) + 10(0.1) = 0.4 + 0.6 + 1.0 + 1.0 = 3.\]

Note that \(E(X) = 3\) is not one of the possible values; the expected value is a long-run average, not a value you expect on any single trial.

(c) \(X \gt 2\) means \(X = 5\) or \(X = 10\):

\[P(X \gt 2) = 0.2 + 0.1 = 0.3.\]

(a) \(k = 0.2\); (b) \(E(X) = 3\); (c) \(0.3\)

Review:

30A club sells 500 raffle tickets at $2 each. One ticket wins $400 and two other tickets win $100 each. (a) What is the expected net gain (winnings minus the ticket price) for one ticket? (b) What ticket price would make the raffle a fair game, with expected net gain zero?

Solution

Let \(X\) be the net gain from one ticket. Three outcomes: win $400 (net \(398\)) with probability \(1/500\); win $100 (net \(98\)) with probability \(2/500\); win nothing (net \(-2\)) with probability \(497/500\).

\[E(X) = 398\cdot\frac{1}{500} + 98\cdot\frac{2}{500} + (-2)\cdot\frac{497}{500} = \frac{398 + 196 - 994}{500} = \frac{-400}{500} = -0.80.\]

A buyer loses 80 cents per ticket on average. A quicker route: the expected prize is \(\dfrac{400 + 100 + 100}{500} = \$1.20\), and subtracting the $2 price gives \(-\$0.80\). (From the club’s side, \(500 \times 0.80 = \$400\) is its expected profit, which is also ticket sales $1,000 minus prizes $600.)

(b) The game is fair when the price equals the expected prize:

\[\text{fair price} = \$1.20.\]

(a) \(-\$0.80\); (b) \(\$1.20\)

Review:

31A technician’s time to diagnose a fault, \(X\), has mean 50 minutes and standard deviation 6 minutes; the time to repair it, \(Y\), has mean 30 minutes and standard deviation 8 minutes, and \(X\) and \(Y\) are independent. Find (a) the mean of the total time \(X + Y\), (b) the standard deviation of \(X + Y\), (c) the standard deviation of the difference \(X - Y\).

Solution

Means always add (and subtract):

\[\mu_{X+Y} = \mu_X + \mu_Y = 50 + 30 = 80 \text{ minutes}.\]

For independent variables it is the variances that add, never the standard deviations:

\[\sigma^2_{X+Y} = \sigma_X^2 + \sigma_Y^2 = 6^2 + 8^2 = 36 + 64 = 100\] \[\sigma_{X+Y} = \sqrt{100} = 10 \text{ minutes}.\]

(Adding standard deviations would give 14, which is wrong: the two times do not always run long together.)

(c) For a difference the variances still add, because subtracting an uncertain quantity adds uncertainty just as adding one does:

\[\sigma^2_{X-Y} = \sigma_X^2 + \sigma_Y^2 = 100\] \[\sigma_{X-Y} = 10 \text{ minutes}\]

while the mean of the difference is \(50 - 30 = 20\) minutes.

(a) \(80\) min; (b) \(10\) min; (c) \(10\) min

Review:

32A basketball player makes 70% of her free throws, independently of one another. In 10 attempts let \(X\) be the number she makes. Find, to four decimals, (a) \(P(X = 7)\) and (b) \(P(X \ge 8)\), and (c) the standard deviation of \(X\) (to three decimals).

Solution

Fixed number of trials (10), two outcomes, constant success probability 0.7, independent trials: \(X\) is binomial with \(n = 10\), \(p = 0.7\), and

\[P(X = k) = \binom{10}{k}(0.7)^k(0.3)^{10-k}.\]

(a)

\[P(X = 7) = \binom{10}{7}(0.7)^7(0.3)^3 = 120(0.082354)(0.027) \approx 0.2668.\]

(b) Add the three terms for 8, 9 and 10 makes:

\[P(X = 8) = 45(0.7)^8(0.3)^2 \approx 0.2335,\quad P(X = 9) = 10(0.7)^9(0.3) \approx 0.1211,\quad P(X = 10) = (0.7)^{10} \approx 0.0282\] \[P(X \ge 8) \approx 0.2335 + 0.1211 + 0.0282 = 0.3828.\]

(c) The binomial mean is \(np = 10(0.7) = 7\) and

\[\sigma = \sqrt{np(1 - p)} = \sqrt{10(0.7)(0.3)} = \sqrt{2.1} \approx 1.449.\]

(a) \(0.2668\); (b) \(0.3828\); (c) \(\sigma = \sqrt{2.1} \approx 1.449\)

Review:

33A quiz has 8 multiple-choice questions, each with 4 options, and a student guesses every answer at random. Find, to four decimals, (a) the probability of exactly 2 correct answers, (b) the probability of at most 1 correct answer, (c) the probability of at least 3 correct answers.

Solution

Each guess is correct with probability \(p = 1/4\), independently, so the number correct \(X\) is binomial with \(n = 8\), \(p = 0.25\).

(a)

\[P(X = 2) = \binom{8}{2}(0.25)^2(0.75)^6 = 28(0.0625)(0.177979) \approx 0.3115.\]

(b) “At most 1” means 0 or 1:

\[P(X = 0) = (0.75)^8 \approx 0.1001\] \[P(X = 1) = 8(0.25)(0.75)^7 \approx 0.2670\] \[P(X \le 1) \approx 0.1001 + 0.2670 = 0.3671.\]

(c) “At least 3” is the complement of “at most 2”, and we already have all three of those terms:

\[P(X \ge 3) = 1 - P(X \le 2) = 1 - (0.3671 + 0.3115) = 1 - 0.6786 \approx 0.3215.\]

So a pure guesser has only about a one-in-three chance of getting 3 or more of the 8 questions right.

(a) \(0.3115\); (b) \(0.3671\); (c) \(0.3215\)

Review:

34In a large city 55% of voters support a ballot measure. A random sample of 400 voters is taken and \(X\) is the number in the sample who support it. (a) Find the mean of \(X\). (b) Find the standard deviation of \(X\) (to three decimals). (c) Using the range rule of thumb (values more than 2 standard deviations from the mean are unusual), would a sample with 190 or fewer supporters be unusual?

Solution

Sampling 400 from a large city, each voter is a supporter with probability 0.55 essentially independently of the others, so \(X\) is binomial with \(n = 400\), \(p = 0.55\).

\[\mu = np = 400(0.55) = 220.\] \[\sigma = \sqrt{np(1-p)} = \sqrt{400(0.55)(0.45)} = \sqrt{99} \approx 9.950.\]

(c) The usual range is \(\mu \pm 2\sigma = 220 \pm 19.9\), roughly 200 to 240. A count of 190 lies below 200, so it would be unusual; its z-score is

\[z = \frac{190 - 220}{9.950} \approx -3.02\]

about three standard deviations below the mean. Seeing 190 supporters would be strong evidence that the true support is below 55%, an idea that hypothesis testing makes precise later.

(a) \(220\); (b) \(\sqrt{99} \approx 9.950\); (c) yes: 190 is about 3 standard deviations below the mean

Review: ·

35A telemarketer makes a sale on 20% of calls, independently. Let \(X\) be the number of the call on which the first sale occurs. Find (a) \(P(X = 4)\), (b) \(P(X \le 3)\), (c) the expected number of calls needed to make the first sale.

Solution

Counting trials up to and including the first success, with constant success probability \(p = 0.2\), is the geometric setting: \(P(X = k) = (1 - p)^{k-1}p\).

(a) The first sale on call 4 means three failures and then a success:

\[P(X = 4) = (0.8)^3(0.2) = 0.512 \times 0.2 = 0.1024.\]

(b) “First sale within the first 3 calls” is the complement of “the first 3 calls all fail”:

\[P(X \le 3) = 1 - (0.8)^3 = 1 - 0.512 = 0.488.\]

(Adding \(P(1) + P(2) + P(3) = 0.2 + 0.16 + 0.128\) gives the same 0.488.)

(c) The mean of a geometric variable is \(1/p\):

\[E(X) = \frac{1}{0.2} = 5 \text{ calls}.\]

(a) \(0.1024\); (b) \(0.488\); (c) \(5\) calls

Review:

36A fair die is rolled until a 6 appears, and \(X\) is the number of rolls required. Find, to four decimals, (a) \(P(X \gt 3)\) and (b) \(P(X = 5)\), and (c) the standard deviation of \(X\) (to three decimals).

Solution

\(X\) is geometric with \(p = 1/6\).

(a) More than 3 rolls are needed exactly when the first three rolls are all non-sixes:

\[P(X \gt 3) = \left(\frac{5}{6}\right)^3 = \frac{125}{216} \approx 0.5787.\]

(b) Four failures, then a success:

\[P(X = 5) = \left(\frac{5}{6}\right)^4\left(\frac{1}{6}\right) = \frac{625}{7776} \approx 0.0804.\]

(c) The mean is \(1/p = 6\) rolls, and the variance of a geometric variable is \(\dfrac{1 - p}{p^2}\):

\[\sigma^2 = \frac{5/6}{(1/6)^2} = \frac{5}{6}\cdot 36 = 30\] \[\sigma = \sqrt{30} \approx 5.477 \text{ rolls}.\]

The standard deviation is almost as large as the mean: waiting times for a rare event are very spread out, with a long right tail.

(a) \(\dfrac{125}{216} \approx 0.5787\); (b) \(\dfrac{625}{7776} \approx 0.0804\); (c) \(\sqrt{30} \approx 5.477\)

Review:

37Calls arrive at a help desk at an average rate of 3 per minute, following a Poisson distribution. For a randomly chosen minute find, to four decimals, (a) the probability of exactly 2 calls, (b) the probability of no calls, (c) the probability of at least 2 calls.

Solution

With \(\lambda = 3\) calls per minute, \(P(X = k) = \dfrac{e^{-3}\,3^k}{k!}\). The base value is \(e^{-3} \approx 0.049787\).

(a)

\[P(X = 2) = \frac{e^{-3}\,3^2}{2!} = \frac{9}{2}e^{-3} \approx 4.5(0.049787) \approx 0.2240.\]

(b)

\[P(X = 0) = \frac{e^{-3}\,3^0}{0!} = e^{-3} \approx 0.0498.\]

(c) Use the complement, which needs only \(P(0)\) and \(P(1) = 3e^{-3} \approx 0.1494\):

\[P(X \ge 2) = 1 - P(0) - P(1) = 1 - 0.0498 - 0.1494 \approx 0.8009.\]

(a) \(0.2240\); (b) \(0.0498\); (c) \(0.8009\)

Review:

38Typographical errors in a manuscript occur at an average rate of 0.5 per page, following a Poisson distribution. For a 4-page chapter find, to four decimals, (a) the probability of no errors and (b) the probability of at most 2 errors; (c) give the variance of the number of errors in the chapter.

Solution

A Poisson rate scales with the length of the interval. Over 4 pages the mean number of errors is

\[\lambda = 0.5 \times 4 = 2.\]

(a)

\[P(X = 0) = e^{-2} \approx 0.1353.\]

(b) Add the terms for 0, 1 and 2 errors, each of the form \(e^{-2}2^k/k!\):

\[P(X \le 2) = e^{-2}\left(1 + 2 + \frac{4}{2}\right) = 5e^{-2} \approx 5(0.135335) \approx 0.6767.\]

(c) A Poisson variable has variance equal to its mean:

\[\sigma^2 = \lambda = 2.\]

(a) \(0.1353\); (b) \(0.6767\); (c) \(2\)

Review:

39Choose the probability model that best fits each random variable. (a) The number of defective chips in a random sample of 20 from a huge shipment in which 3% are defective. (b) The number of customers entering a bank during a given hour, when customers arrive independently at a steady average rate. (c) The number of times a die is rolled until the first 6 appears. (d) The number of hearts in a 5-card hand dealt from a well-shuffled deck.

Solution

(a) A fixed number of trials (20), each defective or not with the same probability 0.03, effectively independent because the shipment is huge: binomial, \(n = 20\), \(p = 0.03\).

(b) Counting events in a fixed interval of time when they occur independently at a constant average rate, with no upper limit on the count: Poisson.

(c) Counting trials until the first success, with constant success probability \(1/6\): geometric.

(d) The cards are dealt without replacement from a small population (52 cards, 13 hearts), so the chance of a heart changes as cards are removed and the trials are not independent. This is a hypergeometric variable, computed with combinations as in the light-bulb problem above. It is not binomial, because \(p\) is not constant from card to card.

(a) binomial; (b) Poisson; (c) geometric; (d) hypergeometric

Review: · ·

40A supplier ships boxes of 12 light bulbs. Each bulb is defective with probability 0.1, independently. A box passes inspection if it contains at most one defective bulb. Find (a) the probability that a box passes (to four decimals), (b) the expected number of defective bulbs per box, (c) the probability that all of 5 shipped boxes pass (to four decimals).

Solution

The number of defective bulbs in a box, \(X\), is binomial with \(n = 12\), \(p = 0.1\).

(a) A box passes when \(X = 0\) or \(X = 1\):

\[P(X = 0) = (0.9)^{12} \approx 0.2824\] \[P(X = 1) = 12(0.1)(0.9)^{11} \approx 0.3766\] \[P(\text{pass}) = 0.2824 + 0.3766 \approx 0.6590.\]

(b) Binomial mean:

\[E(X) = np = 12(0.1) = 1.2 \text{ defective bulbs}.\]

(c) The boxes are independent, so now each box is a trial that “succeeds” (passes) with probability 0.6590, and we want 5 successes in 5 trials:

\[P(\text{all 5 pass}) = (0.6590)^5 \approx 0.1243.\]

Even though each box passes about two thirds of the time, a shipment of five is more likely than not to contain a rejected box.

(a) \(0.6590\); (b) \(1.2\); (c) \(0.1243\)

Review: ·

Set 3: continuous and sampling distributions

Statistics · Practice problems 41 to 60

Problems 41 to 60

One hundred introductory statistics problems: descriptive statistics, probability and distributions, sampling distributions, confidence intervals and hypothesis tests, and chi-square, ANOVA and regression. Each opens to a full worked solution with the answer highlighted; critical values used are quoted in the solution.

41A bus arrives at a stop every 20 minutes, and a rider arrives at a random time, so the waiting time \(W\) is uniformly distributed on \([0, 20]\) minutes. Find (a) \(P(W \lt 5)\), (b) \(P(8 \lt W \lt 14)\), (c) the mean waiting time, (d) the standard deviation of \(W\) (to three decimals).

Solution

The density of a uniform variable on \([0, 20]\) is a flat line of height \(\dfrac{1}{20 - 0} = 0.05\), and a probability is the area of a rectangle: (length of the interval) \(\times\) \(0.05\). Equivalently, it is the fraction of the whole interval that the event covers.

(a)

\[P(W \lt 5) = \frac{5 - 0}{20} = 0.25.\]

(b)

\[P(8 \lt W \lt 14) = \frac{14 - 8}{20} = \frac{6}{20} = 0.3.\]

(c) By symmetry the mean is the midpoint:

\[\mu = \frac{0 + 20}{2} = 10 \text{ minutes}.\]

(d) For a uniform distribution on \([a, b]\), \(\sigma = \dfrac{b - a}{\sqrt{12}}\):

\[\sigma = \frac{20}{\sqrt{12}} \approx 5.774 \text{ minutes}.\]

(a) \(0.25\); (b) \(0.3\); (c) \(10\) min; (d) \(20/\sqrt{12} \approx 5.774\) min

Review: ·

42A random variable \(X\) is uniformly distributed on the interval \([2, 10]\). (a) What is the height of its density curve? (b) Find \(P(X \gt 7)\). (c) Find the 80th percentile of \(X\).

Solution

(a) The density is a rectangle of width \(10 - 2 = 8\) whose total area must be 1, so its height is

\[f(x) = \frac{1}{8} = 0.125 \quad \text{for } 2 \le x \le 10.\]

(b) The area to the right of 7:

\[P(X \gt 7) = (10 - 7)\times\frac{1}{8} = \frac{3}{8} = 0.375.\]

(c) The 80th percentile is the value \(x\) with 80% of the area to its left:

\[\frac{x - 2}{8} = 0.80\] \[\Longrightarrow\ x - 2 = 6.4\] \[\Longrightarrow\ x = 8.4.\]

Check: \(P(X \lt 8.4) = 6.4/8 = 0.8\).

(a) \(\dfrac{1}{8}\); (b) \(\dfrac{3}{8} = 0.375\); (c) \(8.4\)

Review:

43The lifetime \(T\) of an electronic component is exponentially distributed with mean 500 hours. Find, to four decimals, (a) the probability that it lasts more than 800 hours and (b) the probability that it fails within 200 hours; (c) find the median lifetime (to one decimal).

Solution

An exponential variable with mean \(\mu = 500\) has rate \(\lambda = 1/\mu = 0.002\) per hour, and its survival probability is

\[P(T \gt t) = e^{-\lambda t} = e^{-t/500}.\]

(a)

\[P(T \gt 800) = e^{-800/500} = e^{-1.6} \approx 0.2019.\]

(b) Failing within 200 hours is the complement of surviving past 200:

\[P(T \lt 200) = 1 - e^{-200/500} = 1 - e^{-0.4} \approx 1 - 0.6703 = 0.3297.\]

(c) The median \(m\) satisfies \(P(T \gt m) = 0.5\):

\[e^{-m/500} = 0.5\] \[\Longrightarrow\ m = 500\ln 2 \approx 346.6 \text{ hours}.\]

The median is below the mean of 500, as expected for a right-skewed distribution: more than half of the components fail before the average lifetime.

(a) \(0.2019\); (b) \(0.3297\); (c) \(500\ln 2 \approx 346.6\) hours

Review:

44Cars arrive at a drive-through at an average rate of 4 per hour, so the time \(T\) between arrivals is exponential with mean 15 minutes. (a) Find the probability that the next car arrives within 10 minutes (to four decimals). (b) Given that no car has arrived in the first 10 minutes, find the probability that none arrives in the next 10 minutes either. (c) What is the standard deviation of \(T\), in minutes?

Solution

With mean 15 minutes, \(P(T \gt t) = e^{-t/15}\).

(a)

\[P(T \le 10) = 1 - e^{-10/15} = 1 - e^{-2/3} \approx 1 - 0.5134 = 0.4866.\]

(b) We want \(P(T \gt 20 \mid T \gt 10)\). By the definition of conditional probability,

\[P(T \gt 20 \mid T \gt 10) = \frac{P(T \gt 20)}{P(T \gt 10)} = \frac{e^{-20/15}}{e^{-10/15}} = e^{-10/15} \approx 0.5134.\]

This equals \(P(T \gt 10)\): the exponential distribution is memoryless. Having already waited 10 minutes does not make the next car any more imminent.

(c) For an exponential distribution the standard deviation equals the mean:

\[\sigma = \mu = 15 \text{ minutes}.\]

(a) \(0.4866\); (b) \(0.5134\); (c) \(15\) min

Review: ·

45Let \(Z\) be a standard normal random variable. Find, to four decimals, (a) \(P(Z \lt 1.28)\), (b) \(P(Z \gt -0.75)\), (c) \(P(-1.5 \lt Z \lt 2.0)\).

Solution

The standard normal table gives left-tail areas \(\Phi(z) = P(Z \lt z)\).

(a) Read directly:

\[P(Z \lt 1.28) = \Phi(1.28) \approx 0.8997.\]

(b) A right-tail area is 1 minus the left-tail area; by symmetry it also equals the left-tail area at the opposite \(z\):

\[P(Z \gt -0.75) = 1 - \Phi(-0.75) = \Phi(0.75) \approx 0.7734.\]

(c) The area between two values is the difference of the two left-tail areas:

\[P(-1.5 \lt Z \lt 2.0) = \Phi(2.0) - \Phi(-1.5) \approx 0.9772 - 0.0668 = 0.9104.\]

(a) \(0.8997\); (b) \(0.7734\); (c) \(0.9104\)

Review:

46Find each \(z\)-value: (a) \(z\) such that \(P(Z \lt z) = 0.025\); (b) \(z\) such that \(P(Z \gt z) = 0.10\); (c) \(z\) such that \(P(-z \lt Z \lt z) = 0.90\). Give (a) and (b) to two decimals and (c) to three.

Solution

Inverse lookups: turn each statement into a left-tail area and read the table backwards.

(a) The left-tail area is given directly. The table shows an area of 0.0250 at

\[z = -1.96.\]

(b) A right tail of 0.10 means a left-tail area of \(1 - 0.10 = 0.90\). The closest table entry to 0.9000 is at

\[z = 1.28 \quad(\text{more precisely } 1.2816).\]

(c) If 0.90 of the area is in the middle, the remaining 0.10 is split equally between the two tails, 0.05 each. So \(z\) has left-tail area \(0.95\):

\[z = 1.645.\]

(The table shows 0.9495 at 1.64 and 0.9505 at 1.65, so 1.645 is used.) These three values, 1.96, 1.28 and 1.645, are the critical values that reappear in 95%, 80% and 90% confidence intervals.

(a) \(-1.96\); (b) \(1.28\); (c) \(1.645\)

Review:

47IQ scores are normally distributed with mean 100 and standard deviation 15. Find, to four decimals, the proportion of people with (a) an IQ above 130, (b) an IQ between 85 and 115, (c) an IQ below 91.

Solution

Standardize each boundary with \(z = \dfrac{x - 100}{15}\), then use the standard normal table.

(a) \(z = \dfrac{130 - 100}{15} = 2\):

\[P(X \gt 130) = P(Z \gt 2) = 1 - \Phi(2) \approx 1 - 0.9772 = 0.0228.\]

(b) 85 and 115 are one standard deviation below and above the mean, \(z = -1\) and \(z = 1\):

\[P(85 \lt X \lt 115) = \Phi(1) - \Phi(-1) \approx 0.84134 - 0.15866 = 0.6827.\]

This is the exact version of the “68%” in the empirical rule.

(c) \(z = \dfrac{91 - 100}{15} = -0.6\):

\[P(X \lt 91) = \Phi(-0.6) \approx 0.2743.\]

(a) \(0.0228\); (b) \(0.6827\); (c) \(0.2743\)

Review: ·

48Scores on a certification exam are normally distributed with mean 500 and standard deviation 80. (a) What score is needed to be in the top 5%? (b) The lowest 20% of candidates must retake the exam; what is the cutoff score? (c) The middle 50% of scores lie between two values; find the upper one. Give each score to one decimal.

Solution

These are inverse problems: find the \(z\) for the required area, then convert back with \(x = \mu + z\sigma = 500 + 80z\).

(a) The top 5% begins where the left-tail area is 0.95, at \(z = 1.645\):

\[x = 500 + 1.645(80) = 500 + 131.6 = 631.6.\]

(b) A left-tail area of 0.20 corresponds to \(z = -0.84\) (more precisely \(-0.8416\)):

\[x = 500 + (-0.8416)(80) = 500 - 67.3 \approx 432.7.\]

(c) The middle 50% runs from the 25th to the 75th percentile, \(z = \pm 0.6745\):

\[x = 500 \pm 0.6745(80) = 500 \pm 54.0\]

so the middle half of the scores lies between about \(446.0\) and \(554.0\); the upper value is \(554.0\). (For a normal distribution the IQR is always about \(1.35\sigma\), here \(108\).)

(a) \(\approx 631.6\); (b) \(\approx 432.7\); (c) \(\approx 554.0\) (the middle 50% runs from about 446.0 to 554.0)

Review:

49A machine fills bags of rice; the fill weights are normally distributed with standard deviation 4 g, and the mean can be adjusted. (a) At what mean should the machine be set so that only 2% of bags weigh less than 500 g (to one decimal)? (b) If instead the mean is fixed at 506 g, what standard deviation would make 2% of bags weigh less than 500 g (to two decimals)?

Solution

In both parts the condition is \(P(X \lt 500) = 0.02\). Standardizing, \(P\!\left(Z \lt \dfrac{500 - \mu}{\sigma}\right) = 0.02\), and the table gives a left-tail area of 0.02 at \(z = -2.054\) (the entry 0.0202 sits at \(-2.05\)). So in each part

\[\frac{500 - \mu}{\sigma} = -2.054.\]

(a) With \(\sigma = 4\), solve for \(\mu\):

\[500 - \mu = -2.054(4) = -8.2\] \[\Longrightarrow\ \mu \approx 508.2 \text{ g}.\]

The mean must sit about two standard deviations above 500 so that only the bottom 2% fall under the label weight.

(b) With \(\mu = 506\), solve for \(\sigma\):

\[\frac{500 - 506}{\sigma} = -2.054\] \[\Longrightarrow\ \sigma = \frac{6}{2.054} \approx 2.92 \text{ g}.\]

Keeping the mean lower saves rice on every bag, but it requires a more precise machine.

(a) \(\mu \approx 508.2\) g; (b) \(\sigma \approx 2.92\) g

Review: ·

50The tread life of a brand of tire is normally distributed with mean 60,000 miles and standard deviation 5,000 miles. (a) What proportion of tires wear out before 52,000 miles (to four decimals)? (b) The manufacturer will replace free any tire that wears out before a guaranteed mileage, and wants to replace only 3% of tires. What mileage should be guaranteed (to the nearest hundred miles)? (c) What proportion of tires last between 55,000 and 70,000 miles (to four decimals)?

Solution

(a) Standardize:

\[z = \frac{52{,}000 - 60{,}000}{5{,}000} = -1.6\] \[P(X \lt 52{,}000) = \Phi(-1.6) \approx 0.0548.\]

About 5.5% of tires wear out before 52,000 miles.

(b) We need the mileage \(x\) with \(P(X \lt x) = 0.03\). The table gives a left-tail area of 0.03 at \(z = -1.88\), so

\[x = 60{,}000 + (-1.88)(5{,}000) = 60{,}000 - 9{,}400 = 50{,}600 \text{ miles}.\]

Guaranteeing about 50,600 miles keeps the replacements near 3%.

(c) The boundaries standardize to \(z = \dfrac{55{,}000 - 60{,}000}{5{,}000} = -1\) and \(z = \dfrac{70{,}000 - 60{,}000}{5{,}000} = 2\):

\[P(55{,}000 \lt X \lt 70{,}000) = \Phi(2) - \Phi(-1) \approx 0.97725 - 0.15866 = 0.8186.\]

(a) \(0.0548\); (b) about \(50{,}600\) miles; (c) \(0.8186\)

Review: ·

51The time a technician needs to service a machine has mean \(\mu = 50\) minutes and standard deviation \(\sigma = 12\) minutes. A random sample of \(n = 36\) service calls is taken. (a) Find the standard error of the sample mean \(\bar{x}\). (b) Find the probability that the sample mean is between 47 and 55 minutes (to four decimals).

Solution

(a) The sampling distribution of \(\bar{x}\) has the same mean as the population and a standard deviation that shrinks with \(\sqrt{n}\):

\[\mu_{\bar{x}} = \mu = 50\] \[\sigma_{\bar{x}} = \frac{\sigma}{\sqrt{n}} = \frac{12}{\sqrt{36}} = \frac{12}{6} = 2 \text{ minutes}.\]

(b) With \(n = 36 \ge 30\) the Central Limit Theorem says \(\bar{x}\) is approximately normal, so standardize both endpoints using the standard error, not \(\sigma\):

\[z_1 = \frac{47 - 50}{2} = -1.5\] \[z_2 = \frac{55 - 50}{2} = 2.5.\] \[P(47 \lt \bar{x} \lt 55) = P(-1.5 \lt Z \lt 2.5) = \Phi(2.5) - \Phi(-1.5) = 0.9938 - 0.0668 = 0.9270.\]

A single service call lands in that window far less often (\(z = \pm 0.25\) and \(0.42\) give only about 0.26); averaging 36 calls pulls the mean tightly around 50.

(a) \(\sigma_{\bar{x}} = 2\) minutes; (b) \(P(47 \lt \bar{x} \lt 55) \approx 0.9270\)

Review: ·

52The lifetime of a certain battery has a right-skewed distribution with mean 500 hours and standard deviation 60 hours. A quality inspector tests a random sample of 36 batteries. (a) Find the probability that the sample mean lifetime is between 490 and 515 hours (to four decimals). (b) Which statement best justifies using a normal model in part (a)? (i) The population is normal. (ii) The sample size is at least 30, so the Central Limit Theorem applies to \(\bar{x}\). (iii) Battery lifetimes are always normal. (iv) The standard deviation is known.

Solution

(a) The population is skewed, so an individual lifetime is not normal. But the sample mean of \(n = 36\) lifetimes is approximately normal by the Central Limit Theorem, with

\[\mu_{\bar{x}} = 500\] \[\sigma_{\bar{x}} = \frac{60}{\sqrt{36}} = 10 \text{ hours}.\] \[z_1 = \frac{490 - 500}{10} = -1\] \[z_2 = \frac{515 - 500}{10} = 1.5.\] \[P(490 \lt \bar{x} \lt 515) = \Phi(1.5) - \Phi(-1) = 0.9332 - 0.1587 = 0.7745.\]

(b) Nothing was assumed about the population shape; the normal model is earned by the sample size. With \(n = 36 \ge 30\) the Central Limit Theorem makes the distribution of \(\bar{x}\) approximately normal even though the lifetimes themselves are skewed. Statement (ii) is the justification; (i) and (iii) are false, and (iv) is irrelevant to shape.

(a) \(\approx 0.7745\); (b) statement (ii), the Central Limit Theorem with \(n \ge 30\)

Review: ·

53Scores on an IQ test are normally distributed with mean 100 and standard deviation 15. (a) Find the probability that one randomly chosen person scores above 110. (b) Find the probability that the mean score of a random sample of 9 people is above 110. Give both to four decimals.

Solution

(a) One person’s score \(X\) is normal with \(\sigma = 15\):

\[z = \frac{110 - 100}{15} = 0.667\] \[P(X \gt 110) = 1 - \Phi(0.667) = 1 - 0.7475 = 0.2525.\]

(A table rounded to \(z = 0.67\) gives 0.2514; either is fine.)

(b) The population is normal, so the sample mean is exactly normal for any \(n\), with standard error \(15/\sqrt{9} = 5\):

\[z = \frac{110 - 100}{5} = 2\] \[P(\bar{x} \gt 110) = 1 - \Phi(2) = 1 - 0.9772 = 0.0228.\]

The same cutoff is far less likely for an average than for an individual. An individual scoring 110 is unremarkable (two thirds of a standard deviation above the mean); an average of nine people at 110 is two standard errors out.

(a) \(\approx 0.2525\) (table: 0.2514); (b) \(\approx 0.0228\)

Review: ·

54Forty percent of the customers at a coffee shop order a pastry. A random sample of 150 customers is observed and \(\hat{p}\) is the sample proportion who order a pastry. (a) Find the standard deviation of \(\hat{p}\). (b) Find the probability that more than 46% of the sampled customers order a pastry (to four decimals).

Solution

(a) The sampling distribution of a sample proportion has mean \(p\) and standard deviation \(\sqrt{p(1-p)/n}\):

\[\mu_{\hat{p}} = 0.40\] \[\sigma_{\hat{p}} = \sqrt{\frac{0.40(0.60)}{150}} = \sqrt{0.0016} = 0.04.\]

(b) Check the normal condition: \(np = 60\) and \(n(1 - p) = 90\) are both at least 10, so \(\hat{p}\) is approximately normal.

\[z = \frac{0.46 - 0.40}{0.04} = 1.5\] \[P(\hat{p} \gt 0.46) = 1 - \Phi(1.5) = 1 - 0.9332 = 0.0668.\]

So a sample proportion of 46% or more happens in only about 7% of samples of this size when the true rate is 40%.

(a) \(\sigma_{\hat{p}} = 0.04\); (b) \(P(\hat{p} \gt 0.46) \approx 0.0668\)

Review: ·

55A candidate actually has the support of 52% of all voters. (a) A polling firm surveys a random sample of 400 voters. What is the probability that the poll shows the candidate with less than 50% support, i.e. \(\hat{p} \lt 0.50\)? (b) What is that probability if the firm instead surveys 1,600 voters? Give both answers to three decimals.

Solution

Here \(p = 0.52\). The normal condition holds easily for both sample sizes (\(np = 208\) and \(n(1 - p) = 192\) even for \(n = 400\)), so the sampling distribution of \(\hat{p}\) is approximately normal with mean \(0.52\) and standard deviation \(\sqrt{p(1-p)/n}\).

(a) For \(n = 400\):

\[\sigma_{\hat{p}} = \sqrt{\frac{0.52(0.48)}{400}} = \sqrt{0.000624} = 0.02498.\] \[z = \frac{0.50 - 0.52}{0.02498} = -0.80\] \[P(\hat{p} \lt 0.50) = \Phi(-0.80) = 0.212.\]

About one poll in five of this size would show the candidate trailing even though a majority supports them. That is the sampling variability a 2-point lead cannot overcome with \(n = 400\).

(b) Quadrupling the sample halves the standard deviation of \(\hat{p}\):

\[\sigma_{\hat{p}} = \sqrt{\frac{0.52(0.48)}{1600}} = \sqrt{0.000156} = 0.01249.\] \[z = \frac{0.50 - 0.52}{0.01249} = -1.60\] \[P(\hat{p} \lt 0.50) = \Phi(-1.60) = 0.055.\]

The same 2-point lead is now 1.6 standard deviations wide instead of 0.8, and the chance of a misleading poll drops from about 21% to about 5%. Larger polls are more reliable, but only in proportion to \(\sqrt{n}\): four times the voters buys half the standard deviation.

(a) \(P(\hat{p} \lt 0.50) \approx 0.212\); (b) \(\approx 0.055\)

Review: ·

56A bottling line fills bottles with a volume that is normally distributed with mean 16.1 ounces and standard deviation 0.3 ounces. Every hour the line supervisor averages the volumes of 9 randomly chosen bottles. (a) Find the value \(c\) such that the hourly average exceeds \(c\) only 5% of the time (to three decimals). (b) Find the probability that an hourly average is below 16 ounces (to four decimals).

Solution

The population is normal, so \(\bar{x}\) is normal with mean 16.1 and standard error

\[\sigma_{\bar{x}} = \frac{0.3}{\sqrt{9}} = 0.1 \text{ ounce}.\]

(a) The \(z\)-value that leaves 5% in the upper tail is \(z = 1.645\). Convert back to the \(\bar{x}\) scale with the standard error:

\[c = \mu + z\,\sigma_{\bar{x}} = 16.1 + 1.645(0.1) = 16.2645 \approx 16.264 \text{ ounces}.\]

(b) Standardize 16 with the standard error:

\[z = \frac{16 - 16.1}{0.1} = -1\] \[P(\bar{x} \lt 16) = \Phi(-1) = 0.1587.\]

Using \(\sigma = 0.3\) instead of \(0.1\) in either part is the classic slip; it would give \(z = -0.33\) in (b), the answer for a single bottle rather than an average of nine.

(a) \(c \approx 16.264\) ounces; (b) \(P(\bar{x} \lt 16) \approx 0.1587\)

Review: ·

57A population has standard deviation \(\sigma = 20\). (a) What is the smallest sample size \(n\) for which the standard error of the sample mean is at most 2.5? (b) If a researcher quadruples the sample size, what happens to the standard error of \(\bar{x}\)? (i) It is divided by 4. (ii) It is divided by 2. (iii) It is multiplied by 2. (iv) It is unchanged, since \(\sigma\) is fixed.

Solution

(a) Set the standard error formula equal to the target and solve for \(n\):

\[\frac{\sigma}{\sqrt{n}} \le 2.5\] \[\Longrightarrow\ \sqrt{n} \ge \frac{20}{2.5} = 8\] \[\Longrightarrow\ n \ge 64.\]

So \(n = 64\) is the smallest sample size; it gives \(\sigma_{\bar{x}} = 20/8 = 2.5\) exactly.

(b) The standard error is \(\sigma/\sqrt{n}\). Replacing \(n\) by \(4n\) replaces \(\sqrt{n}\) by \(\sqrt{4n} = 2\sqrt{n}\), so the standard error is divided by 2, statement (ii). Precision grows only with the square root of the sample size: to cut the standard error in half you must collect four times as much data, and to cut it to a quarter you need sixteen times as much.

(a) \(n = 64\); (b) statement (ii), the standard error is halved

Review: ·

58The weights of adults using a building’s elevator have mean 170 pounds and standard deviation 30 pounds. The elevator is rated for a maximum load of 4,500 pounds. If 25 randomly chosen adults board together, what is the probability that their total weight exceeds the rated load? Give the answer to four decimals.

Solution

A total exceeding 4,500 pounds for 25 people is the same event as a sample mean exceeding \(4500/25 = 180\) pounds, so convert the question about a total into one about \(\bar{x}\).

By the Central Limit Theorem (the sample is not tiny, and weights are not badly skewed), \(\bar{x}\) is approximately normal with

\[\mu_{\bar{x}} = 170\] \[\sigma_{\bar{x}} = \frac{30}{\sqrt{25}} = 6 \text{ pounds}.\] \[z = \frac{180 - 170}{6} = 1.667\] \[P(\bar{x} \gt 180) = 1 - \Phi(1.667) = 1 - 0.9522 = 0.0478.\]

So roughly one full load in twenty would exceed the rating; a table rounded to \(z = 1.67\) gives 0.0475. Equivalently, the total has mean \(25 \times 170 = 4250\) and standard deviation \(30\sqrt{25} = 150\), and \((4500 - 4250)/150 = 1.667\) again.

\(P(\text{total} \gt 4500) = P(\bar{x} \gt 180) \approx 0.0478\)

Review: ·

59A population has mean \(\mu = 70\) and standard deviation \(\sigma = 10\). Find the probability that a sample mean lands within 2 units of \(\mu\), that is \(P(68 \lt \bar{x} \lt 72)\), for (a) a random sample of \(n = 25\) and (b) a random sample of \(n = 100\). Give both to four decimals and assume the normal model applies.

Solution

Within 2 units of the mean means a \(z\)-score between \(-2/\sigma_{\bar{x}}\) and \(2/\sigma_{\bar{x}}\), so everything depends on the standard error.

(a) For \(n = 25\), \(\sigma_{\bar{x}} = 10/\sqrt{25} = 2\), so 2 units is exactly one standard error:

\[P(68 \lt \bar{x} \lt 72) = P(-1 \lt Z \lt 1) = \Phi(1) - \Phi(-1) = 0.8413 - 0.1587 = 0.6827.\]

(b) For \(n = 100\), \(\sigma_{\bar{x}} = 10/\sqrt{100} = 1\), so the same 2 units is now two standard errors:

\[P(68 \lt \bar{x} \lt 72) = P(-2 \lt Z \lt 2) = \Phi(2) - \Phi(-2) = 0.9772 - 0.0228 = 0.9545.\]

These are the 68% and 95% figures of the empirical rule. Quadrupling the sample halves the standard error, so the same tolerance band captures the sample mean far more often.

(a) \(\approx 0.6827\); (b) \(\approx 0.9545\)

Review: ·

60Daily sales at a food truck are strongly right-skewed with mean $8 hundred and standard deviation $6 hundred. (a) Find the standard error of the mean of a random sample of 100 days. (b) Which statement describes the sampling distribution of \(\bar{x}\) for samples of only \(n = 4\) days? (i) Approximately normal, by the Central Limit Theorem. (ii) Still right-skewed, because \(n\) is too small for the CLT. (iii) Exactly normal, because sample means are always normal. (iv) Uniform between the smallest and largest sale. (c) For \(n = 100\), find the probability that the sample mean exceeds $9.5 hundred (to four decimals).

Solution

(a) The standard error is \(\sigma/\sqrt{n}\):

\[\sigma_{\bar{x}} = \frac{6}{\sqrt{100}} = 0.6 \text{ (hundred dollars)}.\]

(b) The Central Limit Theorem needs a large sample when the population is heavily skewed; the usual rule of thumb is \(n \ge 30\). With \(n = 4\) the average of four skewed values is less skewed than a single day, but it is still noticeably right-skewed, so statement (ii) is correct. Statement (iii) is a common misconception: sample means are normal for any \(n\) only when the population itself is normal.

(c) With \(n = 100\) the CLT applies and \(\bar{x}\) is approximately normal with mean 8 and standard error 0.6:

\[z = \frac{9.5 - 8}{0.6} = 2.5\] \[P(\bar{x} \gt 9.5) = 1 - \Phi(2.5) = 1 - 0.9938 = 0.0062.\]

(a) \(0.6\); (b) statement (ii), still right-skewed; (c) \(P(\bar{x} \gt 9.5) \approx 0.0062\)

Review: ·

Set 4: confidence intervals and hypothesis tests

Statistics · Practice problems 61 to 85

Problems 61 to 85

One hundred introductory statistics problems: descriptive statistics, probability and distributions, sampling distributions, confidence intervals and hypothesis tests, and chi-square, ANOVA and regression. Each opens to a full worked solution with the answer highlighted; critical values used are quoted in the solution.

61The breaking strength of a type of rope has a known standard deviation \(\sigma = 8\) pounds. A random sample of 64 ropes has mean breaking strength \(\bar{x} = 52.3\) pounds. (a) Find the margin of error for a 95% confidence interval for the population mean \(\mu\). (b) Find the lower endpoint of the interval. (c) Find the upper endpoint.

Solution

Because \(\sigma\) is known, this is a \(z\)-interval. For 95% confidence the critical value is \(z^* = 1.960\) (the value that leaves 2.5% in each tail).

(a) The margin of error is the critical value times the standard error:

\[ME = z^*\,\frac{\sigma}{\sqrt{n}} = 1.960\cdot\frac{8}{\sqrt{64}} = 1.960(1) = 1.96 \text{ pounds}.\]

(b), (c) The interval is the point estimate plus or minus the margin of error:

\[\bar{x} \pm ME = 52.3 \pm 1.96\] \[(50.34,\ 54.26).\]

We are 95% confident that the mean breaking strength of all ropes of this type is between 50.34 and 54.26 pounds. The confidence is in the method: 95% of intervals built this way capture \(\mu\).

(a) \(ME = 1.96\); (b) and (c) \((50.34,\ 54.26)\) pounds

Review: ·

62A random sample of 10 commuters reports a mean one-way commute of \(\bar{x} = 24.6\) minutes with sample standard deviation \(s = 3.2\) minutes. Assume commute times are approximately normal. (a) Find the margin of error for a 95% confidence interval for the mean commute \(\mu\) (to three decimals). (b) Find the lower endpoint of the interval. (c) Find the upper endpoint.

Solution

The population standard deviation is unknown and the sample is small, so use the \(t\)-distribution with \(df = n - 1 = 9\). For 95% confidence the critical value is \(t_{0.025,\,9} = 2.262\).

(a) The standard error is \(s/\sqrt{n} = 3.2/\sqrt{10} = 1.0119\), so

\[ME = t^*\,\frac{s}{\sqrt{n}} = 2.262(1.0119) = 2.289 \text{ minutes}.\]

(b), (c) Centre the interval at \(\bar{x}\):

\[24.6 \pm 2.289\] \[(22.311,\ 26.889).\]

Had we wrongly used \(z^* = 1.960\) the margin would be only 1.983; the larger \(t^*\) is the price of estimating \(\sigma\) from ten observations.

(a) \(ME \approx 2.289\); (b) and (c) \((22.311,\ 26.889)\) minutes

Review: ·

63Six randomly chosen plants of a new tomato variety produced the following numbers of fruit: \(12,\ 15,\ 11,\ 14,\ 18,\ 14\). (a) Find the sample standard deviation \(s\) (to three decimals). (b) Find the lower endpoint of a 90% confidence interval for the mean yield per plant (to three decimals). (c) Find the upper endpoint.

Solution

(a) The sample mean is \(\bar{x} = 84/6 = 14\). The deviations from 14 are \(-2, 1, -3, 0, 4, 0\), whose squares sum to \(4 + 1 + 9 + 0 + 16 + 0 = 30\):

\[s^2 = \frac{30}{n - 1} = \frac{30}{5} = 6\] \[s = \sqrt{6} = 2.449.\]

(b), (c) With \(\sigma\) unknown and \(n = 6\), use \(t\) with \(df = 5\). For 90% confidence, 5% sits in each tail and \(t_{0.05,\,5} = 2.015\). The standard error is \(s/\sqrt{n} = \sqrt{6}/\sqrt{6} = 1\) exactly, so

\[ME = 2.015(1) = 2.015\] \[14 \pm 2.015 = (11.985,\ 16.015).\]

We are 90% confident the mean yield of this variety is between about 12.0 and 16.0 fruit per plant. With only six plants the interval is wide; the normality assumption matters here and should be checked with a dot plot (no outliers, roughly symmetric).

(a) \(s = \sqrt{6} \approx 2.449\); (b) and (c) \((11.985,\ 16.015)\)

Review: ·

64A report states a 95% confidence interval of \((45.2,\ 51.8)\) for the mean weekly study time, in hours, of students at a university. (a) What was the sample mean? (b) What was the margin of error? (c) Which statement is a correct interpretation of the interval? (i) 95% of students study between 45.2 and 51.8 hours per week. (ii) There is a 95% probability that \(\mu\) is between 45.2 and 51.8. (iii) We are 95% confident that the mean study time of all students at the university is between 45.2 and 51.8 hours. (iv) 95% of all samples will have a mean between 45.2 and 51.8.

Solution

A confidence interval for a mean has the form \(\bar{x} \pm ME\), so its centre is \(\bar{x}\) and its half-width is \(ME\).

(a) The centre:

\[\bar{x} = \frac{45.2 + 51.8}{2} = \frac{97}{2} = 48.5 \text{ hours}.\]

(b) The half-width:

\[ME = \frac{51.8 - 45.2}{2} = \frac{6.6}{2} = 3.3 \text{ hours}.\]

(c) Statement (iii) is correct: the interval is a statement about the population mean, and the 95% refers to how often the method captures it. Statement (i) confuses the interval with the spread of individual students; (ii) treats the fixed number \(\mu\) as random (a given interval either contains \(\mu\) or it does not); (iv) is about other sample means, not about \(\mu\).

(a) \(\bar{x} = 48.5\); (b) \(ME = 3.3\); (c) statement (iii)

Review: ·

65In a random sample of 400 adults, 132 said they had read a book in the past month. (a) Find the standard error of the sample proportion \(\hat{p}\) (to four decimals). (b) Find the lower endpoint of a 95% confidence interval for the proportion \(p\) of all adults who read a book in the past month (to four decimals). (c) Find the upper endpoint.

Solution

The sample proportion is \(\hat{p} = 132/400 = 0.33\). The normal condition holds: \(n\hat{p} = 132\) and \(n(1 - \hat{p}) = 268\) are both at least 10.

(a) A proportion has no separate \(\sigma\); its standard error comes from \(\hat{p}\) itself:

\[SE = \sqrt{\frac{\hat{p}(1 - \hat{p})}{n}} = \sqrt{\frac{0.33(0.67)}{400}} = \sqrt{0.00055275} = 0.0235.\]

(b), (c) With \(z^* = 1.960\) for 95% confidence,

\[ME = 1.960(0.0235) = 0.0461\] \[0.33 \pm 0.0461 = (0.2839,\ 0.3761).\]

We are 95% confident that between about 28.4% and 37.6% of all adults read a book last month.

(a) \(SE \approx 0.0235\); (b) and (c) \((0.2839,\ 0.3761)\)

Review: ·

66A pharmacy audits 150 randomly selected prescriptions and finds that 57 were filled with a generic drug. (a) Find the margin of error for a 99% confidence interval for the proportion of all prescriptions filled generically (to four decimals). (b) Find the lower endpoint of the interval (to four decimals). (c) Find the upper endpoint.

Solution

Here \(\hat{p} = 57/150 = 0.38\), and \(n\hat{p} = 57\), \(n(1-\hat{p}) = 93\) are both at least 10, so the normal approximation is appropriate. For 99% confidence the critical value leaves 0.5% in each tail: \(z^* = 2.576\).

(a)

\[SE = \sqrt{\frac{0.38(0.62)}{150}} = \sqrt{0.0015707} = 0.0396\] \[ME = 2.576(0.0396) = 0.1021.\]

(b), (c)

\[0.38 \pm 0.1021 = (0.2779,\ 0.4821).\]

The 99% interval is wide, about 20 percentage points across, because of the small sample and the high confidence level. A 95% interval from the same data would have margin \(1.960(0.0396) = 0.0777\).

(a) \(ME \approx 0.1021\); (b) and (c) \((0.2779,\ 0.4821)\)

Review: ·

67From past studies, the standard deviation of adult systolic blood pressure is about \(\sigma = 15\) mmHg. How many adults must be sampled to estimate the mean systolic blood pressure to within 2 mmHg with 95% confidence?

Solution

The margin of error of a \(z\)-interval is \(ME = z^*\sigma/\sqrt{n}\). Set it equal to the desired precision and solve for \(n\):

\[\sqrt{n} = \frac{z^*\sigma}{ME}\] \[\Longrightarrow\ n = \left(\frac{z^*\sigma}{ME}\right)^2.\]

With \(z^* = 1.960\), \(\sigma = 15\) and \(ME = 2\):

\[n = \left(\frac{1.960\cdot 15}{2}\right)^2 = (14.7)^2 = 216.09.\]

A sample size must be a whole number and the margin must be at most 2, so always round up: \(n = 217\). Rounding down to 216 would give a margin slightly larger than 2.

\(n = (1.960\cdot 15/2)^2 = 216.09\), so \(n = 217\)

Review: ·

68A polling organization wants to estimate the proportion of voters who favour a ballot measure to within 3 percentage points with 95% confidence. (a) How many voters must be polled if nothing is known in advance about the proportion? (b) How many are needed if a previous poll suggests the proportion is near 0.20?

Solution

The margin of error for a proportion is \(ME = z^*\sqrt{p(1-p)/n}\). Solving for \(n\):

\[n = p(1 - p)\left(\frac{z^*}{ME}\right)^2\] \[\frac{z^*}{ME} = \frac{1.960}{0.03} = 65.33\] \[\left(\frac{z^*}{ME}\right)^2 = 4268.4.\]

(a) With no prior information use the conservative value \(p = 0.5\), which makes \(p(1-p) = 0.25\) as large as possible:

\[n = 0.25(4268.4) = 1067.1\] \[\Longrightarrow\ n = 1068.\]

(b) With \(p \approx 0.20\), \(p(1-p) = 0.16\):

\[n = 0.16(4268.4) = 682.95\] \[\Longrightarrow\ n = 683.\]

Round up in both cases. A good prior estimate cuts the required sample by more than a third, because \(p(1-p)\) is much smaller away from 0.5.

(a) \(n = 1068\); (b) \(n = 683\)

Review: ·

69Scores on a placement exam have standard deviation \(\sigma = 20\) points. (a) How many students must be tested to estimate the mean score to within 4 points with 90% confidence? (b) How many are needed to estimate it to within 2 points at the same confidence level? (c) Compared with part (a), halving the margin of error requires roughly: (i) twice as many students; (ii) four times as many; (iii) half as many; (iv) the same number, since \(\sigma\) is unchanged.

Solution

For 90% confidence the critical value is \(z^* = 1.645\) (5% in each tail), and \(n = (z^*\sigma/ME)^2\).

(a)

\[n = \left(\frac{1.645\cdot 20}{4}\right)^2 = (8.225)^2 = 67.65\] \[\Longrightarrow\ n = 68.\]

(b)

\[n = \left(\frac{1.645\cdot 20}{2}\right)^2 = (16.45)^2 = 270.6\] \[\Longrightarrow\ n = 271.\]

(c) The margin of error is proportional to \(1/\sqrt{n}\), so \(n\) is proportional to \(1/ME^2\). Halving \(ME\) multiplies the required sample size by \(2^2 = 4\): statement (ii). The numbers agree, \(271 \approx 4 \times 68\), up to rounding.

(a) \(n = 68\); (b) \(n = 271\); (c) statement (ii), about four times as many

Review: ·

70A cereal maker claims its boxes contain a mean of 500 g. The filling process has a known standard deviation \(\sigma = 40\) g. A consumer group weighs a random sample of 64 boxes and finds \(\bar{x} = 489\) g. Test \(H_0\!: \mu = 500\) against \(H_a\!: \mu \lt 500\). (a) Find the test statistic \(z\). (b) Find the \(p\)-value (to four decimals). (c) At \(\alpha = 0.05\), what is the conclusion? (i) Reject \(H_0\); there is evidence the mean is below 500 g. (ii) Fail to reject \(H_0\); there is no evidence the mean is below 500 g. (iii) Accept \(H_0\); the mean is exactly 500 g. (iv) Reject \(H_0\); the mean is exactly 489 g.

Solution

With \(\sigma\) known and \(n = 64\), use a one-sample \(z\) test. The standard error is \(\sigma/\sqrt{n} = 40/8 = 5\) g.

(a)

\[z = \frac{\bar{x} - \mu_0}{\sigma/\sqrt{n}} = \frac{489 - 500}{5} = -2.2.\]

(b) The alternative is left-tailed, so the \(p\)-value is the area to the left of \(-2.2\):

\[p = P(Z \le -2.2) = \Phi(-2.2) = 0.0139.\]

(c) Since \(p = 0.0139 \lt 0.05\), reject \(H_0\): statement (i). If the boxes really averaged 500 g, a sample mean this low or lower would occur in only about 1.4% of samples of 64, which is strong evidence of underfilling. We never “accept” \(H_0\), and rejecting it does not prove \(\mu = 489\); it only says \(\mu\) is below 500.

(a) \(z = -2.2\); (b) \(p \approx 0.0139\); (c) statement (i), reject \(H_0\)

Review: ·

71A machine is set to fill bottles with 350 ml of juice; the fill volume has standard deviation \(\sigma = 6\) ml. A random sample of 36 bottles has mean \(\bar{x} = 352.5\) ml. Test \(H_0\!: \mu = 350\) against \(H_a\!: \mu \ne 350\). (a) Find the test statistic \(z\). (b) Find the two-sided \(p\)-value (to four decimals). (c) What is the decision at \(\alpha = 0.01\)? (i) Reject \(H_0\): the machine is off target. (ii) Fail to reject \(H_0\): the evidence is not strong enough at the 1% level. (iii) Reject \(H_0\) because \(\bar{x} \ne 350\). (iv) The test cannot be done without \(s\).

Solution

The standard error is \(\sigma/\sqrt{n} = 6/6 = 1\) ml.

(a)

\[z = \frac{352.5 - 350}{1} = 2.5.\]

(b) The alternative is two-sided, so the \(p\)-value counts both tails: a sample mean at least 2.5 standard errors away from 350 in either direction.

\[p = 2\,P(Z \ge 2.5) = 2(1 - 0.9938) = 2(0.0062) = 0.0124.\]

(c) Since \(p = 0.0124 \gt 0.01\), we fail to reject \(H_0\) at \(\alpha = 0.01\): statement (ii). The same data would reject at \(\alpha = 0.05\); the conclusion depends on how much Type I error risk the company accepts. Statement (iii) is wrong because a sample mean never equals the hypothesized value exactly; the question is whether the gap is bigger than chance explains. Statement (iv) is wrong because \(\sigma\) is given, so no sample standard deviation is needed.

(a) \(z = 2.5\); (b) \(p \approx 0.0124\); (c) statement (ii), fail to reject at \(\alpha = 0.01\)

Review: ·

72A running-shoe company claims its new sole lasts more than 10 months on average. In a random sample of 16 runners the soles lasted a mean of \(\bar{x} = 10.9\) months with \(s = 1.6\) months; assume lifetimes are approximately normal. Test \(H_0\!: \mu = 10\) against \(H_a\!: \mu \gt 10\). (a) Find the test statistic \(t\). (b) State the degrees of freedom. (c) Using the \(t\)-table, the \(p\)-value is: (i) greater than 0.10; (ii) between 0.05 and 0.10; (iii) between 0.01 and 0.025; (iv) less than 0.005.

Solution

With \(\sigma\) unknown and a small sample from a roughly normal population, this is a one-sample \(t\) test.

(a) The standard error is \(s/\sqrt{n} = 1.6/\sqrt{16} = 0.4\):

\[t = \frac{\bar{x} - \mu_0}{s/\sqrt{n}} = \frac{10.9 - 10}{0.4} = 2.25.\]

(b) \(df = n - 1 = 15\).

(c) In the \(df = 15\) row of the \(t\)-table, \(t_{0.025,\,15} = 2.131\) and \(t_{0.01,\,15} = 2.602\). Our statistic \(2.25\) sits between them, so the one-tailed \(p\)-value is between 0.01 and 0.025: statement (iii). (Software gives \(p = 0.0199\).) At \(\alpha = 0.05\) we reject \(H_0\): the data support the claim that the soles last more than 10 months on average.

(a) \(t = 2.25\); (b) \(df = 15\); (c) statement (iii): \(0.01 \lt p \lt 0.025\) (software: \(p \approx 0.020\))

Review: ·

73A diet program advertises a mean weight loss of 5 pounds in the first month. The losses (in pounds) of 8 randomly chosen participants were \(3,\ 6,\ 4,\ 7,\ 2,\ 5,\ 6,\ 3\). Test whether the mean loss differs from 5 pounds, \(H_0\!: \mu = 5\) versus \(H_a\!: \mu \ne 5\). (a) Find the sample mean. (b) Find the test statistic \(t\) (to three decimals). (c) At \(\alpha = 0.05\), the conclusion is: (i) reject \(H_0\), the mean loss is not 5 pounds; (ii) fail to reject \(H_0\), the data are consistent with a mean loss of 5 pounds; (iii) reject \(H_0\) because \(\bar{x} \lt 5\); (iv) accept \(H_0\), the mean loss is exactly 5 pounds.

Solution

(a) The losses sum to 36, so \(\bar{x} = 36/8 = 4.5\) pounds.

(b) The deviations from 4.5 are \(-1.5, 1.5, -0.5, 2.5, -2.5, 0.5, 1.5, -1.5\); their squares sum to \(2.25 + 2.25 + 0.25 + 6.25 + 6.25 + 0.25 + 2.25 + 2.25 = 22\).

\[s^2 = \frac{22}{7} = 3.143\] \[s = 1.773\] \[\frac{s}{\sqrt{n}} = \frac{1.773}{\sqrt{8}} = 0.627.\] \[t = \frac{4.5 - 5}{0.627} = -0.798.\]

(c) With \(df = 7\) the two-sided critical value at \(\alpha = 0.05\) is \(t_{0.025,\,7} = 2.365\). Since \(|t| = 0.798 \lt 2.365\), we fail to reject \(H_0\): statement (ii). (Software gives a two-sided \(p\)-value of about 0.45.) The sample mean is below 5, but a gap of half a pound is well within what eight people’s random variation produces. Failing to reject is not the same as accepting; we have simply found no evidence against the advertised figure.

(a) \(\bar{x} = 4.5\); (b) \(t \approx -0.798\); (c) statement (ii), fail to reject

Review: ·

74A university claims that 30% of its students commute from home. In a random sample of 200 students, 72 commute. Test \(H_0\!: p = 0.30\) against \(H_a\!: p \ne 0.30\). (a) Find the test statistic \(z\) (to three decimals). (b) Find the two-sided \(p\)-value (to three decimals). (c) At \(\alpha = 0.05\), is the claim rejected? (i) Yes, \(p \lt 0.05\). (ii) No, \(p \gt 0.05\). (iii) Yes, because 36% is not 30%. (iv) The test is invalid because \(np \lt 10\).

Solution

The sample proportion is \(\hat{p} = 72/200 = 0.36\). Check the conditions with the hypothesized value: \(np_0 = 60\) and \(n(1 - p_0) = 140\) are both at least 10, so the \(z\) test applies.

(a) The standard error under \(H_0\) also uses \(p_0\), not \(\hat{p}\):

\[SE_0 = \sqrt{\frac{p_0(1 - p_0)}{n}} = \sqrt{\frac{0.30(0.70)}{200}} = \sqrt{0.00105} = 0.0324.\] \[z = \frac{\hat{p} - p_0}{SE_0} = \frac{0.36 - 0.30}{0.0324} = 1.852.\]

(b) Two-sided, so double the upper tail:

\[p = 2\,P(Z \ge 1.852) = 2(1 - 0.9680) = 2(0.0320) = 0.064.\]

(c) Since \(0.064 \gt 0.05\), we fail to reject \(H_0\): statement (ii). A 6-point gap in a sample of 200 is suggestive but not statistically significant at the 5% level. (A one-sided test in the direction of the data would have given \(p = 0.032\), a reminder that the alternative must be chosen before looking at the data.)

(a) \(z \approx 1.852\); (b) \(p \approx 0.064\); (c) statement (ii), fail to reject at \(\alpha = 0.05\)

Review: ·

75A supplier guarantees that at most 4% of its circuit boards are defective. An inspector tests a random sample of 250 boards and finds 14 defective. Test \(H_0\!: p = 0.04\) against \(H_a\!: p \gt 0.04\). (a) Find the test statistic \(z\) (to three decimals). (b) Find the \(p\)-value (to three decimals). (c) At \(\alpha = 0.05\): (i) reject \(H_0\), the defect rate exceeds 4%; (ii) fail to reject \(H_0\), the sample does not show the rate exceeds 4%; (iii) reject \(H_0\) since \(5.6\% \gt 4\%\); (iv) accept \(H_0\), the rate is 4%.

Solution

The sample proportion is \(\hat{p} = 14/250 = 0.056\). Under \(H_0\), \(np_0 = 250(0.04) = 10\) and \(n(1-p_0) = 240\), so the normal approximation is (just) acceptable.

(a)

\[SE_0 = \sqrt{\frac{0.04(0.96)}{250}} = \sqrt{0.0001536} = 0.01239\] \[z = \frac{0.056 - 0.04}{0.01239} = 1.291.\]

(b) The alternative is right-tailed:

\[p = P(Z \ge 1.291) = 1 - 0.9017 = 0.098.\]

(c) Since \(0.098 \gt 0.05\), fail to reject \(H_0\): statement (ii). The observed 5.6% is above 4%, but with only 250 boards a rate this high would occur about 10% of the time even if the supplier’s claim were true. Statement (iii) ignores sampling variability, and statement (iv) treats a non-rejection as proof of \(H_0\).

(a) \(z \approx 1.291\); (b) \(p \approx 0.098\); (c) statement (ii), fail to reject

Review: ·

76A study comparing two teaching methods reports “\(t = 2.17\), \(p = 0.031\)” for the difference in mean test scores. (a) Which statement correctly interprets the \(p\)-value? (i) There is a 3.1% chance that the null hypothesis is true. (ii) If the two methods really had the same mean, a difference at least as large as the one observed would occur in about 3.1% of samples. (iii) The new method improves scores by 3.1%. (iv) There is a 96.9% chance the alternative hypothesis is true. (b) Which decision statement is correct? (i) Reject \(H_0\) at \(\alpha = 0.05\) and also at \(\alpha = 0.01\). (ii) Reject \(H_0\) at \(\alpha = 0.05\) but not at \(\alpha = 0.01\). (iii) Fail to reject \(H_0\) at both levels. (iv) Reject at \(\alpha = 0.01\) but not at \(\alpha = 0.05\).

Solution

(a) A \(p\)-value is a conditional probability computed assuming the null hypothesis is true: the probability of getting a test statistic at least as extreme as the one observed. That is statement (ii). It is not the probability that \(H_0\) is true (i), nor the probability that \(H_a\) is true (iv); hypotheses are fixed statements about the population, not random events. Statement (iii) confuses a probability with an effect size.

(b) Reject \(H_0\) whenever \(p \le \alpha\). Here \(0.031 \le 0.05\) but \(0.031 \gt 0.01\), so the result is significant at the 5% level and not at the 1% level: statement (ii). The \(p\)-value is the smallest significance level at which the data would reject \(H_0\); 0.031 lies between the two common levels, which is why the two decisions differ.

(a) statement (ii); (b) statement (ii): significant at 0.05, not at 0.01

Review:

77A clinical trial tests \(H_0\!:\) the new drug has no effect on blood pressure, against \(H_a\!:\) the drug lowers blood pressure. (a) A Type I error here means: (i) concluding the drug works when it actually has no effect; (ii) concluding the drug has no effect when it actually works; (iii) rejecting \(H_a\) when it is true; (iv) using too small a sample. (b) A Type II error here means: (i) concluding the drug works when it actually has no effect; (ii) failing to find an effect when the drug actually works; (iii) choosing \(\alpha\) too large; (iv) a sampling error in measuring blood pressure. (c) If the test has power 0.85 against a particular true effect, what is the probability of a Type II error against that effect?

Solution

The two errors are defined by what is true and what is concluded.

(a) A Type I error is rejecting a true null hypothesis. Here \(H_0\) says the drug does nothing, so a Type I error is declaring the drug effective when it is not: statement (i). Its probability, when \(H_0\) is true, is the significance level \(\alpha\).

(b) A Type II error is failing to reject a false null hypothesis: the drug really lowers blood pressure, but the trial does not detect it, statement (ii). Its probability is called \(\beta\) and depends on the true size of the effect, the sample size and \(\alpha\).

(c) Power is the probability of correctly rejecting a false \(H_0\), so power \(= 1 - \beta\):

\[\beta = 1 - 0.85 = 0.15.\]

In words: against that true effect, 15% of trials of this design would miss it.

(a) statement (i); (b) statement (ii); (c) \(\beta = 1 - 0.85 = 0.15\)

Review:

78A test of \(H_0\!: \mu = 100\) against \(H_a\!: \mu \gt 100\) uses a sample of \(n = 25\) from a population with known \(\sigma = 20\), at \(\alpha = 0.05\). (a) Find the value of \(\bar{x}\) above which \(H_0\) is rejected (to two decimals). (b) If the true mean is actually \(\mu = 110\), find the power of the test (to three decimals). (c) Which change would decrease the power? (i) Increasing the sample size. (ii) Increasing \(\alpha\) to 0.10. (iii) Decreasing the sample size. (iv) A true mean farther from 100.

Solution

The standard error is \(\sigma/\sqrt{n} = 20/5 = 4\).

(a) For a right-tailed test at \(\alpha = 0.05\) we reject when \(z \gt 1.645\), i.e. when

\[\bar{x} \gt 100 + 1.645(4) = 100 + 6.58 = 106.58.\]

(b) Power is the probability of rejecting when the alternative is true. If \(\mu = 110\), then \(\bar{x}\) is normal with mean 110 and standard error 4, so

\[\text{power} = P(\bar{x} \gt 106.58 \mid \mu = 110) = P\!\left(Z \gt \frac{106.58 - 110}{4}\right) = P(Z \gt -0.855) = 0.804.\]

The Type II error probability against this alternative is \(\beta = 1 - 0.804 = 0.196\).

(c) Power rises with a larger sample (smaller standard error), a larger \(\alpha\) (lower rejection cutoff) and a larger true effect. Only a smaller sample makes the test weaker: statement (iii). With \(n = 16\), for instance, the standard error becomes 5, the cutoff 108.22, and the power drops to about 0.64.

(a) reject when \(\bar{x} \gt 106.58\); (b) power \(\approx 0.804\) (\(\beta \approx 0.196\)); (c) statement (iii)

Review: ·

79Two sections of a statistics course took the same final exam. Section A (\(n_1 = 10\)) had mean \(\bar{x}_1 = 78.2\) with \(s_1 = 6.1\); Section B (\(n_2 = 12\)) had mean \(\bar{x}_2 = 72.5\) with \(s_2 = 7.4\). Treat the sections as independent random samples from approximately normal populations and test \(H_0\!: \mu_1 = \mu_2\) against \(H_a\!: \mu_1 \ne \mu_2\) at \(\alpha = 0.05\), using the conservative degrees of freedom (the smaller of \(n_1 - 1\) and \(n_2 - 1\)). (a) Find the standard error of \(\bar{x}_1 - \bar{x}_2\) (to three decimals). (b) Find the test statistic \(t\) (to three decimals). (c) The conclusion is: (i) reject \(H_0\), the section means differ; (ii) fail to reject \(H_0\), the difference is not significant at the 5% level; (iii) reject \(H_0\) because 78.2 is larger than 72.5; (iv) the test cannot be run with unequal sample sizes.

Solution

This is a two-sample \(t\) test for independent samples (unpooled, since nothing says the variances are equal).

(a)

\[SE = \sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}} = \sqrt{\frac{6.1^2}{10} + \frac{7.4^2}{12}} = \sqrt{3.721 + 4.563} = \sqrt{8.284} = 2.878.\]

(b) Under \(H_0\) the hypothesized difference is 0:

\[t = \frac{(\bar{x}_1 - \bar{x}_2) - 0}{SE} = \frac{78.2 - 72.5}{2.878} = \frac{5.7}{2.878} = 1.980.\]

(c) The conservative degrees of freedom are \(\min(9, 11) = 9\), and the two-sided critical value is \(t_{0.025,\,9} = 2.262\). Since \(1.980 \lt 2.262\), fail to reject \(H_0\): statement (ii). (The Welch formula gives \(df \approx 20\) with \(t_{0.025,\,20} = 2.086\), and the conclusion is the same; the two-sided \(p\)-value is about 0.06 to 0.08.) Section A scored higher in the sample, but a 5.7-point gap between groups of this size is within chance variation at the 5% level.

(a) \(SE \approx 2.878\); (b) \(t \approx 1.980\); (c) statement (ii), fail to reject

Review: ·

80Six people had their resting heart rate measured before and after an eight-week exercise program. Before: \(82,\ 75,\ 90,\ 68,\ 77,\ 85\). After: \(78,\ 74,\ 85,\ 66,\ 76,\ 80\). Let \(d = \text{before} - \text{after}\) and test \(H_0\!: \mu_d = 0\) against \(H_a\!: \mu_d \gt 0\) at \(\alpha = 0.05\). (a) Find the mean difference \(\bar{d}\). (b) Find the test statistic \(t\) (to three decimals). (c) The conclusion is: (i) reject \(H_0\), the program lowers resting heart rate on average; (ii) fail to reject \(H_0\); (iii) reject \(H_0\) using the two-sample \(t\) test; (iv) no conclusion is possible with \(n = 6\).

Solution

The same six people are measured twice, so the data are paired: work with the differences, not with the two columns separately.

(a) The differences are \(4,\ 1,\ 5,\ 2,\ 1,\ 5\), summing to 18:

\[\bar{d} = \frac{18}{6} = 3 \text{ beats per minute}.\]

(b) Deviations from 3 are \(1, -2, 2, -1, -2, 2\); squares sum to \(1 + 4 + 4 + 1 + 4 + 4 = 18\):

\[s_d^2 = \frac{18}{5} = 3.6\] \[s_d = 1.897\] \[\frac{s_d}{\sqrt{n}} = \frac{1.897}{\sqrt{6}} = 0.775.\] \[t = \frac{\bar{d} - 0}{s_d/\sqrt{n}} = \frac{3}{0.775} = 3.873.\]

(c) With \(df = 5\) the one-tailed critical value is \(t_{0.05,\,5} = 2.015\). Since \(3.873 \gt 2.015\), reject \(H_0\): statement (i). (The one-sided \(p\)-value is about 0.006.) Every participant’s rate dropped, and the differences are consistent, which is why six people suffice. A two-sample test would ignore the pairing and bury this signal under person-to-person variation.

(a) \(\bar{d} = 3\); (b) \(t \approx 3.873\); (c) statement (i), reject \(H_0\)

Review: ·

81Two brands of running shoe were tested for durability. Brand X: \(n_1 = 15\), \(\bar{x}_1 = 52.0\) hours of use before failure, \(s_1 = 8.0\). Brand Y: \(n_2 = 15\), \(\bar{x}_2 = 46.0\), \(s_2 = 6.0\). Assume independent random samples from approximately normal populations and use the conservative \(df = 14\). (a) Find the standard error of \(\bar{x}_1 - \bar{x}_2\) (to three decimals). (b) Find the lower endpoint of a 95% confidence interval for \(\mu_1 - \mu_2\) (to three decimals). (c) Find the upper endpoint.

Solution

(a) For independent samples the variances add:

\[SE = \sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}} = \sqrt{\frac{64}{15} + \frac{36}{15}} = \sqrt{\frac{100}{15}} = \sqrt{6.667} = 2.582.\]

(b), (c) The point estimate is \(\bar{x}_1 - \bar{x}_2 = 6.0\) hours. With the conservative \(df = \min(14, 14) = 14\), the 95% critical value is \(t_{0.025,\,14} = 2.145\):

\[ME = 2.145(2.582) = 5.538\] \[6.0 \pm 5.538 = (0.462,\ 11.538).\]

We are 95% confident that Brand X lasts between about 0.5 and 11.5 hours longer on average than Brand Y. Because the whole interval is above 0, a two-sided test of \(\mu_1 = \mu_2\) at \(\alpha = 0.05\) would reject; but the lower end is close to 0, so the advantage could be small.

(a) \(SE \approx 2.582\); (b) and (c) \((0.462,\ 11.538)\) hours

Review: ·

82A 95% confidence interval for the mean delivery time of an online retailer is \((18.4,\ 23.6)\) hours. (a) What sample mean produced this interval? (b) A 99% confidence interval computed from the same data would be: (i) wider than this one; (ii) narrower than this one; (iii) the same width; (iv) centred at a different value. (c) Using only the interval, which null hypothesis would be rejected by a two-sided test at \(\alpha = 0.05\)? (i) \(H_0\!: \mu = 20\). (ii) \(H_0\!: \mu = 22\). (iii) \(H_0\!: \mu = 24\). (iv) \(H_0\!: \mu = 19\).

Solution

(a) The interval is centred at the sample mean:

\[\bar{x} = \frac{18.4 + 23.6}{2} = 21.0 \text{ hours}.\]

(Its half-width, the margin of error, is \((23.6 - 18.4)/2 = 2.6\) hours.)

(b) The margin of error is (critical value) \(\times\) (standard error). Raising the confidence level from 95% to 99% raises the critical value (for \(z\), from 1.960 to 2.576; for \(t\), by a similar amount) while the standard error and the centre \(\bar{x}\) stay the same, so the 99% interval is wider: statement (i). To be more confident of capturing \(\mu\), you must cast a wider net.

(c) A 95% confidence interval and a two-sided test at \(\alpha = 0.05\) agree: the interval is exactly the set of null values that would not be rejected. The values 20, 22 and 19 all lie inside \((18.4, 23.6)\), so none of those hypotheses is rejected. The value 24 lies outside, so \(H_0\!: \mu = 24\) is rejected: statement (iii).

(a) \(\bar{x} = 21.0\); (b) statement (i), wider; (c) statement (iii), \(\mu = 24\) is outside the interval

Review: ·

83In a study of two web-page designs, 60 of 200 visitors to design A made a purchase, compared with 40 of 200 visitors to design B. Test \(H_0\!: p_A = p_B\) against \(H_a\!: p_A \ne p_B\). (a) Find the pooled sample proportion. (b) Find the test statistic \(z\) (to three decimals). (c) Find the two-sided \(p\)-value (to three decimals).

Solution

The sample proportions are \(\hat{p}_A = 60/200 = 0.30\) and \(\hat{p}_B = 40/200 = 0.20\).

(a) Under \(H_0\) the two groups share one proportion, estimated by pooling all successes over all trials:

\[\hat{p} = \frac{60 + 40}{200 + 200} = \frac{100}{400} = 0.25.\]

(b) The standard error under \(H_0\) uses the pooled value:

\[SE_0 = \sqrt{\hat{p}(1 - \hat{p})\left(\frac{1}{n_A} + \frac{1}{n_B}\right)} = \sqrt{0.25(0.75)\left(\frac{1}{200} + \frac{1}{200}\right)} = \sqrt{0.001875} = 0.0433.\] \[z = \frac{\hat{p}_A - \hat{p}_B}{SE_0} = \frac{0.30 - 0.20}{0.0433} = 2.309.\]

(c) Two-sided:

\[p = 2\,P(Z \ge 2.309) = 2(1 - 0.9895) = 2(0.0105) = 0.021.\]

At \(\alpha = 0.05\) we reject \(H_0\): the purchase rates differ, and design A appears to convert better. All four counts of successes and failures (60, 140, 40, 160) exceed 10, so the normal approximation is sound.

(a) \(\hat{p} = 0.25\); (b) \(z \approx 2.309\); (c) \(p \approx 0.021\), reject at \(\alpha = 0.05\)

Review: ·

84A random sample of 25 light bulbs has sample standard deviation \(s = 10\) hours; the population standard deviation is unknown and lifetimes are approximately normal. (a) What critical value is used for a 99% confidence interval for the mean lifetime? (b) Find the margin of error (to three decimals). (c) Why is the \(t\)-distribution used rather than \(z\)? (i) Because the sample is random. (ii) Because \(\sigma\) is unknown and is estimated by \(s\). (iii) Because 99% confidence always requires \(t\). (iv) Because the population is normal.

Solution

(a) With \(\sigma\) unknown we use \(t\) with \(df = n - 1 = 24\). For 99% confidence, 0.5% is in each tail, so the critical value is

\[t_{0.005,\,24} = 2.797.\]

(The corresponding \(z\) value would be 2.576; the \(t\) value is larger to account for the extra uncertainty in \(s\).)

(b)

\[ME = t^*\,\frac{s}{\sqrt{n}} = 2.797\cdot\frac{10}{\sqrt{25}} = 2.797(2) = 5.594 \text{ hours}.\]

(c) Statement (ii). The \(z\) procedure needs the population standard deviation; when \(\sigma\) is replaced by the sample estimate \(s\), the standardized statistic \((\bar{x} - \mu)/(s/\sqrt{n})\) follows a \(t\)-distribution, whose heavier tails reflect that \(s\) varies from sample to sample. Normality of the population (iv) is what makes the \(t\) procedure valid for a small sample, but it is not the reason \(t\) replaces \(z\).

(a) \(t_{0.005,24} = 2.797\); (b) \(ME = 5.594\) hours; (c) statement (ii)

Review: ·

85A one-sample \(z\) test produces the statistic \(z = 1.75\). (a) Find the \(p\)-value if the alternative is two-sided, \(H_a\!: \mu \ne \mu_0\) (to four decimals). (b) Find the \(p\)-value if the alternative is \(H_a\!: \mu \gt \mu_0\) (to four decimals). (c) At \(\alpha = 0.05\), which statement is correct? (i) Both tests reject \(H_0\). (ii) Neither test rejects \(H_0\). (iii) The one-sided test rejects but the two-sided test does not. (iv) The two-sided test rejects but the one-sided test does not.

Solution

From the standard normal table, \(P(Z \ge 1.75) = 1 - \Phi(1.75) = 1 - 0.9599 = 0.0401\).

(a) A two-sided alternative counts values at least as extreme in either direction, so the \(p\)-value is both tails:

\[p = 2\,P(Z \ge 1.75) = 2(0.0401) = 0.0801.\]

(b) A right-tailed alternative uses only the upper tail:

\[p = P(Z \ge 1.75) = 0.0401.\]

(c) Compare with \(\alpha = 0.05\): the one-sided \(p\)-value \(0.0401\) is below 0.05, so that test rejects, while the two-sided \(p\)-value \(0.0801\) is above, so that test does not: statement (iii). The same data can be “significant” or not depending on the alternative, which is why the alternative must be fixed before the data are seen.

(a) \(p \approx 0.0801\); (b) \(p \approx 0.0401\); (c) statement (iii)

Review: ·

Set 5: chi-square, ANOVA, correlation and regression

Statistics · Practice problems 86 to 100

Problems 86 to 100

One hundred introductory statistics problems: descriptive statistics, probability and distributions, sampling distributions, confidence intervals and hypothesis tests, and chi-square, ANOVA and regression. Each opens to a full worked solution with the answer highlighted; critical values used are quoted in the solution.

86A die is rolled 120 times and the faces 1 through 6 come up \(15,\ 22,\ 18,\ 25,\ 20,\ 20\) times. Test whether the die is fair. (a) Find the chi-square goodness-of-fit statistic. (b) State the degrees of freedom. (c) At \(\alpha = 0.05\), the conclusion is: (i) reject \(H_0\), the die is not fair; (ii) fail to reject \(H_0\), the counts are consistent with a fair die; (iii) reject \(H_0\) because the counts are not all equal; (iv) the test is invalid because some expected counts are below 5.

Solution

If the die is fair each face has probability \(1/6\), so every expected count is \(E = 120/6 = 20\). All expected counts are at least 5, so the chi-square test is appropriate.

(a)

\[\chi^2 = \sum\frac{(O - E)^2}{E} = \frac{(15-20)^2 + (22-20)^2 + (18-20)^2 + (25-20)^2 + (20-20)^2 + (20-20)^2}{20}\] \[= \frac{25 + 4 + 4 + 25 + 0 + 0}{20} = \frac{58}{20} = 2.9.\]

(b) A goodness-of-fit test with \(k\) categories has \(df = k - 1 = 6 - 1 = 5\).

(c) The critical value is \(\chi^2_{0.05,\,5} = 11.070\). Since \(2.9 \lt 11.070\) (the \(p\)-value is about 0.72), fail to reject \(H_0\): statement (ii). Observed counts never match expected counts exactly; a statistic of 2.9 on 5 degrees of freedom is exactly the size of discrepancy chance produces with a fair die.

(a) \(\chi^2 = 2.9\); (b) \(df = 5\); (c) statement (ii), fail to reject

Review: ·

87A candy maker claims its bags contain 50% red, 30% blue and 20% green pieces. A random sample of 200 pieces contains 88 red, 70 blue and 42 green. (a) Find the expected number of blue pieces under the claim. (b) Find the chi-square statistic (to three decimals). (c) At \(\alpha = 0.05\), the conclusion is: (i) reject the claim; (ii) fail to reject the claim; (iii) reject because 88 is not 100; (iv) the test needs equal expected counts.

Solution

(a) Expected counts are the claimed proportions times \(n = 200\):

\[E_{\text{red}} = 0.50(200) = 100\] \[E_{\text{blue}} = 0.30(200) = 60\] \[E_{\text{green}} = 0.20(200) = 40.\]

(b)

\[\chi^2 = \frac{(88 - 100)^2}{100} + \frac{(70 - 60)^2}{60} + \frac{(42 - 40)^2}{40} = \frac{144}{100} + \frac{100}{60} + \frac{4}{40} = 1.44 + 1.667 + 0.1\] \[= 3.207.\]

(c) With \(k = 3\) categories, \(df = 2\) and the critical value is \(\chi^2_{0.05,\,2} = 5.991\). Since \(3.207 \lt 5.991\) (the \(p\)-value is about 0.20), fail to reject: statement (ii). The counts are reasonably consistent with the claimed mix. Statement (iv) is a misconception: the expected counts can be unequal; they only need to be at least 5 each.

(a) 60; (b) \(\chi^2 \approx 3.207\); (c) statement (ii), fail to reject

Review: ·

88A survey asked 100 people whether they prefer tea or coffee. Of 50 men, 30 preferred coffee and 20 preferred tea; of 50 women, 20 preferred coffee and 30 preferred tea. Test whether drink preference is independent of gender. (a) Find the chi-square statistic. (b) State the degrees of freedom. (c) At \(\alpha = 0.05\), the conclusion is: (i) reject \(H_0\), preference and gender are associated; (ii) fail to reject \(H_0\); (iii) reject \(H_0\) at \(\alpha = 0.01\) as well; (iv) the test cannot be used on a \(2\times 2\) table.

Solution

Arrange the counts in a two-way table. Row totals are 50 and 50, column totals are 50 (coffee) and 50 (tea), and \(n = 100\).

Each expected count is (row total)(column total)/\(n\):

\[E = \frac{50\cdot 50}{100} = 25 \quad\text{in every cell}.\]

(a) Every observed count differs from 25 by exactly 5:

\[\chi^2 = \sum\frac{(O - E)^2}{E} = 4\cdot\frac{5^2}{25} = 4(1) = 4.0.\]

(b) For a test of independence, \(df = (r - 1)(c - 1) = (2 - 1)(2 - 1) = 1\).

(c) The critical value is \(\chi^2_{0.05,\,1} = 3.841\). Since \(4.0 \gt 3.841\) (the \(p\)-value is about 0.046), reject \(H_0\) at the 5% level: statement (i). The evidence is modest: at \(\alpha = 0.01\) the critical value is 6.635 and we would not reject, so statement (iii) is wrong.

(a) \(\chi^2 = 4.0\); (b) \(df = 1\); (c) statement (i), reject at \(\alpha = 0.05\)

Review: ·

89A random sample of 200 adults was classified by age group and preferred news source. Under 30: TV 20, online 50, print 10. Age 30 and over: TV 40, online 40, print 40. (a) Find the expected count for “under 30, online” if age and news source are independent. (b) Find the chi-square statistic (to two decimals). (c) State the degrees of freedom.

Solution

Row totals: under 30 has \(20 + 50 + 10 = 80\); 30 and over has \(40 + 40 + 40 = 120\). Column totals: TV 60, online 90, print 50. Grand total \(n = 200\).

(a)

\[E_{\text{under 30, online}} = \frac{(80)(90)}{200} = 36.\]

The full table of expected counts is: under 30: \(24,\ 36,\ 20\); 30 and over: \(36,\ 54,\ 30\). Each row of expected counts is the column totals scaled by the row’s share (40% and 60%).

(b)

\[\chi^2 = \frac{(20-24)^2}{24} + \frac{(50-36)^2}{36} + \frac{(10-20)^2}{20} + \frac{(40-36)^2}{36} + \frac{(40-54)^2}{54} + \frac{(40-30)^2}{30}\] \[= 0.667 + 5.444 + 5.000 + 0.444 + 3.630 + 3.333 = 18.52.\]

(c) \(df = (r - 1)(c - 1) = (2 - 1)(3 - 1) = 2\). The critical value \(\chi^2_{0.01,\,2} = 9.210\) is far below 18.52 (the \(p\)-value is below 0.001), so age group and news source are strongly associated: younger adults lean online and away from print.

(a) 36; (b) \(\chi^2 \approx 18.52\); (c) \(df = 2\) (reject independence, \(p \lt 0.001\))

Review: ·

90Three fertilizers were each applied to 5 plots, and the yields (bushels) were summarized as: fertilizer A mean 10, \(s = 2\); B mean 12, \(s = 3\); C mean 17, \(s = 2.5\). Use one-way ANOVA to test whether the mean yields are equal. (a) Find the mean square between groups, \(MSB\). (b) Find the mean square within groups, \(MSW\) (to three decimals). (c) Find the \(F\) statistic (to two decimals).

Solution

With \(k = 3\) groups of \(n = 5\), the total sample size is \(N = 15\) and the grand mean is \((10 + 12 + 17)/3 = 13\) (equal group sizes let us average the means).

(a) The between-groups sum of squares weights each squared gap from the grand mean by the group size:

\[SSB = 5\big[(10 - 13)^2 + (12 - 13)^2 + (17 - 13)^2\big] = 5(9 + 1 + 16) = 130\] \[MSB = \frac{SSB}{k - 1} = \frac{130}{2} = 65.\]

(b) The within-groups sum of squares adds each group’s \((n_i - 1)s_i^2\):

\[SSW = 4(2^2) + 4(3^2) + 4(2.5^2) = 4(4 + 9 + 6.25) = 77\] \[MSW = \frac{SSW}{N - k} = \frac{77}{12} = 6.417.\]

(c)

\[F = \frac{MSB}{MSW} = \frac{65}{6.417} = 10.13.\]

With \(df = (2, 12)\) the critical value is \(F_{0.05}(2, 12) = 3.885\), and even \(F_{0.01}(2, 12) = 6.927\) is exceeded (the \(p\)-value is about 0.003). Reject \(H_0\): at least one fertilizer has a different mean yield. The spread between group means is about ten times what the spread within groups predicts.

(a) \(MSB = 65\); (b) \(MSW \approx 6.417\); (c) \(F \approx 10.13\), reject \(H_0\) (\(F_{0.05}(2,12) = 3.885\))

Review: ·

91A one-way ANOVA compares the mean reaction times of \(k = 4\) age groups with 6 people in each group (\(N = 24\)). The total sum of squares is \(SST = 480\) and the within-groups sum of squares is \(SSW = 300\). (a) Find the between-groups sum of squares \(SSB\). (b) Find the \(F\) statistic. (c) At \(\alpha = 0.05\), which conclusion is correct? (i) All four group means are different. (ii) At least one group mean differs from the others. (iii) The group means are all equal. (iv) The first group differs from the fourth.

Solution

(a) The total variation splits into between and within parts, \(SST = SSB + SSW\):

\[SSB = 480 - 300 = 180.\]

(b) Divide each sum of squares by its degrees of freedom, \(k - 1 = 3\) and \(N - k = 20\):

\[MSB = \frac{180}{3} = 60\] \[MSW = \frac{300}{20} = 15\] \[F = \frac{MSB}{MSW} = \frac{60}{15} = 4.0.\]

(c) The critical value is \(F_{0.05}(3, 20) = 3.098\). Since \(4.0 \gt 3.098\) (the \(p\)-value is about 0.022), reject \(H_0\!: \mu_1 = \mu_2 = \mu_3 = \mu_4\). The ANOVA \(F\) test only says the means are not all equal: statement (ii). It does not say every pair differs (i), and it does not identify which groups differ (iv); that needs a follow-up such as Tukey’s comparisons.

(a) \(SSB = 180\); (b) \(F = 4.0\); (c) statement (ii)

Review: ·

92Five students recorded the hours they studied for a quiz and their scores: hours \(x = 1, 2, 3, 4, 5\) and scores \(y = 60, 65, 75, 70, 85\). (a) Find the sum of cross-products \(S_{xy} = \sum (x - \bar{x})(y - \bar{y})\). (b) Find the correlation coefficient \(r\) (to three decimals).

Solution

The means are \(\bar{x} = 15/5 = 3\) and \(\bar{y} = 355/5 = 71\). Tabulate the deviations: \(x - \bar{x} = -2, -1, 0, 1, 2\) and \(y - \bar{y} = -11, -6, 4, -1, 14\).

(a)

\[S_{xy} = (-2)(-11) + (-1)(-6) + (0)(4) + (1)(-1) + (2)(14) = 22 + 6 + 0 - 1 + 28 = 55.\]

(b) The sums of squares are

\[S_{xx} = 4 + 1 + 0 + 1 + 4 = 10\] \[S_{yy} = 121 + 36 + 16 + 1 + 196 = 370.\] \[r = \frac{S_{xy}}{\sqrt{S_{xx}S_{yy}}} = \frac{55}{\sqrt{10\cdot 370}} = \frac{55}{\sqrt{3700}} = \frac{55}{60.83} = 0.904.\]

A strong positive linear association: more study hours went with higher scores. Note that \(r\) has no units and would be unchanged if the scores were rescaled to percentages or the hours converted to minutes.

(a) \(S_{xy} = 55\); (b) \(r = 55/\sqrt{3700} \approx 0.904\)

Review: ·

93For the five students with study hours \(x = 1, 2, 3, 4, 5\) and quiz scores \(y = 60, 65, 75, 70, 85\), find the least-squares regression line \(\hat{y} = a + bx\). (a) Find the slope \(b\). (b) Find the intercept \(a\). (c) Use the line to predict the score of a student who studies 2.5 hours.

Solution

From the deviations (\(\bar{x} = 3\), \(\bar{y} = 71\)) the sums are \(S_{xy} = 55\) and \(S_{xx} = 10\).

(a) The least-squares slope is

\[b = \frac{S_{xy}}{S_{xx}} = \frac{55}{10} = 5.5 \text{ points per hour}.\]

(b) The line passes through \((\bar{x}, \bar{y})\), which fixes the intercept:

\[a = \bar{y} - b\bar{x} = 71 - 5.5(3) = 71 - 16.5 = 54.5.\]

So \(\hat{y} = 54.5 + 5.5x\). Each extra hour of study is associated with about 5.5 more points; the intercept 54.5 is the predicted score with no studying, which here is a plausible value just inside the data range.

(c)

\[\hat{y} = 54.5 + 5.5(2.5) = 54.5 + 13.75 = 68.25.\]

This is interpolation (2.5 lies within 1 to 5), so the prediction is trustworthy in a way that, say, predicting for 12 hours would not be.

(a) \(b = 5.5\); (b) \(a = 54.5\), so \(\hat{y} = 54.5 + 5.5x\); (c) \(\hat{y}(2.5) = 68.25\)

Review: ·

94A regression of daily ice-cream sales \(y\) (in dozens) on afternoon temperature \(x\) (in \(^\circ\)C) gives \(\hat{y} = 12.4 + 2.3x\). On a day with temperature \(20^\circ\)C the shop sold 55 dozen. (a) Find the predicted sales for that day. (b) Find the residual. (c) What does the sign of the residual tell you? (i) The line overpredicted sales for that day. (ii) The line underpredicted sales for that day. (iii) The slope is wrong. (iv) The correlation is negative.

Solution

(a) Substitute \(x = 20\) into the line:

\[\hat{y} = 12.4 + 2.3(20) = 12.4 + 46 = 58.4 \text{ dozen}.\]

(b) A residual is observed minus predicted, in that order:

\[e = y - \hat{y} = 55 - 58.4 = -3.4 \text{ dozen}.\]

(c) A negative residual means the actual value sits below the line: the line predicted 58.4 but only 55 were sold, so the model overpredicted that day, statement (i). Residuals are the scatter around the line, not evidence that the line is wrong; what matters is that they show no pattern when plotted against \(x\).

(a) \(\hat{y} = 58.4\); (b) residual \(= -3.4\); (c) statement (i), the line overpredicted

Review: ·

95A least-squares regression of a car’s fuel economy \(y\) on its weight \(x\) has total sum of squares \(SST = 250\) and residual (error) sum of squares \(SSE = 90\); the slope is negative. (a) Find \(r^2\). (b) Find the correlation coefficient \(r\). (c) Which statement correctly interprets \(r^2\)? (i) 64% of cars have fuel economy predicted exactly by the line. (ii) 64% of the variation in fuel economy is explained by the linear relationship with weight. (iii) Fuel economy drops 64% for each extra unit of weight. (iv) The line is correct 64% of the time.

Solution

(a) \(r^2\) is the fraction of the total variation in \(y\) that the regression accounts for:

\[r^2 = \frac{SST - SSE}{SST} = \frac{250 - 90}{250} = \frac{160}{250} = 0.64.\]

(b) \(r = \pm\sqrt{0.64} = \pm 0.8\). The sign of \(r\) always matches the sign of the slope, and the slope is negative (heavier cars get fewer miles per gallon), so

\[r = -0.8.\]

(c) Statement (ii). The regression reduces the unexplained variation from \(SST = 250\) to \(SSE = 90\), a 64% reduction; the remaining 36% is scatter around the line that weight alone does not explain. Statements (i), (iii) and (iv) each read \(r^2\) as something it is not: a count of cars, a slope, or an accuracy rate.

(a) \(r^2 = 0.64\); (b) \(r = -0.8\); (c) statement (ii)

Review: ·

96A company models monthly sales \(y\) (in thousands of dollars) against advertising spending \(x\) (in thousands of dollars) and obtains \(\hat{y} = 3.2 + 0.45x\). (a) Which is the correct interpretation of the slope? (i) Sales are $0.45 thousand when nothing is spent on advertising. (ii) Each additional $1,000 of advertising is associated with about $450 more in predicted monthly sales. (iii) 45% of sales come from advertising. (iv) Sales increase by $1,000 for every $450 of advertising. (b) Predict sales when $10,000 is spent on advertising. (c) By how much does predicted sales change (in thousands of dollars) if advertising rises by $4,000?

Solution

(a) The slope is the change in predicted \(y\) per one-unit change in \(x\). Here one unit of \(x\) is $1,000 of advertising and one unit of \(y\) is $1,000 of sales, so a slope of 0.45 means each extra $1,000 of advertising goes with \(0.45 \times \$1{,}000 = \$450\) more predicted sales: statement (ii). Statement (i) describes the intercept (and gets its value wrong); (iii) and (iv) misread the number.

(b) $10,000 is \(x = 10\):

\[\hat{y} = 3.2 + 0.45(10) = 3.2 + 4.5 = 7.7,\quad\text{that is, about } \$7{,}700.\]

(c) Only the slope matters for a change: a rise of 4 units in \(x\) changes \(\hat{y}\) by

\[0.45 \times 4 = 1.8 \text{ (thousand dollars)},\quad\text{about } \$1{,}800.\]

The intercept cancels when two predictions are subtracted, so it plays no role in part (c).

(a) statement (ii); (b) \(\hat{y} = 7.7\) (about $7,700); (c) \(0.45(4) = 1.8\) (about $1,800)

Review: ·

97For a data set of 40 houses, the size \(x\) (hundreds of square feet) has mean \(\bar{x} = 20\) and standard deviation \(s_x = 4\); the price \(y\) (thousands of dollars) has mean \(\bar{y} = 50\) and standard deviation \(s_y = 10\); the correlation is \(r = 0.6\). (a) Find the slope of the least-squares line for predicting price from size. (b) Find the intercept. (c) Predict the price of a house of 2,400 square feet.

Solution

The least-squares line can be built from the summary statistics alone.

(a) The slope is the correlation scaled by the ratio of standard deviations:

\[b = r\,\frac{s_y}{s_x} = 0.6\cdot\frac{10}{4} = 1.5 \text{ (thousand dollars per hundred square feet)}.\]

(b) The line passes through \((\bar{x}, \bar{y}) = (20, 50)\):

\[a = \bar{y} - b\bar{x} = 50 - 1.5(20) = 20.\]

So \(\hat{y} = 20 + 1.5x\).

(c) A house of 2,400 square feet has \(x = 24\):

\[\hat{y} = 20 + 1.5(24) = 20 + 36 = 56,\quad\text{about } \$56{,}000.\]

Notice the regression effect: this house is one standard deviation above the mean size, but its predicted price is only \(r = 0.6\) standard deviations above the mean price (\(50 + 0.6(10) = 56\)).

(a) \(b = 1.5\); (b) \(a = 20\), so \(\hat{y} = 20 + 1.5x\); (c) \(\hat{y}(24) = 56\), about $56,000

Review: ·

98A regression of exam score on hours of sleep, based on \(n = 12\) students, gives an estimated slope \(b = 2.5\) with standard error \(SE_b = 0.8\). (a) Find the \(t\) statistic for testing \(H_0\!: \beta = 0\) against \(H_a\!: \beta \ne 0\). (b) Find the lower endpoint of a 95% confidence interval for the slope \(\beta\) (to three decimals). (c) Find the upper endpoint.

Solution

Inference for the slope uses \(t\) with \(df = n - 2 = 10\) (two parameters, slope and intercept, are estimated).

(a)

\[t = \frac{b - 0}{SE_b} = \frac{2.5}{0.8} = 3.125.\]

The two-sided critical value is \(t_{0.025,\,10} = 2.228\); since \(3.125 \gt 2.228\) (the \(p\)-value is about 0.011), reject \(H_0\): there is a significant linear relationship between sleep and exam score.

(b), (c) The confidence interval uses the same critical value:

\[b \pm t^*\,SE_b = 2.5 \pm 2.228(0.8) = 2.5 \pm 1.782\] \[(0.718,\ 4.282).\]

We are 95% confident that each extra hour of sleep is associated with between about 0.7 and 4.3 more points. The interval excludes 0, which agrees with the test in part (a).

(a) \(t = 3.125\); (b) and (c) \((0.718,\ 4.282)\)

Review: ·

99Across the twelve months of a year, a city’s monthly ice-cream sales and its monthly number of drownings have correlation \(r = 0.92\). (a) Which conclusion is justified? (i) Eating ice cream causes drowning. (ii) Banning ice cream would reduce drownings. (iii) The two variables are strongly associated, probably because both rise with warm weather; correlation does not establish causation. (iv) The correlation must be a calculation error. (b) If sales were recorded in litres instead of gallons, the correlation would: (i) increase; (ii) decrease; (iii) stay exactly the same; (iv) change sign. (c) Find \(r^2\).

Solution

(a) Statement (iii). A correlation measures how tightly two variables move together; it says nothing about why. Here a lurking variable, temperature, drives both: hot months bring more ice-cream sales and more swimming, and therefore more drownings. Statements (i) and (ii) assert causation from an observational association, and (iv) dismisses a perfectly real (if non-causal) correlation.

(b) Statement (iii). The correlation is built from standardized values, \(r = \frac{1}{n-1}\sum z_x z_y\), and a \(z\)-score is unchanged by multiplying every value by a positive constant (such as the litres-per-gallon factor). So \(r\) has no units and is unaffected by a change of scale.

(c)

\[r^2 = 0.92^2 = 0.8464.\]

About 85% of the month-to-month variation in drownings is “explained” by the linear relationship with ice-cream sales, in the statistical sense of shared variation, not in any causal sense.

(a) statement (iii); (b) statement (iii), unchanged; (c) \(r^2 = 0.8464\)

Review: ·

100For each situation choose the most appropriate procedure from this list: (i) one-sample \(t\) test for a mean; (ii) paired \(t\) test; (iii) two-sample \(t\) test; (iv) one-proportion \(z\) test; (v) chi-square goodness-of-fit test; (vi) chi-square test of independence; (vii) one-way ANOVA. (a) Twenty patients have their cholesterol measured before and after a six-week diet, and the researcher asks whether the diet lowers cholesterol on average. (b) A random sample of 500 adults is classified by eye colour and by whether they are left- or right-handed, to see whether the two traits are related. (c) Four brands of fertilizer are each applied to eight plots, and the mean yields of the four brands are compared.

Solution

Choosing a test comes down to three questions: what kind of variable is measured (quantitative or categorical), how many groups there are, and whether the groups are independent or paired.

(a) Cholesterol is quantitative, and each patient supplies two linked measurements, before and after. Working with each patient’s difference removes patient-to-patient variation, so this is a paired \(t\) test: (ii). A two-sample \(t\) test would wrongly treat the before and after groups as independent.

(b) Both eye colour and handedness are categorical, and the question is whether they are associated in one population. The data form a two-way table of counts, so this is a chi-square test of independence: (vi). (Goodness-of-fit tests one categorical variable against a claimed distribution; that is not the question here.)

(c) Yield is quantitative and there are four independent groups. Comparing more than two means in a single test is one-way ANOVA: (vii). Running six separate two-sample \(t\) tests would inflate the overall Type I error rate.

(a) paired \(t\) test (ii); (b) chi-square test of independence (vi); (c) one-way ANOVA (vii)

Review: ·