Lecture 41 - Hypothesis Testing - Chi-Square
Lecture 41 - Hypothesis Testing - Chi-Square
&
Applied Probability
Credits: 3
1
Motivation for Chi-square
In hypothesis testing with t-tests and z-tests, we
have been comparing sample means to population
means.
Decision making based on errors (Type I and Type
II) and significance.
3
Chi-square Test
Chi-square is mainly used in two scenarios.
4
Chi-square – Degree of Freedom
The degree of freedom for the chi-square distribution for a r
by c table is
5
Chi-square Test – Example
Suppose that after losing a large amount of money, an
unlucky gambler questions whether the game was fair and
the die was really unbiased.
6
Chi-square Test – Example
Step1 – Define the hypothesis:
7
Chi-square Test – Example
Step2 – Do the experiment:
The last 90 tosses of this die gave the following results:
8
Chi-square Test – Example
Step3 – Calculate the Chi-square test:
10
Independence Analysis using Chi-square
Given the two way table, test whether the column and row
are independent.
11
Independence Analysis using Chi-square
The theoretical expected values if independent.
12
Chi-square Test – Example
Step1 – Define the hypothesis:
13
Chi-square Test – Example
Step3 – Calculate the Chi-square test:
For boys
For girls
Total chi-square X2
14
Chi-square Test – Example
Step4 – find the critical value:
df = (r – 1) x (c - 1) = (3 – 1) x (2 – 1) 2
significance level α = 0.05
look in the chi-square table for df = 2 and α = 0.05
16
Variance Estimation
17
Chi-square – Sample Variance Distribution
When observations X1, . . . , Xn are independent and Normal with
Var(Xi) = σ2 , the distribution of
18
Chi-square – Confidence Interval for
Population Variance
19
Critical Values of Chi-square Distribution
20
Conf Intervals: Variance and std deviation
Since we want a confidence interval, we need to state that:
Multiply by (𝑛−1)𝑠2
21
Example
Let we have a measurement device giving the data (n=6
measurements) as found below. Construct 90% confidence
interval for the standard deviation.
22
Example – Solution