SN1 2-5,6. The normal distribution-1,7. Central Limit Theorem-1
Table of contents
- Discrete Probability Distribution
- The Normal Distribution
- Central Limit Theorem
- Confidence Intervals
- Hypothesis Testing
- Inferences for Proportions
- The Student t-Distribution
- Chi-Square Tests
1. Discrete Probability Distribution
1.1 Random variables
A random variable is a variable whose values describe the outcome of an experiment. Random variables can be classified as either discrete or continuous 4 5.
| Type of Random Variable | Description |
|---|---|
| Discrete random variable | Can take on a list of values that are countable or finite in size. |
| Continuous random variable | Can take on any value over an interval. |
📝 If a coin is tossed three times, the number of heads (X) is a discrete random variable, taking values from {0, 1, 2, 3}. The weight of a randomly selected adult cow is a continuous random variable, as it can be any value within a range 4 5.
1.2 Probability distribution for a discrete RV
A discrete probability distribution is a function or table that assigns a probability, P(x), to each value of a discrete random variable x. For a function to be a valid discrete probability distribution, it must satisfy two conditions:
- Non-negativity: The probability of each value of x must be greater than or equal to 0, meaning P(x)≥0 for all x.
- Summation to one: The sum of all probabilities for all possible values of x must equal 1, meaning ∑all xP(x)=1 7.
| x (Number of Heads) | P(x) |
|---|---|
| 0 | 1/8 |
| 1 | 3/8 |
| 2 | 3/8 |
| 3 | 1/8 |
| Total | 1 |
📝 For three coin tosses, where x is the number of heads, the sample space is {TTT, TTH, THT, HTT, THH, HTH, HHT, HHH}. The probability of getting 0 heads, P(x=0), is 1/8 (TTT). The sum of all probabilities is 1/8+3/8+3/8+1/8=8/8=1 8.
1.3 Expected value
The expected value of a discrete random variable x, denoted as E(x) or μ, represents the mean of its probability distribution. It is calculated as a weighted average where each x value is multiplied by its corresponding probability, and these products are then summed. μ=E(x)=∑all xx⋅P(x) The expected value is the long-run average outcome of an experiment, even if it is not a possible outcome itself.
📝 For the number of heads in three coin tosses, the expected value is E(x)=0(1/8)+1(3/8)+2(3/8)+3(1/8)=1.5. This means that over many sets of three coin tosses, the average number of heads would be 1.5, even though you cannot get exactly 1.5 heads in a single experiment 13.
1.4 Variance and standard deviation
Variance (σ2) and standard deviation (σ) measure the spread or dispersion of a discrete probability distribution.
- Variance: It is computed by multiplying each possible value of (x−μ)2 by its probability, and then summing these products. σ2=E(x−μ)2=∑all x(x−μ)2P(x)
- Standard deviation: This is the square root of the variance 16. σ=σ2=∑(x−μ)2P(x) A computational formula for variance can sometimes be easier to use: σ2=∑x2P(x)−μ2 18.
📝 For the number of heads in three coin tosses, with an expected value μ=1.5, the variance is calculated as σ2=(0−1.5)2(1/8)+(1−1.5)2(3/8)+(2−1.5)2(3/8)+(3−1.5)2(1/8)=0.75. The standard deviation is 0.75≈0.866 heads 17.
1.5 The binomial distribution
A binomial experiment models repeated trials with only two outcomes and constant odds. It has specific characteristics:
- Identical and independent trials: The experiment consists of n trials that are identical and do not influence each other.
- Two outcomes: Each trial results in one of two possible outcomes, typically labeled "success" or "failure".
- Constant probability of success: The probability of success, denoted as p, remains the same for every trial.
- Constant probability of failure: The probability of failure, denoted as q, is 1−p, and p+q=1 20.
The binomial probability distribution, B(x;n,p), describes the probability of getting exactly x successes in n independent trials. P(x)=x!(n−x)!n!pxqn−x Here, x can take integer values from 0 to n.
- Mean: The expected number of successes is μ=np.
- Variance: The variance of the number of successes is σ2=npq 21.
📝 If you place a $1 Odd-or-Even bet on 5 different roulette games, where the probability of winning is p=18/38, this is a binomial experiment with n=5 and p=18/38. The probability of never winning (x=0) is P(x=0)=0!(5−0)!5!(3818)0(3820)5≈0.0438 22.
2. The Normal Distribution
2.1 Introduction
A continuous random variable can assume any value within a given interval, such as height or weight. Unlike discrete variables, the probability of a continuous random variable equaling a specific value is always zero, meaning probabilities are only calculated for intervals 32 33.
2.2 The Normal Distribution
The normal distribution, often called the bell curve, models many real-world phenomena like test scores, assembly times, and birth weights. It is characterized by its mean (μ) and standard deviation (σ) 35.
- Key properties of N(x; μ, σ):
- It is bell-shaped and symmetrical around the mean μ.
- The mean, median, and mode are all equal.
- The total area under the curve is 1.
- Due to symmetry, P(x < μ) = P(x > μ) = 0.5.
- Its shape is entirely determined by μ and σ 35.
- Probability Density Function (PDF): The normal PDF is given by f(x)=σ2π1e−(x−μ)2/2σ2, where μ is the population mean and σ is the population standard deviation.
- Effect of parameters:
- Changing μ shifts the curve horizontally without altering its shape.
- A smaller σ results in a taller, narrower curve.
- A larger σ leads to a shorter, wider curve 36.
| Range | Approximate Area |
|---|---|
| µ−σ<x<µ+σ | 68% |
| µ−2σ<x<µ+2σ | 95% |
| µ−3σ<x<µ+3σ | 99.7% |
The Empirical Rule states that for a normal distribution, approximately 68% of the data falls within one standard deviation of the mean, 95% within two, and 99.7% within three 37.
2.3 The z-Score
The z-score standardizes any normal random variable x into a standard normal variable z, which has a mean of 0 and a standard deviation of 1. The formula for the z-score is z=σx−μ 39.
- Standard normal distribution: This distribution, denoted N(0, 1), has a density function f(z)=2π1e−21z2.
- Key equivalence: Probabilities for a normal variable x can be converted to probabilities for the standard normal variable z: P(a<x<b)=P(za<z<zb), where za=σa−μ and zb=σb−μ 39.
📝 To convert a height of 5 feet to a z-score, given μ=5′9′′ and σ=3′′, the calculation is z=3′′5′−5′9′′=3′′−9′′=−3 40.
2.4 Standard Normal Table
The standard normal table provides the area under the standard normal curve from z=0 to a positive value z∗. This area represents P(0<z<z∗) 42.
- Symmetry properties:
- P(−z∗<z<0)=P(0<z<z∗).
- P(z<0)=P(z>0)=0.5 42.
| Case | Probability Calculation |
|---|---|
| Between 0 and z∗ | P(0<z<z∗) |
| Right of z∗ | 0.5−P(0<z<z∗) |
| Left of −z∗ | 0.5−P(0<z<z∗) |
| Straddling 0 | P(−z1<z<0)+P(0<z<z2) |
| Same side of 0 | P(0<z<z2)−P(0<z<z1) |
- Finding z0 from an area: To find a z-score (z0) given a probability, locate the probability value in the body of the standard normal table and then identify the corresponding z-score. For example, if P(0<z<z0)=0.1950, then z0=0.51. If P(z<z0)=0.0250, this implies a left-tail area, so P(0<z<−z0)=0.5−0.0250=0.4750, leading to z0=−1.96 44.
2.5 Probability Calculations with N(μ, σ)
To calculate probabilities for a normal distribution N(μ, σ), convert the x-values to z-scores using z=σx−μ and then use the standard normal table 46.
- Steps for probability questions:
- Standardize each boundary value using the z-score formula.
- Sketch the normal curve and shade the region corresponding to the desired probability.
- Read the relevant area(s) from the N(0, 1) table.
- Combine the areas using addition or subtraction, as needed, considering symmetry 46.
📝 For Montreal July temperatures, x∼N(μ=23.5∘C,σ=3.5∘C): (a) To find P(x>25), calculate z0=3.525−23.5=0.43. Then P(z>0.43)=0.5−0.1664=0.3336. (b) To find P(x<18), calculate z0=3.518−23.5=−1.57. Then P(z<−1.57)=0.5−0.4418=0.0582. (c) To find P(25<x<30), calculate z1=0.43 and z2=3.530−23.5=1.86. Then P(0.43<z<1.86)=0.4686−0.1664=0.3022 47.
- Working backwards for x0, μ, or σ: The standardization equation z0=σx0−μ can be rearranged to solve for any unknown variable if the other three are known.
- Finding μ: If 12.3% of Montrealers are over 60 years old (σ=15), and the corresponding z-score is 1.16, then 1.16=1560−μ, which yields μ=42.6 years.
- Finding σ: If 83.4% of aptitude test scores exceed 350 (μ=375), and the corresponding z-score is -0.97, then −0.97=σ350−375, which yields σ=25.8 49.
2.6 Normal Approximation to the Binomial
The normal distribution can approximate the binomial distribution B(x; n, p) when certain conditions are met. For a binomial distribution, the mean is np and the variance is np(1−p) 51.
- Condition for approximation: The approximation is valid if np≥5 and nq≥5, where q=1−p.
- Approximation formula: B(x;n,p)≈N(x;np,np(1−p)).
- Continuity correction: Since the binomial distribution is discrete and the normal distribution is continuous, a continuity correction is applied. A discrete value x0 is represented by the interval [x0−21,x0+21] 51.
| Binomial Probability | Normal Approximation with Continuity Correction |
|---|---|
| P(x=x0) | P(x0−21<x<x0+21) |
| P(x≥k) | P(x>k−21) |
| P(x≤k) | P(x<k+21) |
📝 For a multiple-choice test with 48 questions and 4 choices each, where a student guesses randomly, the binomial distribution is B(x;48,41). This can be approximated by N(x;12,3). To find the probability of exactly 10 correct answers using the normal approximation, calculate z1=39.5−12=−0.83 and z2=310.5−12=−0.50. Then P(9.5<x<10.5)≈0.2967−0.1915=0.1052 53.
3. Central Limit Theorem
3.1 Sampling distributions and sample means
A sampling distribution is the probability distribution of all possible sample means for samples of the same size n drawn from a population. When we take multiple random samples from a population, each sample typically yields a different mean 57 60.
- Population parameter: This describes a characteristic of the entire population, such as the population mean (μ) or standard deviation (σ).
- Sample statistic: This is a value calculated from a selected sample, such as the sample mean (xˉ) or sample standard deviation (s) 58.
- One observation (X): This refers to the value of a single randomly selected item from the population.
- Mean of n observations (Xˉ): This is the average of n random draws, calculated as Xˉ=nX1+X2+⋯+Xn 59.
3.2 Variation of sample means
When drawing samples with replacement, each draw is independent, and repeated values are allowed. The distribution of sample means tends to be more concentrated around the population mean compared to the distribution of individual values 62 65.
📝 Consider a population of three tokens with values 1, 3, and 5. The population mean μ=3 and standard deviation σ≈1.633. If two tokens are drawn with replacement, the possible sample means range from 1 to 5, but means closer to 3 (e.g., 2, 3, 4) occur more frequently than extreme values (e.g., 1, 5) 61 63 64.
3.3 Mean and standard deviation of the sample mean 70
The mean of the sampling distribution of Xˉ, denoted μXˉ, is equal to the population mean μ. The standard deviation of the sample mean, known as the standard error (SE), measures the sampling variation in the estimate and is calculated as σXˉ=nσ 66 69 71 72.
- Expected value of individual draws: For every position i, the expected value of an individual draw E(Xi) is equal to the population mean μ 68.
- Expected value of sample mean: E(Xˉ)=E(nX1+⋯+Xn)=nE(X1)+⋯+E(Xn)=nnμ=μ 69.
- Variance of sample mean: For independent draws, Var(Xˉ)=Var(nX1+⋯+Xn)=n2σ2+⋯+σ2=n2nσ2=nσ2 72.
- Assumptions: These formulas hold when observations come from the same population distribution, draws are independent, and the population has a finite mean and standard deviation. For sampling without replacement, the standard error is an approximation if the sample is a small fraction (at most 10%) of the population 74.
| Quantity | What varies? | Token example (n=2) |
|---|---|---|
| σ | Individual draws | 1.633 |
| σXˉ=σ/n | Means of samples of size n | 1.155 |
📝 If the population standard deviation is σ=12, increasing the sample size n reduces the standard error. For n=1, SE is 12; for n=4, SE is 6; for n=16, SE is 3; and for n=64, SE is 1.5. Multiplying n by 4 divides the standard error by 2 73.
3.4 The Central Limit Theorem (CLT) 80
The Central Limit Theorem states that for independent draws from the same population with a finite mean (μ) and finite standard deviation (σ), as the sample size (n) becomes large, the standardized sample mean approaches a standard normal distribution. This means that σ/nXˉ−μ is approximately N(0,1) 77.
- Normal population: If individual observations X are normally distributed N(μ,σ), then the sample mean Xˉ is exactly normally distributed N(μ,nσ) for any sample size n 76.
- Non-normal populations: For other population distributions, the CLT provides a normal approximation for Xˉ when n is sufficiently large 75 77.
- "Large enough" sample size: A common guideline is n≥30, but this is not a universal rule. A roughly symmetric population may require fewer observations, while strongly skewed or extreme populations may need much larger samples. A large sample improves the normal approximation but cannot correct for biased sampling 78.
| Quantity | Mean | Standard Deviation |
|---|---|---|
| One tree | 10.5 inches | 1.45 inches |
| Mean of 10 trees | 10.5 inches | 1.45/10≈0.46 inches |
| Mean of 30 trees | 10.5 inches | 1.45/30≈0.26 inches |
| Mean of 200 trees | 10.5 inches | 1.45/200≈0.10 inches |
📝 For a skewed population, as n increases, the sampling distribution of Xˉ becomes less skewed and has a smaller spread, approaching a normal shape 79.
3.5 Using z-scores for sample means
To calculate probabilities involving sample means, it is crucial to distinguish between an individual observation and a sample mean. The appropriate z-score formula must be used based on what the question asks about 81.
| Quantity | Z-score formula |
|---|---|
| Individual observation (X) | z=σx−μ |
| Sample mean (Xˉ) | z=σ/nxˉ−μ |
A routine for probability questions involves identifying whether the question concerns X or Xˉ, checking if a normal model is justified (exact or approximate), calculating the standard error for Xˉ, converting boundaries to z-scores, and finding the correct normal area. Φ(z)=P(Z≤z) denotes the standard normal cumulative probability 82.
📝 For CO2 measurements with μ=395 ppm, σ=105 ppm, and n=16, the standard error is SE=16105=26.25 ppm. Since the population is normal, Xˉ∼N(395,26.25) exactly. To find P(Xˉ>410), calculate z=26.25410−395≈0.5714. Then P(Xˉ>410)=1−Φ(0.5714)≈0.2839 83 84.
3.6 When σ is unknown
When the population standard deviation (σ) is unknown, it is estimated using the sample standard deviation (s). The estimated standard error is SE^=ns 95.
- t-distribution: For a normal population with unknown σ, the statistic S/nXˉ−μ follows a t-distribution with n−1 degrees of freedom.
- Normal approximation: For large samples, a standard normal approximation can still be useful even when σ is unknown.
- Actual vs. estimated SE: The actual standard deviation of Xˉ is σ/n, while s/n is an estimate of it 95.
📝 For individual package weights that are normally distributed with μ=500 g and σ=20 g:
- To find P(X>510) for one package, use σ=20: z=20510−500=0.5, so P(X>510)≈0.3085.
- To find P(Xˉ>510) for 16 independent packages, use SE=1620=5: z=5510−500=2, so P(Xˉ>510)≈0.0228. The probabilities differ because averages vary less than individual observations, making an average 10 g above the mean more unusual than a single package 10 g above the mean 96 97.
4. Confidence Intervals
4.1 Estimating a population mean 104
A confidence interval estimates an unknown population mean (μ) using a sample mean (xˉ) and accounts for uncertainty. A single sample mean is the best point estimate for the population mean, but it will vary between samples 100 101 102.
- Sample mean (xˉ): This is calculated from the collected data and is a known value.
- Population mean (μ): This is the unknown quantity we aim to estimate for the entire population 101.
- Confidence interval structure: It is expressed as xˉ±E, where E is the margin of error 102.
- Interval interpretation: The sample mean is the center of the interval, and the margin of error is the distance from the center to either end. The total width of the interval is twice the margin of error 103.
| Quantity | Population | Sample |
|---|---|---|
| Mean | μ (unknown target) | xˉ (our estimate) |
| Standard deviation | σ | s |
4.2 Confidence level and critical values 107 144
The confidence level expresses the reliability of the interval method, typically as (1−α)×100%. The value α represents the total area outside the middle region of the sampling distribution, with α/2 in each tail for a two-sided interval 105.
- Critical value (zα/2): This is the positive value on the standard normal distribution that has an area of α/2 to its right. It determines how many standard errors are allowed on each side of the sample mean 106 108.
- Interpretation of confidence: If the process of taking samples and constructing intervals were repeated many times, approximately (1−α)×100% of these intervals would contain the true population mean. The population mean remains fixed, while the sample and interval change with each repetition 114.
- Misinterpretations: A confidence interval does not mean that (1−α)×100% of individual data points fall within the range, nor that (1−α)×100% of sample means lie within this specific interval 116.
| Confidence | 1−α | α | α/2 | zα/2 |
|---|---|---|---|---|
| 90% | 0.90 | 0.10 | 0.05 | 1.645 |
| 95% | 0.95 | 0.05 | 0.025 | 1.960 |
| 99% | 0.99 | 0.01 | 0.005 | 2.576 |
📝 For a 95% confidence interval, 1−α=0.95, so α=0.05. This means α/2=0.025, and the critical value z0.025 is 1.96 105 106.
4.3 Margin of error and standard error
The margin of error (E) quantifies the uncertainty in the estimate and is calculated as the critical value multiplied by the standard error 108.
- Standard error: This measures how much sample means are expected to vary from one sample to another 108.
- Estimated standard error: When the population standard deviation (σ) is unknown, the sample standard deviation (s) is used to estimate the standard error as s/n.
- Difference between standard deviation and standard error: Standard deviation (s) describes the variation among individual observations, while standard error (s/n) describes the variation among sample means. Averaging multiple observations makes the sample mean a more stable result than a single observation 109.
📝 For a sample of 50 eggs with a sample standard deviation (s) of 14.9 mg, the estimated standard error is 14.9/50≈2.11 mg 109.
4.4 Large-sample confidence interval for μ (unknown σ)
For large random samples (typically n>30), when the population standard deviation (σ) is unknown, the sample standard deviation (s) is used with the z-critical value. This is considered a large-sample approximation 110 147.
- Formula: The confidence interval for μ is given by xˉ±zα/2ns 110.
- Conditions: This method assumes random, independent observations and no extreme skewness or outliers in the population. If sampling without replacement, the sample size should not exceed 10% of the population 112 123.
📝 A sample of 50 eggs has xˉ=188.6 mg and s=14.9 mg. To construct a 90% confidence interval, zα/2=1.645. The margin of error E=1.645×(14.9/50)≈3.47 mg. The interval is 188.6±3.47, which is (185.1,192.1) mg. We are 90% confident that the population mean cholesterol content is between 185.1 mg and 192.1 mg 111 112 113.
4.5 Theoretical basis for confidence intervals
The method works by reversing the viewpoint of the sampling distribution of sample means. If a sample mean (xˉ) falls within E of the population mean (μ), then the interval constructed around xˉ will capture μ 117 118.
- Sampling distribution: If σ is known and the sampling distribution of Xˉ is normal, then (1−α)×100% of sample means fall within E=zα/2nσ of μ 117.
- Capture rate: The critical value is chosen so that the middle area of the sampling distribution is 1−α. Any sample mean falling within this middle region will produce a confidence interval that contains μ 120.
4.6 Choosing the correct formula
The choice of formula for a confidence interval depends on whether the population standard deviation (σ) is known and the sample size (n) 122 154.
- Conditions for all intervals:
- Use a random sample with independent observations.
- If sampling without replacement, the sample size should be no more than 10% of the population.
- Population shape considerations:
- Small sample (n≤30): Assume an approximately normal population with no serious outliers.
- Large sample (n>30): Normality is less restrictive due to the Central Limit Theorem, but extreme skewness or outliers can still pose problems 123.
| Condition | Formula | Critical Value |
|---|---|---|
| σ is known | xˉ±zα/2nσ | zα/2 |
| σ is unknown, n>30 | xˉ±zα/2ns | zα/2 |
| σ is unknown, n≤30 | xˉ±tα/2ns | tα/2 with df=n−1 |
4.7 Confidence interval with known σ
When the population standard deviation (σ) is known, the z-distribution is used to find the critical value, regardless of sample size 124 156.
- Formula: The confidence interval is xˉ±zα/2nσ 124.
📝 A random sample of 10 students has a mean score of 72.4%. The population is normal with a known σ=12.3 percentage points. For a 95% confidence interval, zα/2=1.96. The margin of error E=1.96×(12.3/10)≈7.62. The interval is 72.4±7.62, which is (64.8%,80.0%) 124 156.
4.8 Confidence interval with unknown σ and small sample
When the population standard deviation (σ) is unknown and the sample size (n) is small (typically n≤30), the t-distribution is used. This accounts for the additional uncertainty from estimating σ with the sample standard deviation (s) 125 157.
- Formula: The confidence interval is xˉ±tα/2ns, where df=n−1.
- Finding tα/2: The t-critical value requires both the confidence level and the degrees of freedom (df) 125.
- Course convention: For this course, the t-method is specifically for small samples with unknown σ and an approximately normal population 136 168.
📝 For a 95% confidence interval with n=10, the degrees of freedom (df) are 10−1=9. With α=0.05, α/2=0.025. From a t-table, t0.025 for df=9 is 2.262. If xˉ=72.4% and s=11.7 percentage points, E=2.262×(11.7/10)≈8.37. The interval is 72.4±8.37, or (64.0%,80.8%) 126 127 158 159.
4.9 Impact of confidence level and sample size160 161
The width of a confidence interval is affected by both the chosen confidence level and the sample size 128 129.
- Confidence level: A higher confidence level requires a larger margin of error, resulting in a wider interval. The center of the interval remains unchanged 128 160.
- Sample size: A larger sample size leads to greater precision and a smaller margin of error, resulting in a narrower interval for the same confidence level. To halve the margin of error, the sample size must be quadrupled 129 161.
| Confidence | zα/2 | Margin of Error (E) | Interval (mg) |
|---|---|---|---|
| 90% | 1.645 | 3.47 | (185.1, 192.1) |
| 95% | 1.960 | 4.13 | (184.5, 192.7) |
| 99% | 2.576 | 5.43 | (183.2, 194.0) |
| Sample Size | Margin of Error |
|---|---|
| n | E |
| 4n | E/2 |
| 9n | E/3 |
4.10 Planning sample size
To determine the necessary sample size (n) for a desired margin of error (E) and confidence level, the following formula is used 130 162.
- Formula: n=(Ezα/2σ)2.
- Steps:
- Choose zα/2 based on the desired confidence level.
- Substitute the known or estimated population standard deviation (σ) and the target margin of error (E) in consistent units.
- Calculate n and always round up to the next whole number to ensure the target margin of error is met.
- Unknown σ: If σ is unknown, a prior estimate or a pilot study estimate can be used as an approximate planning value 130.
📝 A researcher wants to estimate the mean exam score with 95% confidence and a margin of error of at most 2 percentage points, assuming σ=12.3 percentage points. Here, zα/2=1.96 and E=2. The required sample size is n=(21.96×12.3)2≈145.30. Therefore, 146 students must be sampled 131 163.
4.11 Exercise: Constructing a confidence interval
This exercise tests the ability to construct a confidence interval for a population mean given sample data from an approximately normal population 132 164.
- Problem: A random sample from an approximately normal population gives n=16, xˉ=40, and s=8. Construct a 95% confidence interval for the population mean, assuming independent observations and no serious outliers 132 164.
- Solution:
- Choose formula: Since σ is unknown and n=16 (small sample), use the t-distribution formula: xˉ±tα/2ns.
- Find critical value: For 95% confidence and n=16, df=16−1=15. With α=0.05, α/2=0.025. From a t-table, t0.025 for df=15 is 2.131.
- Calculate E and endpoints: The margin of error E=2.131×(8/16)=2.131×2=4.262. The interval is 40±4.262, which is (35.74,44.26).
- State conclusion: We are 95% confident that the population mean is between 35.74 and 44.26 133 165.
4.12 General routine for confidence intervals
A consistent routine helps in constructing confidence intervals accurately 134 166.
- Steps:
- Identify: List the given values: sample size (n), sample mean (xˉ), standard deviation (σ or s), and the confidence level.
- Choose: Check the conditions for the data, then select the appropriate formula and critical value (z or t).
- Calculate: Determine the margin of error (E), then compute the lower (xˉ−E) and upper (xˉ+E) endpoints of the interval.
- Conclude: State the confidence level and interpret the interval in the context of the problem 134.
5. Hypothesis Testing
5.1 Defining statistical hypotheses
A statistical hypothesis is a statement about a population parameter, such as the population mean (μ) or proportion (p). We formulate hypotheses about these parameters, using sample statistics like the sample mean (xˉ) as evidence 171 183.
- Null hypothesis (H0): This is the competing baseline that is tested against an alternative hypothesis. It typically includes a statement of equality for the parameter.
- Alternative hypothesis (Ha): This specifies the direction or difference for which evidence is sought. It uses inequality symbols (>,<,=) 172 173.
- Relationship between H0 and Ha: The two hypotheses must cover all possible values of the population parameter without overlap. The boundary value for calculation is usually taken from H0 175 176.
5.2 Choosing H0 and Ha
The research question determines the alternative hypothesis (Ha), which then dictates the complementary null hypothesis (H0). It is crucial to express the research question in words before assigning symbols 170 173.
| Question about the mean | Alternative (Ha) | Test Type |
|---|---|---|
| Greater, increased, above | μ>μ0 | Right-tailed |
| Less, decreased, below | μ<μ0 | Left-tailed |
| Different, changed | μ=μ0 | Two-tailed |
- Claim placement: A claim's mathematical meaning determines whether it belongs in H0 or Ha, not the word "claim" itself. For example, "mean is exactly 15" (μ=15) belongs in H0, while "mean is more than 15" (μ>15) belongs in Ha 178.
- Sample results: The observed sample mean (xˉ) does not influence the choice of Ha; the hypotheses are established before data collection 184.
| Stated Claim | H0 | Ha |
|---|---|---|
| At least 50 | μ≥50 | μ<50 |
| At most 50 | μ≤50 | μ>50 |
| Exactly 50 | μ=50 | μ=50 |
📝 If a light-bulb manufacturer claims the population mean life exceeds 1,000 hours, the alternative hypothesis is Ha:μ>1000, and the null hypothesis is H0:μ≤1000. The manufacturer's claim is Ha because it seeks evidence for "more than" 180.
5.3 Practice: Choosing the alternative
This section provides practice questions for setting up null and alternative hypotheses.
- Question 1: Has mean waiting time decreased from 20 minutes?
- H0:μ≥20, Ha:μ<20.
- Question 2: Is mean package weight different from 500 g?
- H0:μ=500, Ha:μ=500.
- Question 3: A claim says mean lifetime is at most 1,000 hours. Is there evidence against that claim?
- H0:μ≤1000, Ha:μ>1000.
- Question 4: Is there evidence that more than 60% of students use the bus?
- H0:p≤0.60, Ha:p>0.60 185 186.
5.4 Possible decisions and errors
In hypothesis testing, there are two possible decisions: reject H0 or fail to reject H0. Failing to reject H0 does not prove it true; it simply means there is insufficient evidence to support Ha 187 188.
| Our Decision | H0 Actually True | H0 Actually False |
|---|---|---|
| Reject H0 | Type I error | Correct rejection |
| Fail to reject H0 | Correct non-rejection | Type II error |
- Type I error: This occurs when we reject a true null hypothesis, concluding a departure exists when it does not. The probability of a Type I error is controlled by the significance level (α)191.
- Type II error: This occurs when we fail to reject a false null hypothesis, missing a departure that actually exists. The probability of a Type II error is denoted by β 189.
- Power: This is the probability of correctly detecting a departure when it exists, calculated as 1−β. Larger samples generally increase power, while a smaller α typically reduces power 192.
📝 For H0:μ≤15 and Ha:μ>15, a Type I error would be concluding that mean study time exceeds 15 hours when it is actually at most 15. A Type II error would be failing to detect a mean above 15 hours when the true mean is indeed above 15 190.
5.5 Test statistics and conditions
The test statistic measures how far the sample mean (xˉ) is from the null hypothesis boundary (μ0) in terms of standard errors 193.
test statistic=standard errorxˉ−μ0
- Choosing z or t:
- If the population standard deviation (σ) is known, use the z-statistic: zobs=σ/nxˉ−μ0.
- If the population standard deviation is unknown, use the t-statistic: tobs=s/nxˉ−μ0, with degrees of freedom df=n−1 194.
- Conditions for use:
- An appropriate random sample with independent observations is required.
- For small samples, a normal population model is important.
- For non-normal populations, a sufficiently large sample (e.g., n>30) may justify an approximation, though strong skewness or outliers might require more data 195.
5.6 The p-value and decision rule
The p-value is the probability of observing a test statistic at least as extreme as the one calculated, assuming the null model is true and in the direction specified by Ha. A small p-value indicates that the observed result is unusual under the null model 196.
| Alternative (Ha) | Relevant Area | Normal p-value |
|---|---|---|
| μ>μ0 | Right tail | 1−Φ(zobs) |
| μ<μ0 | Left tail | Φ(zobs) |
| μ=μ0 | Both tails | 2[1−Φ(∣zobs∣)] |
- Decision rule:
- If p-value ≤α, reject H0.
- If p-value >α, fail to reject H0.
- Critical regions: This is an alternative method that yields the same decision. It involves comparing the test statistic to a critical value determined by α and the type of test 200.
- Conclusion: The conclusion must answer the original question in words, specifying the population, parameter, and direction. A statistically significant result does not necessarily imply a large practical effect 199 209.
5.7 Worked example: Mean study time
Scenario: Is the population mean study time more than 15 hours per week? Given: n=49, xˉ=15.9, s=3.5, α=0.05 201.
- Hypotheses: H0:μ≤15, Ha:μ>15 (right-tailed test) 201.
- Calculation (large-sample z approximation):
- Standard Error (SE) =493.5=0.5.
- Test statistic zobs=0.515.9−15=1.80.
- p-value =P(Z≥1.80)≈0.0359.
- Decision: Since 0.0359<0.05, reject H0.
- Conclusion: At the 5% significance level, there is sufficient evidence that population mean study time exceeds 15 hours per week 202.
5.8 Worked example: Has mean height changed?
Scenario: Test whether a population mean height differs from 180 cm. Given: n=36, xˉ=183, s=9, α=0.05 203.
- Hypotheses: H0:μ=180, Ha:μ=180 (two-tailed test).
- Calculation (large-sample z approximation):
- Test statistic zobs=9/36183−180=2.00 203.
- p-value =P(Z≤−2)+P(Z≥2)=2[1−Φ(2)]≈0.0455.
- Decision: Since 0.0455<0.05, reject H0 using the z approximation.
- Conclusion: There is sufficient evidence, under this approximation, that the population mean height differs from 180 cm 204.
5.9 Worked example: The at-least claim
Scenario: A report claims population mean player weight is at least 195 lb. Given: n=36, xˉ=190.2, s=12.8, α=0.01 205.
- Hypotheses: H0:μ≥195, Ha:μ<195 (left-tailed test).
- Calculation (large-sample z approximation):
- Test statistic zobs=12.8/36190.2−195=−2.25 205.
- p-value =P(Z≤−2.25)≈0.0122.
- Decision: Since 0.0122>0.01, fail to reject H0.
- Conclusion: At the 1% level, there is insufficient evidence that the population mean weight is below 195 lb 206.
5.10 Worked example: Mean statistics grade
Scenario: Is the population mean grade less than 70? Given: n=36, xˉ=66, s=11, α=0.05 207.
- Hypotheses: H0:μ≥70, Ha:μ<70.
- Calculation (large-sample z approximation):
- Test statistic zobs=11/3666−70≈−2.1818.
- p-value ≈0.0146.
- Decision: Since 0.0146<0.05, reject H0.
- Conclusion: There is sufficient evidence that the population mean grade is below 70 207.
5.11 Worked example: Mean age
Scenario: Is the population mean age different from 40 years? Given: n=100, xˉ=43.1, s=15.5, α=0.02 208.
- Hypotheses: H0:μ=40, Ha:μ=40.
- Calculation (large-sample z approximation):
- Test statistic zobs=15.5/10043.1−40=2.00.
- p-value =2[1−Φ(2)]≈0.0455.
- Decision: Since 0.0455>0.02, fail to reject H0.
- Conclusion: There is insufficient evidence at the 2% level that the population mean age differs from 40 years 208.
5.12 Conclusion wording
The wording of the conclusion depends on whether the claim is in H0 or Ha and the decision made 209.
| Claim Belongs In | Reject H0 | Fail to Reject H0 |
|---|---|---|
| Ha | Sufficient evidence for the claim | Insufficient evidence for the claim |
| H0 | Sufficient evidence against the claim | Insufficient evidence against the claim |
- Key elements: Always include the population, the parameter, and the direction in the final conclusion sentence 209.
5.13 A complete test in six steps
A complete hypothesis test follows a structured six-step process 210.
- State the parameter and the question: Clearly define what is being investigated.
- Write Ha and the complementary H0: Formulate the null and alternative hypotheses based on the question.
- Set α, check conditions, and choose the method: Determine the significance level, verify assumptions, and select the appropriate test (e.g., z-test or t-test).
- Calculate the test statistic at the null boundary: Compute the value of the test statistic using the sample data and the boundary value from H0.
- Find the p-value using the direction in Ha: Calculate the probability of observing such an extreme result under the null hypothesis, considering the direction of Ha.
- Compare with α and conclude in context: Make a decision to reject or fail to reject H0 by comparing the p-value to α, and state the conclusion in plain language relevant to the original question 210.
5.14 Final practice: Complete the test
Scenario: A service claims mean waiting time is at most 20 minutes. We investigate whether the mean is longer.
Given: n=64, xˉ=21.5 min, σ=4 min, α=0.05. Assume independent random observations and a justified normal approximation 211.
- Write H0 and Ha:
- H0:μ≤20
- Ha:μ>20.
- Calculate the statistic and the p-value:
- SE =644=0.5.
- zobs=0.521.5−20=3.
- p-value =P(Z≥3)≈0.00135.
- Give the decision and conclusion:
- Since 0.00135<0.05, reject H0.
- There is sufficient evidence that mean waiting time exceeds 20 minutes, contrary to the at-most-20 claim 212.
6. Inferences for Proportions
6.1 Understanding population and sample proportions
In statistical studies, a proportion describes the fraction of a population that belongs to a specific category of interest, such as individuals using public transit or products being defective. The unknown population proportion is denoted by p, while the sample proportion, p^, is an estimate calculated from observed data as the number of successes (x) divided by the total number of observations (n), or p^=x/n 215 216.
📝 If 12 out of 100 trials result in a success, then x=12 and n=100, leading to a sample proportion p^=12/100=0.12, or 12% 217.
| Symbol | Meaning | Example |
|---|---|---|
| p | Population proportion | Unknown |
| p^ | Sample proportion | 0.544 |
| p0 | Reference value in a hypothesis test | 0.60 |
| p-value | Tail probability under the null model | Calculated from a test |
The sample proportion P^ is a random variable, following a binomial distribution X∼Bin(n,p), with an expected value E(P^)=p and a standard deviation SD(P^)=p(1−p)/n. Larger samples generally result in smaller standard errors, indicating less variability in the sample proportion 219.
6.2 Conditions for the normal approximation
For the normal approximation to be valid when working with proportions, several conditions must be met to ensure the reliability of the statistical inference 220.
- Random sample: The data must come from a random sample with independent observations and a consistent success probability.
- Expected counts: Both the expected number of successes (np) and expected number of failures (n(1−p)) must be sufficiently large, typically greater than 5, or more cautiously, at least 10 for each.
- Sampling without replacement: If sampling without replacement, the sample size should be a small fraction of the population, commonly at most 10% 220.
6.3 Confidence intervals for proportions
A confidence interval provides a range of plausible values for an unknown population proportion p, starting with the sample estimate p^. Since the true p is unknown, the standard error (SE) is estimated using p^ 221 222.
- Estimated standard error: SE=p^(1−p^)/n.
- Normal-approximation interval: p^±z∗SE, where z∗ is the critical value corresponding to the desired confidence level.
- Common z∗ values: 1.645 for 90% confidence, 1.960 for 95% confidence, and 2.576 for 99% confidence 222.
To check conditions for the usual interval, the observed counts np^ and n(1−p^) are used 223.
📝 For 12 successes in 100 trials, p^=0.12. The observed counts are np^=12 and n(1−p^)=88. Both counts exceed 5 (and 10), allowing the normal approximation. For a 95% confidence interval, z∗=1.96. The estimated standard error is SE=0.12(0.88)/100≈0.03250. The margin of error E=1.96(0.03250)≈0.0637. The interval is 0.12±0.0637, which is (0.0563,0.1837), or 5.6% to 18.4% 223 224 225.
The margin of error (E) quantifies the precision of the interval and is calculated from the data, but it is not the actual distance from the unknown true proportion 226.
6.4 Hypothesis tests for proportions
A hypothesis test assesses evidence against a specified null hypothesis about a population proportion p. The calculation starts with a reference value p0 from the null hypothesis 221.
- Hypotheses: Hypotheses are written about the population proportion p, not the sample proportion p^ 227.
- Test standard error: SE0=p0(1−p0)/n is used, assuming the null hypothesis is true.
- Test statistic: The z-observed statistic is calculated as zobs=(p^−p0)/SE0 228.
| Question | Null Hypothesis (H0) | Alternative Hypothesis (Ha) |
|---|---|---|
| More than p0? | p≤p0 | p>p0 |
| Less than p0? | p≥p0 | p<p0 |
| Different from p0? | p=p0 | p=p0 |
The conditions for the normal approximation in hypothesis testing involve checking the expected counts under the null hypothesis: np0 and n(1−p0) 229.
📝 To test if the proportion of female CEGEP students differs from 60% (p0=0.60) with n=250 and x=136:
- H0:p=0.60, Ha:p=0.60 230.
- p^=136/250=0.544.
- Expected counts: np0=250(0.60)=150 and n(1−p0)=250(0.40)=100. Both are large enough 231.
- SE0=0.60(0.40)/250≈0.03098.
- zobs=(0.544−0.60)/0.03098≈−1.8074.
- For a two-tailed test, p-value=2P(Z≤−1.8074)≈0.0707 232.
- Since 0.0707>0.05 (for α=0.05), we fail to reject H0. There is insufficient evidence that the population proportion differs from 60% 233.
6.5 Planning sample size for proportions
When planning a study, determining the appropriate sample size (n) is crucial to achieve a desired margin of error (E) at a specific confidence level 236.
-
Formula: n=(Ez∗)2p∗(1−p∗), where p∗ is a planning estimate for the population proportion.
-
Rounding: The calculated sample size must always be rounded up to ensure the desired margin of error is met 236.
-
Preliminary estimate: If a pilot study or prior knowledge suggests an approximate value for p, use that as p∗ 237.
-
No preliminary estimate: If no suitable prior estimate is available, use p∗=0.50. This choice maximizes the variance factor p∗(1−p∗) and thus yields the largest required sample size, providing a conservative plan 238 239.
📝 To achieve 95% confidence with a margin of error of 2 percentage points (E=0.02) and a preliminary estimate p∗=0.15:
- z∗=1.96.
- n=(0.021.96)2(0.15)(0.85)=1224.51.
- Rounding up, the required sample size is n=1225 237.
It is important to distinguish between "percentage points" and "relative error" when defining the margin of error. A margin of 2 percentage points means E=0.02 in the formula, not 2% of the proportion itself 240.
6.6 Practice: Confidence interval and hypothesis test
These examples demonstrate the application of confidence intervals and hypothesis tests for proportions using a common dataset 241 243.
📝 In a sample of 200 students, 80 use public transit.
- Confidence Interval (95%):
- p^=80/200=0.40. Counts np^=80 and n(1−p^)=120 are sufficient.
- SE=0.40(0.60)/200≈0.03464.
- E=1.96(0.03464)≈0.06790.
- Interval: 0.40±0.06790, or (0.3321,0.4679). We are 95% confident that between 33.2% and 46.8% of the population uses public transit 242.
- Hypothesis Test (α=0.05, less than half):
- H0:p≥0.50, Ha:p<0.50.
- p0=0.50. Expected counts np0=100 and n(1−p0)=100 are sufficient.
- zobs=(0.40−0.50)/0.50(0.50)/200≈−2.8284.
- p-value=P(Z≤−2.8284)≈0.00234.
- Since 0.00234<0.05, reject H0. There is sufficient evidence that less than half of the population uses public transit 244.
| Procedure | Formula |
|---|---|
| Estimate | p^=x/n |
| Confidence Interval | p^±z∗p^(1−p^)/n |
| Hypothesis Test | zobs=(p^−p0)/p0(1−p0)/n |
| Sample Size Planning | n=(z∗/E)2p∗(1−p∗) (rounded up) |
All normal-based procedures for proportions require appropriate sampling methods and conditions for the normal approximation to be valid 245.
7. The Student t-Distribution
7.1 Inference for a mean when σ is unknown
When estimating a population mean, the sample mean xˉ is used. If the population standard deviation (σ) is known, the standard error is σ/n.
However, σ is usually unknown and must be estimated from the sample using the sample standard deviation (s), resulting in an estimated standard error of s/n. This estimation introduces additional uncertainty, which the t-distribution accounts for 247.
| Population SD | Standard Error Used | Reference Distribution |
|---|---|---|
| σ known | σ/n | Standard normal z |
| σ unknown | s/n | Student t, df = n - 1 |
The t-distribution is exact for independent observations from a normal population, provided σ>0 and n≥2. The distinction between using the z-distribution and the t-distribution becomes particularly important with small sample sizes 248 249.
7.2 Conditions for using the t procedures
For t-procedures to be exact, observations must form an appropriate random sample and be independent, and the population must be normal 250.
- Small samples: Strong skewness or serious outliers can make the t-procedure unreliable.
- Large samples: For sufficiently large samples, t-procedures can often work approximately even for non-normal populations.
- Limitations: Using a t-critical value does not correct for unsuitable data or biased sampling 250.
7.3 The shape of the t distribution
The t-distribution is symmetric about zero and bell-shaped, but it has heavier tails than the standard normal distribution. Its shape is determined by its degrees of freedom (df).
Heavier tails indicate that more extreme standardized values are possible when the standard error is estimated. The total area under each probability density curve is 1 251.
7.4 Degrees of freedom
For one-sample t-procedures, the degrees of freedom are calculated as df=n−1, where n is the sample size. This is because once the sample mean is fixed, n−1 deviations from the mean can vary freely, but the final deviation is determined 254.
📝 If three values have a fixed mean of 10, their total must be 30. If two values are 8 and 11, the third value must be 30−8−11=11. Thus, only two values are free to vary, so df=3−1=2 253.
7.5 Larger degrees of freedom bring t closer to z
As the degrees of freedom increase, the t-distribution gradually approaches the standard normal (z) distribution. There is no sudden change at n=30; the distributions become closer continuously 255.
| Sample Size | df | 95% Two-Sided Critical Value |
|---|---|---|
| 6 | 5 | 2.571 |
| 11 | 10 | 2.228 |
| 31 | 30 | 2.042 |
| 101 | 100 | 1.984 |
| Standard normal | — | 1.960 |
7.6 Critical value and observed statistic
The critical value (t∗) is a cutoff chosen from the t-distribution based on the confidence level or test level, the tail choice, and the degrees of freedom. The observed test statistic (tobs) is calculated from the sample data using the formula: T=S/nXˉ−μ The critical value comes from the reference distribution, while the observed statistic comes from the sample 256.
7.7 A t confidence interval for μ
A t-confidence interval for the population mean (μ) is calculated using the formula: xˉ±t∗ns where df=n−1 257.
- Center: The sample mean (xˉ).
- Estimated standard error: s/n.
- Margin of error (E): E=t∗s/n 257.
The calculation structure is similar to previous intervals, but the critical value t∗ is obtained from a t-table 257.
📝 To find the critical value for a 90% confidence interval with n=12:
When reading t-table headings for a two-sided interval, the same column might be labeled as "one-tail area: 0.05," "combined two-tail area: 0.10," or "central confidence level: 90%". Always read the heading carefully before selecting the column 260.
7.8 Worked interval: protein in nutrition bars
To construct a 90% confidence interval for the population mean protein content of nutrition bars, given a sample of nine bars with protein contents (in grams): 8.1, 8.5, 7.7, 7.9, 8.3, 8.0, 8.6, 8.9, 8.7. Assume independent sampling and an approximately normal population with no serious outliers. Since σ is unknown, a t-interval is used 261.
- Summary statistics: n=9, xˉ=8.30 g, s≈0.4031 g.
- Degrees of freedom: df=9−1=8.
- Critical value: For α=0.10 and α/2=0.05, t∗=t0.05,8≈1.8595 262.
- Margin of error: E=1.859590.4031≈0.2499 g.
- Confidence interval: 8.30±0.2499⇒(8.05,8.55) g 263.
We are 90% confident that the population mean protein content lies between 8.05 g and 8.55 g. This interval estimates a population mean, not the protein content of individual bars 263.
7.9 Why is a t interval wider?
A t-interval is wider than a z-interval for the same data and confidence level because the t-critical value is larger than the z-critical value. This larger critical value accounts for the additional uncertainty introduced by estimating σ from the sample.
For small samples with unknown σ, the z-approximation is not appropriate 264.
7.10 Hypothesis tests: the same logic as before
The logic for hypothesis testing with the t-distribution remains consistent with previous methods, but the reference distribution changes due to estimating σ 265.
- Steps for a t-test:
- State the alternative hypothesis (Ha) and the complementary null hypothesis (H0).
- Check conditions and calculate df=n−1.
- Calculate the observed test statistic: tobs=s/nxˉ−μ0.
- Find the relevant tail area using the t-distribution.
- Compare the p-value with the preselected significance level (α) 265.
The alternative hypothesis still determines the tail of the test 265.
| Ha | Full H0 | p-value Area |
|---|---|---|
| μ>μ0 | μ≤μ0 | P(T≥tobs) |
| μ<μ0 | μ≥μ0 | P(T≤tobs) |
| μ=μ0 | μ=μ0 | 2P(T≥∣tobs∣) |
These p-values are calculated using T∼tn−1 at the null reference value μ0 266.
7.11 Worked test: mean passengers per flight
An airline claims the mean passenger count is more than 120. A sample of n=16 flights yields xˉ=123.3 passengers and s=7.7 passengers, with α=0.05. Assume independent random sampling and an approximately normal population 267.
- Hypotheses: H0:μ≤120, Ha:μ>120. The "more than" claim indicates a right-tailed test 267.
- Degrees of freedom: df=16−1=15.
- Estimated standard error: SE=167.7=1.925.
- Observed test statistic: tobs=1.925123.3−120≈1.7143. This means the sample mean is about 1.71 estimated standard errors above the null boundary of 120 268.
- Critical value: For df=15 and a right-tailed test at α=0.05, tcrit≈1.7531.
- Decision: Since tobs≈1.7143<1.7531, we fail to reject H0 269.
- p-value: P(T15≥1.7143)≈0.0535.
- Conclusion: Since 0.0535>0.05, there is insufficient evidence at the 5% level to conclude that the mean passenger count exceeds 120. This does not prove the mean is at most 120, but rather that the sample does not establish the greater-than claim at this level 270.
7.12 Why the z substitution can matter
Using a z-approximation instead of a t-procedure when σ is unknown and the sample is small can lead to a different conclusion 271.
| Reference Model | Right-Tail p-value | Decision at 5% |
|---|---|---|
| t, df = 15 | About 0.0535 | Fail to reject |
| Standard normal approximation | About 0.0432 | Reject |
For the passenger example, the t-procedure led to failing to reject H0, while a z-approximation would have led to rejecting H0. Therefore, it is crucial to use the t-procedure when σ is unknown and the sample is small and approximately normal 271.
7.13 Practice: find the correct t critical value
To find critical values for different scenarios with n=10, all calculations use df=9 272.
- 95% two-sided confidence interval: α/2=0.025, so t∗≈2.262.
- Right-tailed test at α=0.05: The cutoff is +1.833.
- Left-tailed test at α=0.05: The cutoff is −1.833 273.
An interval's positive critical value applies to both endpoints through ±t∗, while a one-sided test uses a signed cutoff 273.
7.14 Practice: a complete t test
Given a random sample of 12 independent measurements with xˉ=48 and s=3, assume an approximately normal population and unknown σ. Test whether the population mean is below 50 at α=0.05 274.
- Hypotheses: H0:μ≥50, Ha:μ<50.
- Degrees of freedom: df=11.
- Observed test statistic: tobs=3/1248−50≈−2.3094.
- p-value: P(T11≤−2.3094)≈0.0207.
- Conclusion: Since 0.0207<0.05, reject H0. There is sufficient evidence that the population mean is below 50, under the stated assumptions 275.
7.15 The essentials for presenting a t procedure
When presenting a t-procedure, several key elements must be included 276.
- Standard error: Since σ is unknown, estimate the standard error using s/n.
- Degrees of freedom: For a one-sample mean procedure, use df=n−1.
- Assumptions: Always check the sampling and population assumptions.
- Confidence interval: Calculate using xˉ±t∗s/n.
- Hypothesis test: Use the test statistic (xˉ−μ0)/(s/n) and the tail specified by Ha 276.
The fundamental logic of statistical inference remains the same; the t-distribution simply adjusts for the estimation of the population standard deviation 276.
8. Chi-Square Tests
Chi-square tests are used to analyze categorical data, addressing questions about whether observed counts for one categorical variable align with specified population proportions (goodness of fit) or if there is an association between two categorical variables in a population (independence). Both types of tests compare observed counts with expected counts under the null hypothesis 278.
8.1 Observed counts and expected counts
Observed counts (O) are the actual counts recorded in a sample, while expected counts (E) are the counts predicted by the null model. Expected counts do not necessarily equal observed counts, even when the null hypothesis is true, due to random sampling fluctuations 279.
📝 If a fair six-sided die is rolled 60 times, the expected count for each face is E=60×61=10.
8.2 The common statistic
The chi-square (χ2) statistic quantifies the discrepancy between observed and expected counts. Small values of χ2 indicate close agreement, while large values suggest a significant overall discrepancy 280.
χobs2=∑E(O−E)2
Calculation steps:
- For each category or table cell, find the difference between the observed and expected counts (O−E).
- Square this difference and divide it by the expected count (E).
- Sum all these contributions to get the χobs2 value. Rejection region: The rejection region for chi-square tests is always on the right tail of the distribution because departures in either direction (positive or negative O−E) increase the squared difference (O−E)2, leading to larger χ2 values. Large χ2 values provide evidence against the null hypothesis 281.
8.3 The chi-square distribution
The chi-square distribution describes the probability distribution of the χ2 statistic 282.
- Possible values: All possible values are non-negative.
- Shape: The distribution is asymmetric with a right tail.
- Degrees of freedom (df): Its shape depends on its degrees of freedom.
- Approximation: Under the null hypothesis, the test statistic approximately follows a chi-square distribution when certain conditions are met.
8.4 Conditions before using the approximation
Before using the chi-square approximation, several conditions must be met to ensure the validity of the test 283.
- Sampling: Use appropriate random sampling or a suitable randomized design.
- Independence: Observations must be independent, meaning each person or trial contributes to only one category or cell.
- Categories: Categories must be mutually exclusive and cover all possible outcomes.
- Expected counts: Every expected count must be at least 5. This condition applies to expected counts, not observed counts.
8.5 Goodness of fit: the question and hypotheses
The goodness-of-fit test assesses whether the observed counts for a single categorical variable align with specified population proportions 284.
- Null hypothesis (H0): The population category proportions equal the specified values (p1,…,pk).
- Alternative hypothesis (Ha): At least one population proportion differs from the specified value.
- Interpretation: Rejecting H0 indicates that the overall distribution differs from the specified model, but it does not imply that every category's proportion is different.
8.6 Goodness of fit: expected counts and df
For a goodness-of-fit test, the expected counts and degrees of freedom are calculated as follows 285.
- Expected count (Ei): For a sample of size n and specified category probability pi, the expected count for category i is Ei=npi.
- The sum of all specified probabilities must equal 1.
- The sum of all expected counts must equal the total sample size n.
- Degrees of freedom (df): When probabilities are fully specified in advance, df=k−1, where k is the number of categories.
- This is because once k−1 category counts are known, the last one is determined by the fixed total sample size 286.
📝 A sample of 150 random digits is collected, and the question is whether the population digit proportions are uniform 287.
- H0:p0=p1=⋯=p9=0.10.
- Ha: At least one digit probability differs from 0.10.
- For each of the 10 digits, the expected count is Ei=150×0.10=15.
- The degrees of freedom are df=10−1=9.
8.7 Random digits: statistic and decision
After calculating the contributions from each category, the χobs2 statistic is compared to the chi-square distribution to make a decision 289 290.
📝 For the random digits example, the calculated χobs2 is 10.00 with df=9. The p-value is P(χ92≥10)≈0.3505. Since 0.3505>0.05 (assuming α=0.05), we fail to reject H0. There is insufficient evidence to conclude that the population digit probabilities differ from 0.10 each. The observed statistic (10.00) is below the critical value of 16.919 for α=0.05 and df=9 291.
8.8 Independence: two variables for each person
The chi-square test for independence investigates whether there is an association between two categorical variables in a population. Data are typically arranged in a contingency table 293.
- Null hypothesis (H0): The two variables are independent in the population.
- Alternative hypothesis (Ha): The two variables are associated in the population.
- Interpretation: Independence implies that the population proportions for one variable are the same across all categories of the other variable. An association does not necessarily imply a causal relationship 295.
8.9 Expected counts: the general formula
For a test of independence, the expected count for each cell in a contingency table is calculated based on the assumption of independence 297.
- Formula: Eij=nRiCj, where Ri is the total for row i, Cj is the total for column j, and n is the overall total sample size.
- Calculation: Multiply the row total by the column total for a specific cell, then divide by the overall total.
📝 In an opinion poll with 100 males and 100 females, 110 people were "For" a proposed law, 70 were "Against", and 20 were "Undecided" 294.
- The proportion "For" in the whole sample is 200110=0.55.
- Under H0 (independence), the expected count for "Male, For" would be 100×0.55=55.
- The expected count for "Male, Against" is Emale,against=200100×70=35.
- The expected counts for the opinion poll are shown in the table below 298:
| Recorded group | For | Against | Undecided | Total |
|---|---|---|---|---|
| Male | 55 | 35 | 10 | 100 |
| Female | 55 | 35 | 10 | 100 |
| Total | 110 | 70 | 20 | 200 |
8.10 Independence: degrees of freedom
For an r×c contingency table (where r is the number of rows and c is the number of columns, excluding total rows/columns), the degrees of freedom are calculated as df=(r−1)(c−1) 299.
📝 For the 2×3 opinion poll table, df=(2−1)(3−1)=1×2=2.
8.11 Opinion poll: decision and conclusion
After calculating the χobs2 statistic, a decision is made by comparing it to the chi-square distribution 301.
📝 For the opinion poll, the χobs2 is approximately 2.3377 with df=2. The p-value is P(χ22≥2.3377)≈0.3107. At α=0.05, we fail to reject H0 because 0.3107>0.05. There is insufficient evidence of an association between opinion and recorded gender category in the population. This does not prove that the variables are independent.
8.12 Independence and homogeneity
The tests for independence and homogeneity share the same statistical methods but differ in their sampling setup and the question they address 302.
| Test | Sampling setup | Question |
|---|---|---|
| Independence | One sample, two variables recorded for each person | Are the variables associated? |
| Homogeneity | Separate samples from different populations or groups | Are the category proportions the same? |
Both tests use the same expected count formula (Eij=RiCj/n), the same Pearson chi-square statistic, and the same degrees of freedom formula (df=(r−1)(c−1)) 302.
8.13 A checklist for either test
A systematic approach helps ensure all necessary steps are covered for chi-square tests 303.
- Identify the type of test: goodness of fit, independence, or homogeneity.
- State the null hypothesis (H0), alternative hypothesis (Ha), and the significance level (α).
- Calculate the expected counts under H0.
- Check sampling assumptions and the condition that all expected counts are at least 5.
- Compute the chi-square statistic ∑E(O−E)2 and the correct degrees of freedom (df).
- Find the right-tail p-value and state the conclusion in the context of the problem.
8.14 Practice: goodness of fit
📝 A spinner has four categories (A, B, C, D). In 100 independent spins, the observed counts are A: 40, B: 20, C: 20, D: 20. At α=0.05, test whether all four population probabilities are equal 304.
- Hypotheses and expected counts:
- H0:pA=pB=pC=pD=0.25.
- Ha: At least one probability differs.
- Expected count for each category: Ei=100×0.25=25.
- Statistic and degrees of freedom:
- χobs2=25(40−25)2+25(20−25)2+25(20−25)2+25(20−25)2=25152+3×25(−5)2=25225+3×2525=9+3=12.
- df=k−1=4−1=3.
- Decision:
- The p-value is P(χ32≥12)≈0.0074.
- Since 0.0074<0.05, reject H0. There is sufficient evidence that the four category probabilities are not all equal 305.
8.15 The formulas side by side
| — | Goodness of fit | Independence / homogeneity |
|---|---|---|
| Expected count | Ei=npi | Eij=RiCj/n |
| Degrees of freedom | k−1 | (r−1)(c−1) |
| Statistic | ∑(O−E)2/E | ∑(O−E)2/E |
| Rejection tail | Right | Right |
For the goodness-of-fit formula, category probabilities are specified in advance. A large discrepancy provides evidence against H0, while a small discrepancy does not prove H0 306.
8.16 Optional reference: the multinomial model
The multinomial model describes n independent trials, each with the same category probabilities p1,…,pk, where ∑pi=1 and ∑Oi=n. It is a generalization of the binomial model for two or more categories.
The probability of observing a specific set of counts (O1,…,Ok) is given by 307:
P(O1,…,Ok)=O1!⋯Ok!n!∏i=1kpiOi This factorial formula is not needed to calculate the Pearson chi-square statistic 307.
© 2026 Maeve. All rights reserved. This content is protected by copyright.