Minitab Demonstration for Chi-Square Goodness of Fit Test and Chi-Square Test of Independence.doc

advertisement
Chi-Square Test of Independence
H0: The two variables are independent
Ha: The two variables are dependent
Test Statistic:
2=
(observed cell count - expected cell count) 2

expected cell count
all
cells
Rejection Region: Reject Ho if
2
>
 2
, (r -1 )(c -1 )
NOTE: This test is valid as long as every expected cell count is at least 5.
Example Opinion polls often provide information on how different groups’ opinions vary on controversial issues. A random sample
of 102 registered voters was taken from the Supervisor of Election’s roll. Each of the registered voters was asked the following two
questions:
1. What is your political party affiliation?
2. Are you in favor of increased arms spending?
The results are summarized in the table below.
Opinion
Favor
No favor
Democrat
16
24
Party
Republican
21
17
None
11
13
Conduct test to determine if opinion and party affiliation are related in the population. Use =.05.
IN MINITAB:
ENTERING THE DATA:
Party
Democrat
Democrat
Republican
Republican
None
None
Opinion
Favor
Not In Favor
Favor
Not In Favor
Favor
Not In Favor
Count
16
24
21
17
11
13
COMMANDS:
STAT> TABLES> CROSS-TABULATION > CLASSIFICATION VARIABLES PARTY OPINION
FREQUENCIES ARE IN COUNT
CLICK ON CHI-SQUARE ANALYSIS – ABOVE AND EXPECTED
COUNT
OUTPUT:
Democrat
None
Republic
All
Favor Not In F
16
24
18.82
21.18
11
13
11.29
12.71
21
17
17.88
20.12
48
54
48.00
54.00
All
40
40.00
24
24.00
38
38.00
102
102.00
Chi-Square = 1.841, DF = 2, P-Value = 0.398
H0: Party affiliation and Opinion regarding increased arms spending are independent
Ha: Party affiliation and Opinion regarding increased arms spending are dependent (related)

Calculate test statistic: 
p-value 

Since p-value > , we fail to reject H0. The sample data do not provide sufficient evidence to conclude that party affiliation and
opinion regarding increased arms spending are related in the population.

Chi-Square Goodness-of-Fit Test
H0:
1 = hypothesized population proportion for category 1
.
.
.
k = hypothesized population proportion for category k
Ha:
H0 is not true, so at least one of the category proportions differs from the corresponding hypothesized value.
Test Statistic:
2=
(observed cell count - expected cell count) 2

expected cell count
Rejection Region: Reject H0 if
2
>
 2
, k -1
NOTE: This test is valid as long as every expected cell count is at least 5.
Example In previous presidential elections in a given locality, 50% of the registered voters were Republicans, 40% were Democrats, and 10% were
registered as independents. Prior to the upcoming election, a random sample of 200 registered voters showed that 90 were registered as Republicans,
80 as Democrats, and 30 as independents. Is there sufficient evidence to conclude that the distribution of registered voters is different from that in
previous election years. Use =.01.
In Minitab Spreadsheet:
C1
90
80
30
C2
0.5
0.4
0.1
COMMANDS:
STAT> TABLES> Chi-Square Goodness-of-Fit Test > Observed counts C1 > specific proportions C2
Chi-Square Goodness-of-Fit Test for Observed Counts in Variable: C1
Category
1
2
3
N
200
DF
2
Observed
90
80
30
Chi-Sq
6
Test
Proportion
0.5
0.4
0.1
Expected
100
80
20
Contribution
to Chi-Sq
1
0
5
P-Value
0.050
R = the proportion of all of this year’s registered voters that are Republicans
D = the proportion of all of this year’s registered voters that are Democrats
I = the proportion of all of this year’s registered voters that are Independents
H0:
R = .5
D = .4
I = .1
Ha:
H0 is not true, so at least one of the category proportions differs from the corresponding hypothesized value.
=.01
Calculate test statistic: 
p-value 

Since p-value > , we fail to reject H0. The sample data do not provide sufficient evidence to conclude that the distribution of registered voters in the
given locality is different from that in previous election years.
Download