Upload
stalin-armijos
View
230
Download
1
Embed Size (px)
Citation preview
8/18/2019 Two Samples Z-test
1/14
Two Samples z-testWe know how to deal with one sample z-test.
Now we look at two independent samples.
8/18/2019 Two Samples Z-test
2/14
Introduction
•Suppose we want to compare two samples: lookdiference between their averages.
• or e!ample: in bo! "# the average is $$%# and tthe bo! is (%.
• In bo! )# the average is *%# and the S& is +%.
• Now we draw one sample at random independen'rom each o' the bo!es.
• rom bo! "# +%% draws are made.
• rom bo! )# $%% draws are made.
8/18/2019 Two Samples Z-test
3/14
Introduction
• Then in bo! "# the S 'or average is .• In bo! )# the S 'or average is .
• Since we want to look at the diference betweenaverages# we rst can gure out the e!pecteddiference: $$% / *% 0 1%.
• )ut we need the S 'or diference# and it is not 2udiference between the Ss 'or average.
• The standard error 'or the diference o' two inde3uantities is # where is the S 'or the rst 3uantis the S 'or the second.
• So in this e!ample# the S 'or the diference is .
•
8/18/2019 Two Samples Z-test
4/14
Introduction
•
I' the sample average 'rom bo! " is $1%# and the sampaverage 'rom bo! ) is *5.
• Then we can detect whether the diference between thaverages o' the two independent samples is due to chnot.
• Since it is about the average or sum o' the bo!# we ca
z-test.• 6ecall the z-statistic can be computed b, .
• rom the two sample averages# we see that the observdiference is $1% / *5 0 15. So # and 'rom the normal t7-value is about $(8# not signicant.
• There'ore# the diference is due to chance.
•
8/18/2019 Two Samples Z-test
5/14
!ample $
•
The National "ssessment o' ducation 7rogress 9N"7monitors trends in school per'ormance.
• ach ,ear# N"7 administers tests on several sub2ects nationwide sample o' $;-,ear-olds who are in school. Treading test was given in $**% and again in 1%%+.
• The average score went down 'rom 1*% to 1
8/18/2019 Two Samples Z-test
6/14
!ample $
•
To set up a test o' signicance# we rst make the null h,p• The average score in 1%%+ was e3ual to the average scor
$**%.
• Then the alternative h,pothesis is: the average score wen
• We use the z-statistic dened b, .
• )ased on the null# we see that the e!pected diference is observed diference is 1
8/18/2019 Two Samples Z-test
7/14
!ample $
•
inall,# . That is# the diference between 1%%+ anwas about 1.< Ss below the value e!pected on
• The 7-value is about %.158 9? $8# which is highsignicant.
• So we re2ect the null# and conclude that the aver
score did go down.
• Note: @ore detailed anal,sis o' the data suggesteach e!tra ,ear o' schooling is associated with a(-point increase test scores. " 5-point decline is
worrisome.
•
8/18/2019 Two Samples Z-test
8/14
!ample 1
• In $***# N"7 'ound that $>8 o' the $;-,ear-oldstudents had taken calculus# compared to $;8 i
• Suppose the, took a simple random sample o' s$#%%% in each time.
• Is the diference real# or due to chance=
8/18/2019 Two Samples Z-test
9/14
!ample 1
•
To set up a test o' signicance# we then make the nuh,pothesis:
• The percentage in 1%%+ was e3ual to the percentage
• The alternative is: the percentage in 1%%+ increased.
• "gain# we use the z-statistic b, .
•)ased on the null# the e!pected diference is %8.
• The observed diference is $;8 - $>8 0 +8.
• We compare the percentages o' two %-$ bo!es# the co' the bo!es can be estimated: in 1%%+# the S 'orpercentage is A in $***# similarl,# the S 'or percentaabout $.$8.
•
8/18/2019 Two Samples Z-test
10/14
!ample 1
•
So the S 'or diference is .• inall,# the z statistic is about .
• There'ore# 'rom the normal table# the 7-value is %.(8# which is highl, signicant.
• "gain# we re2ect the null and conclude that the
percentage in 1%%+ increased.
•
8/18/2019 Two Samples Z-test
11/14
!ample >
•
The model can also be applied to 9randomized controle!periments:
• There are 1%% sub2ects in a small clinical trial on vitam
• Cal' the sub2ects are assigned at random to treatmentmg o' vitamin B dail, and hal' to control 91#%%% mg o'placebo.
• Dver the period o' the e!periment# the treatment grouaveraged 1.> colds# and the S& was >.$.
• The controls did a little worse: the, averaged 1.( coldS& was 1.*.
• E: Is the diference in averages statisticall, signicant
8/18/2019 Two Samples Z-test
12/14
!ample >
•
To set up a test o' signicance# we again start wnull h,pothesis:
• There is no diference between the treatment grcontrol group. The average colds are e3ual to eaother.
•
Then the alternative h,pothesis is: the vitamin Band the treatment group reall, does better. The colds in the treatment group is essentiall, lowerthe control group.
• "gain# we use the z-test# .
•)ased on the null# the e!pected diference is %.
•
8/18/2019 Two Samples Z-test
13/14
!ample >
• The observed diference is 1.> / 1.( 0 -%.>.
• Now 2ust pretend that we have two independent sadrawn at random with replacement. The S 'or thetreatment average is . The S 'or the control avera Then the S 'or the diference is about .
• inall,# the z statistic is about .
• There'ore# 'rom the normal table# the 7-value is abwhich is 'ar awa, 'rom 58.
• Then we can conclude that the diference could bedue to chance# and vitamin B has no efect. 9" 'ewsusceptible people were assigned to the control gr
•
8/18/2019 Two Samples Z-test
14/14
6emark
•
In e!ample ># there are 1 problems in dealing wiS:
• $. The draws are made without replacement. 9Inthe S.
• 1. The two averages are dependent. 9Buts the S
down.
• )ut the computation can still be applied# even ththere are problems. This is because these two prcancel out each other.
• There'ore# the two-sample z-test here still applie