lecture 8 (hypothesis testing 2)
TRANSCRIPT
-
8/2/2019 Lecture 8 (Hypothesis Testing 2)
1/31
Hypothesis Testing 2
Testing Percentages and
differences of means
-
8/2/2019 Lecture 8 (Hypothesis Testing 2)
2/31
Test of Population Proportion
You will often have sample survey datathat shows that a percentage of peoplesaid yes to a question
A test of a population proportion will allowyou to test whether your sample evidenceis likely to represent the true population
percentage who would say yes to thequestion
-
8/2/2019 Lecture 8 (Hypothesis Testing 2)
3/31
Test of Population Proportion Testing a population proportion (), using
a sample proportion (P)
Only difference is the standard error ofproportions SE(p) measured using:
SE(p) = ({(1- )}/n)
z calculation using: z = (P - )/SE(p)
-
8/2/2019 Lecture 8 (Hypothesis Testing 2)
4/31
Example
Career unit claims 50% of population ofgraduates have a job by June. Samplen=30 gives p = 33%
Test the hypothesis that careers unitclaims are correct.
Ho: 0.5 Ha: < 0.5
Significance level = 0.05
-
8/2/2019 Lecture 8 (Hypothesis Testing 2)
5/31
Critical value z = -1.65 SE(p) = [(0.5)(0.5)/30] = 0.09 as p = 0.33, converts to z score
z = (0.33-0.5)/0.09 = -1.88 z = -1.88 < -1.65 so is in the rejection
region
Reject Ho. Accept Ha: less than 50% ofgraduates have a job by June
-
8/2/2019 Lecture 8 (Hypothesis Testing 2)
6/31
= 0.5
= 0
Sampling Dist Proportions
Standard Normal
1
SEp
ps
Zs
-1.65
p=0.33
5% of lowest ps inrejection region
-1.88
-
8/2/2019 Lecture 8 (Hypothesis Testing 2)
7/31
Tests of differences of means
Suppose have sample wage data on twodifferent companies and the two samplemean wages are different
A test of difference of means lets you testwhether the observed difference betweensample means indicates the samples were
drawn from the same population ordifferent populations with different means
-
8/2/2019 Lecture 8 (Hypothesis Testing 2)
8/31
Tests of significant difference
Test for differences between twosample means
Requires SE(differences of means) If both samples are drawn from the
same population, a large difference
between sample parameters is unlikely
-
8/2/2019 Lecture 8 (Hypothesis Testing 2)
9/31
0
= 0
Sampling Dist Diff of means
Standard Normal
1
SE (x1 -x2)
(x1 -x2)s
Zs
-1.96
2.5% of highest (x1 -x2)sin the rejection region
1.96
-
8/2/2019 Lecture 8 (Hypothesis Testing 2)
10/31
A test of differences of means
Sample data on daily wages from 2 firms(1 and 2) shows:
n1 = 30, x1 = 180, s1 = 14
n2 = 40, x2 = 170, s2 = 10 Does the evidence show firm 1 pays a
higher mean daily wage
This difference could be due to chancerather than a distribution difference
-
8/2/2019 Lecture 8 (Hypothesis Testing 2)
11/31
Doing the test
Set up the hypotheses as a 2 tailed test
The population means for each sampleare either the same (both sample meanscome from the same population) or theyare not the same and hence come fromdifferent populations with different
population means soHo: 1 = 2 H1: 1 2
-
8/2/2019 Lecture 8 (Hypothesis Testing 2)
12/31
The critical value for the test
Choose a significance level
If the level is 5%, = 0.05
For a 2 tailed test, the probability in eachtail 0.025
As both samples, n > 30, we can use a Z
score for the test Critical value of Z = 1.96 from the tables
-
8/2/2019 Lecture 8 (Hypothesis Testing 2)
13/31
The test statistic
We want to test whether the differencebetween the means is significantlydifferent from zero
The test statistic is therefore
Z = (x1 -x2)(1 - 2) / SE(x1 -x2)
Z = (x1 -x2) / SE(x1 -x2)
SE(x1 -x2) is the SE of the difference ofmeans
-
8/2/2019 Lecture 8 (Hypothesis Testing 2)
14/31
To calculate SE(x1 -x2)
SE(x1 -x2) = (21 + 22)n1 n2
If n1 and n2 > 30 use sample standarddeviation values if 21
22 are unknown
SE = [(14)2/30 + (102)/40]SE = 3.01
-
8/2/2019 Lecture 8 (Hypothesis Testing 2)
15/31
Calculating the test statistic
Z = (x1 -x2) / SE(x1 -x2)
Z = (180 170)/3.01 = 10/3.01 = +3.32
Compare Z score to the critical value =+1.96
+3.32 > + 1.96
Z score is in the top rejection region of thedistribution
Ho is rejected
-
8/2/2019 Lecture 8 (Hypothesis Testing 2)
16/31
0
= 0
Sampling Dist Diff of means
Standard Normal
1
SE (x1 -x2)
(x1 -x2)s
Zs
-1.96
2.5% of highest (x1 -x2)sin the rejection region
1.96 3.32
-
8/2/2019 Lecture 8 (Hypothesis Testing 2)
17/31
Interpretation
Rejecting Ho: 1 = 2
The observed difference of sample meanwages is not due to chance
We reject the idea that our two samples ofdaily wages were drawn from the samepopulation of wages with only 1 populationmean wage
-
8/2/2019 Lecture 8 (Hypothesis Testing 2)
18/31
Interpretation
Accepting H1: 1 2 means that thesamples were drawn from 2 differentpopulations of data
The observed difference of sample meansis significant and reflects a difference inthe population means from which theywere drawn
It is likely that firm 1 pays more than firm 2on average
-
8/2/2019 Lecture 8 (Hypothesis Testing 2)
19/31
USING EXCEL
Use Data Analysis add-in under tools
Choose z test: two sample for means
or if either sample is smaller than 30 choose
t test:two sample assuming equalvariances
Highlight variable range for first sample
Highlight variable range for second sample
Choose sig level.
-
8/2/2019 Lecture 8 (Hypothesis Testing 2)
20/31
Difference of proportions
A similar test can be done when you havedata on 2 samples which give 2 sampleproportions or percentages
You can test whether the observeddifference in proportions is due to chanceor due to differences in the populationsfrom which the samples were drawn, theonly difference is the standard error of thedifference of proportions
-
8/2/2019 Lecture 8 (Hypothesis Testing 2)
21/31
0
= 0
Sampling Dist Diff ofproportions
Standard Normal
1
SE(p1-p2)
(p1 -p2)s
Zs
2.5% of lowest (p1 - p2)sin the rejection region
-
8/2/2019 Lecture 8 (Hypothesis Testing 2)
22/31
The standard error of difference ofproportions
Standard error of diff proportions= SE (p1-p2)
p1 = sample 1 proportion
p2 = sample 2 proportion = estimated population proportion
SE (p1-p2) = [ (1- ) + (1- ) ]
n1 n2 = (n1p1 + n2p2)/ (n1 + n2)
-
8/2/2019 Lecture 8 (Hypothesis Testing 2)
23/31
An example
Data is available from 2 surveys of the %of households with smokers
n1 = 50 n2 = 50 and p1 = 20% p2 = 30%
Survey 2 shows a higher % of smokers butis this difference due to chance or due to adifference in the populations from whichthe 2 surveys were drawn?
-
8/2/2019 Lecture 8 (Hypothesis Testing 2)
24/31
The hypotheses and critical value
The null hypothesis, as before, is thatthere is no difference between thepopulation proportions from which the 2
samples were drawn (they are drawn fromthe same population
Ho: 1 = 2 H1: 1 2 For significance level = 0.01 (2 tailed) Z
critical value = + or 2.58
-
8/2/2019 Lecture 8 (Hypothesis Testing 2)
25/31
Calculating the SE (p1-p2)
= (n1p1 + n2p2)/ (n1 + n2)
= (50(0.20) + 50(0.30)/ (50 + 50) = 0.25
SE (p1-p2) = [ (1- ) + (1- ) ]n1 n2
SE (p1-p2) = [ 0.25(0.75) + 0.25(0.75) ]50 50
SE (p1-p2) = [ 0.00375 + 0.00375 ] = 0.087
-
8/2/2019 Lecture 8 (Hypothesis Testing 2)
26/31
Calculating test statistic
The test statistic Z = (p1 p2)/ SE (p1-p2)
Z = (0.20 0.30)/0.087= -0.10 / 0.087 = -1.15
Compare Z score to the critical Z value
-1.15 > -2.58, so Z test score is not in therejection region
We cannot reject Ho
-
8/2/2019 Lecture 8 (Hypothesis Testing 2)
27/31
0
= 0
Sampling Dist Diff ofproportions
Standard Normal
1
SE(p1-p2)
(p1 -p2)s
Zs
-2.58
0.5% of lowest (p1 - p2)sin the rejection region
-1.15
-
8/2/2019 Lecture 8 (Hypothesis Testing 2)
28/31
Interpretation
We accept the null Ho: 1 = 2 There is no difference between the
population proportions from which the
samples were drawn The apparent difference of proportions is
due to chance
Both samples are drawn from a populationof people with an estimated population of25% smokers
-
8/2/2019 Lecture 8 (Hypothesis Testing 2)
29/31
Final Points
You now know that observed sampledata values do not necessarily mean thatthe population also has this value
You also know that observed differencesbetween 2 sample values does notnecessarily mean that the difference issignificant
Be careful, observed patterns from sampledata may be due to chance. Test them.
-
8/2/2019 Lecture 8 (Hypothesis Testing 2)
30/31
Final Points
You now know that observed sampledata values do not necessarily mean thatthe population also has this value
You also know that observed differencesbetween 2 sample values does notnecessarily mean that the difference issignificant
Be careful, observed patterns from sampledata may be due to chance. Test them.
-
8/2/2019 Lecture 8 (Hypothesis Testing 2)
31/31
Final Points
You now know that observed sampledata values do not necessarily mean thatthe population also has this value
You also know that observed differencesbetween 2 sample values does notnecessarily mean that the difference issignificant
Be careful, observed patterns from sampledata may be due to chance. Test them.