week10_chi-square

Download Report

Transcript week10_chi-square

Hypothesis testing &
Chi-square
COMM 420.8
Nan Yu
Fall 2007
1
Warming up
 Download “ChisquareData” to your desk top.
 Download Review Practice to your desk top.
 Double click to open the SPSS file
 Please complete the questions in the file of
“Review Practice.”
*Dataset was from Pew Research Center. Survey
was conducted in Feb, 2007
2
Missing values
How to define the “missing value” in
SPSS ?
Click here
Select Discrete missing values.
Enter the defined missing values.
3
From descriptive statistics to inferential
statistic
Inferential statistic provided answer to the
question:
Is what we have observed in the sample are
true in the population (in reality)?
How do we know?
4
First: Specifying the hypothesis to test
Hypothesis:
The attitude toward whether to keeping troops in Iraq or
bring troops home would vary as a result of party
affiliation (republican v. democrats).
5
Second: Levels of Measurement
Are both IV and DV nominal?
If Yes,
Chi-Square Test
2
6
SPSS and Chi-Square
Open Chi-Square Data
 Locate the variable “party” in the variable view of SPSS. Click
the gray button in the column of “missing’
 Define missing values “3, 4, 5, 9”
7
Descriptive  Crosstabs
Click Statistic: Choose Chi-square
Click Cells: select column percentages
Click OK
8
Crosstabulation
We can observe a difference between republicans and democrats.
What was this difference really happened in a great population or
it was something only existing in this sample?
9
Chi-Square
Chi-Square Value
(test statistic)
Degrees of
Freedom
Significance
Level
10
Significant Level (p-value, or alpha level)
.000 level of significance means:
1.Probability that results happened by
chance < .001.
2. Chance of being wrong < .001.
3. The probability that the results are a
“fluke.”
11
Significant level (cont’)
Three commonly-used accepted significant levels
p < .05 (SPSS default)
p < .01
p < .001
The smaller the p-value, the more significant the result is said to be.
The smaller the p-values, the more unlikely the result have occurred by chance.
If you want to make extra sure that you reject the null
only when you’re very likely to be correct, do you
chose a large or small accepted p-value?
12
Table example
% of attitude toward plans for U.S. troops in Iraq
Republican
Democrat
Keep troops in Iraq
78.60%
24.10%
Bring troops home
21.40%
75.90%
2 (1, N=862) = 254.56, p < .001.
13
Chart example
14
Interpret the result
What we have proposed: The attitude toward whether to
keeping troops in Iraq or bring troops home would vary as a
result of party affiliation (republican v. democrat).
The chi-square test showed that the attitude toward
whether to keeping troops in Iraq or bring troops
home significantly varied as a result of party affiliation,
2 (1, N=862) = 254.56, p < .001.
A significantly large percentage of Republicans (78.6%)
thought the U.S. should keep the troops in Iraq,
whereas a significantly large percentage of
Democrats (75.9%) thought the country should bring
the troops home.
15
Hypothesis and Null Hypothesis
H1: The attitude toward whether to keeping
troops in Iraq or bring troops home would vary
as a result of party affiliation (republican v.
democrat).
(We want to detect a difference here.)
Null: The attitude toward whether to keeping
troops in Iraq or bring troops home would NOT
vary as a result of party affiliation (republican v.
democrat).
(We don’t want to detect a difference here)
16
Reject the null
The general goal of inferential statistical analysis is to
REJECT THE NULL
=
Reject that there is no relationship between two variables
17
Type I Error (α error)
 When researchers successful reject the null, but
if fact they should not.
 When researchers claims that there is a
relationship between two variables but actually it
doesn’t exists in reality.
 Plainly speaking, it occurs when we are
observing a difference when in truth there is
none.
18
Type I Error
Example:
Researcher found that Freshmen skip more classes
than older students.”
Reality: Freshmen don’t skip more classes.
19
Turn to page 336 of the text
The larger the sample size, the smaller the
chance of committing Type I error.
20
Probability of Committing a Type I error
What’s the probability of committing a
Type I error?
The significance level (alpha risk, p
value).
If accepted p-value is .05, chances are 5
in 100 of committing a Type 1 error.
21
Type II Error
 When researchers failed to reject the null, but if
fact they should.
 When researchers claims that there is no
relationship between two variables but actually it
does exist.
 Plainly speaking, it occurs when we are NOT
observing a difference when in truth there is a
different.
22
Type II error (β errors)
Example
Researcher found that diet is not related to
heart disease.
Reality: Diet is related to heart disease.
23
24
What Researcher Does
Not Reject
the Null
Reject
the Null
Reality
Type I Error
Rejects
the Null
Not Reject
the Null
X
X
Type II Error
25
Revisit the crosstabulation
We can observe a difference between republicans and democrats.
26
Revisit the Chi-square test
Degrees of
Freedom
Chi-Square Value
(test statistic)
2
Significance
Level
N
(1, N=862) = 254.56, p < .001.
We have successfully rejected the null because 1) data are consistent with predictions,
and if 2) obtained p value less than accepted significance level
Note: we always need test statistic, df, N to determine the significance level
27
Formula to calculator Chi-square
Observed value
 
2
=
Expected value
(O - E)
E
2
28
Degree of freedom
Number of Scores Free to Vary
(How many boxes do I have
to fill in before you can fill in the rest?)
Republican
Keep troop in Iraq
Democrat
400
100
300
Bring troops home
Total
Total
400
500
29
Chi-Square practice 1
Use the data set of “ChisquareData”
Test the hypothesis:
The attitude toward George W. Bush (q1)
would vary as a result of party affiliation
(party).
31
Report your findings for
 What is the percentage of republicans who
approve the way Bush is handling his job as
president?
 What is the percentage of Democrats who
disapprove the way Bush is handling his job as
president?
 Report the chi-square test statistics, degree of
freedom, valid N, and significant level in a
proper format.
 Can we reject the null for this hypothesis?
32
Chi-Square practice 2
Use the data set of “ChisquareData” to
test the hypothesis:
The attitude toward War in Iraq (q37) would
vary as a result of whether or not people
believe in Christianity (chr).
33
Report your findings for
 What is the percentage of Christian who think U.S. made
a wrong decision in using military force against Iraq?
 What is the percentage of people who are not Christian
and also think U.S. made a wrong decision in using
military force against Iraq?
 Report the chi-square test statistics, degree of freedom,
valid N, and significant level in a proper format.
 Can we reject the null for this hypothesis?
34
Answers to practice 1
 What is the percentage of republicans who approve the
way Bush is handling his job as president?
80.3%
 What is the percentage of Democrats who disapprove
the way Bush is handling his job as president?
90.6%
 Report the chi-square test statistics, degree of freedom,
valid N, and significant level in a proper format.
2 (1, N=841) = 432.70, p < .001.
 Can we reject the null for this hypothesis?
Yes, the null can be reject at the .001 significant level.
35
Answers to practice 2
 What is the percentage of Christian who think U.S. made a wrong
decision in using military force against Iraq?
57.1%
 What is the percentage of people who are not Christian and also
think U.S. made a wrong decision in using military force against Iraq?
89.7%
 Report the chi-square test statistics, degree of freedom, valid N, and
significant level in a proper format.
2 (1, N=71) = 8.71, p < .01.
 Can we reject the null for this hypothesis?
Yes, we can reject the null at the .01 significant level.
36