SlideShare a Scribd company logo
Two-Sample Z Test 
Explanation
A two-sample Z test is used to compare the differences 
statistically between two sample proportions.
A two-sample Z test is used to compare the differences 
statistically between two sample proportions. 
Consider the following question:
A two-sample Z test is used to compare the differences 
statistically between two sample proportions. 
Consider the following question: 
Researchers want to test the effectiveness of a new anti-anxiety 
medication. In clinical testing, 64 out of 200 people 
taking the medication report symptoms of anxiety. Of the 
people receiving a placebo, 92 out of 200 report symptoms of 
anxiety. Is the medication working any differently than the 
placebo? Test this claim using alpha = 0.05.
What are the researchers asking here?
What are the researchers asking here? 
They are trying to determine if there is a difference in 
reported anxiety symptoms between those taking the 
new anti-anxiety drug and those taking the placebo.
What are the researchers asking here? 
They are trying to determine if there is a difference in 
reported anxiety symptoms between those taking the 
new anti-anxiety drug and those taking the placebo. 
What makes this question one that can be answered 
using a two-sample Z test is the fact that we are 
examining the difference between proportions (64 out 
of 200 or .32 compared to 92 out 200 or .46).
What are the researchers asking here? 
They are trying to determine if there is a difference in 
reported anxiety symptoms between those taking the 
new anti-anxiety drug and those taking the placebo. 
What makes this question one that can be answered 
using a two-sample Z test is the fact that we are 
examining the difference between proportions (64 out 
of 200 or .32 compared to 92 out 200 or .46). 
Are these differences similar enough to make any 
differences we would find if we were to repeat the 
experiment to be due to chance or not?
With that in mind, we are able to state the null-hypothesis 
and then determine if we will reject or fail 
to reject it:
With that in mind, we are able to state the null-hypothesis 
and then determine if we will reject or fail 
to reject it: 
There is NO significant proportional difference in 
reported anxiety symptoms between a sample of 
participants who took a new anti-anxiety drug and a 
sample who took a placebo.
Since the test uses a .05 alpha value, that is what we 
will use to determine if the probability of a meaningful 
difference is rare or common.
Since the test uses a .05 alpha value, that is what we 
will use to determine if the probability of a meaningful 
difference is rare or common. 
The alpha value makes it possible to determine what is 
called the z critical. If the z statistic that we are about 
to calculate from the data in the question is outside of 
the z critical [for a one-tailed test (e.g., +1.64) or a two-tailed 
test (e.g., -1.96 or +1.96]
One tailed test visual depiction: 
If the z value we 
are about to 
calculate lands 
above this point, 
we will reject the 
null hypothesis 
common rare 
+1.64
One tailed test visual depiction: 
common rare 
+1.64 
If the z value lands 
below this point 
we will fail to 
reject the null 
hypothesis
A one tailed test could also go the other direction if we 
are testing the probability of one sample having a 
smaller proportion than another. 
rare common 
-1.64
A two-tailed test implies that we are not sure as to 
which direction it will go. We don’t know if the 
placebo or the new anxiety medicine will have better 
results.
Here is a visual depiction of the two-tailed test. 
rare 
-1.96 
Common rare 
+1.96
All we have left to do now is calculate the z statistic.
All we have left to do now is calculate the z statistic. 
Here is the formula for the z statistic for a Two-Sample 
Z-Test: 
풁풔풕풂풕풊풔풕풊풄 = 
(푝 1 − 푝 2) 
푝 1 − 푝 
1 
푛1 
+ 
1 
푛2
In the numerator we are subtracting one sample 
proportion from another sample proportion: 
풁풔풕풂풕풊풔풕풊풄 = 
(푝 1 − 푝 2) 
푝 1 − 푝 
1 
푛1 
+ 
1 
푛2
In the numerator we are subtracting one sample 
proportion from another sample proportion: 
풁풔풕풂풕풊풔풕풊풄 = 
(푝 1 − 푝 2) 
푝 1 − 푝 
1 
푛1 
+ 
1 
푛2 
Researchers want to test the effectiveness of a new anti-anxiety 
medication. In clinical testing, 64 out of 200 people 
taking the medication report symptoms of anxiety. Of the 
people receiving a placebo, 92 out of 200 report symptoms of 
anxiety. Is the medication working any differently than the 
placebo? Test this claim using alpha = 0.05.
In the numerator we are subtracting one sample 
proportion from another sample proportion: 
풁풔풕풂풕풊풔풕풊풄 = 
(푝 1 − 푝 2) 
푝 1 − 푝 
1 
푛1 
+ 
1 
푛2 
Researchers want to test the effectiveness of a new anti-anxiety 
medication. In clinical testing, 64 out of 200 people 
taking the medication report symptoms of anxiety. Of the 
people receiving a placebo, 92 out of 200 report symptoms of 
anxiety. Is the medication working any differently than the 
placebo? Test this claim using alpha = 0.05.
In the numerator we are subtracting one sample 
proportion from another sample proportion: 
풁풔풕풂풕풊풔풕풊풄 = 
(푝 1 − 푝 2) 
푝 1 − 푝 
1 
푛1 
+ 
1 
푛2 
92/200=.46 
64/200=.32 
Researchers want to test the effectiveness of a new anti-anxiety 
medication. In clinical testing, 64 out of 200 people 
taking the medication report symptoms of anxiety. Of the 
people receiving a placebo, 92 out of 200 report symptoms of 
anxiety. Is the medication working any differently than the 
placebo? Test this claim using alpha = 0.05.
In the numerator we are subtracting one sample 
proportion from another sample proportion: 
풁풔풕풂풕풊풔풕풊풄 = 
(.32 − .46) 
푝 1 − 푝 
1 
푛1 
+ 
1 
푛2 
92/200=.46 
64/200=.32 
Researchers want to test the effectiveness of a new anti-anxiety 
medication. In clinical testing, 64 out of 200 people 
taking the medication report symptoms of anxiety. Of the 
people receiving a placebo, 92 out of 200 report symptoms of 
anxiety. Is the medication working any differently than the 
placebo? Test this claim using alpha = 0.05.
In the numerator we are subtracting one sample 
proportion from another sample proportion: 
풁풔풕풂풕풊풔풕풊풄 = 
(−. ퟏퟐ) 
푝 1 − 푝 
1 
푛1 
+ 
1 
푛2 
Researchers want to test the effectiveness of a new anti-anxiety 
medication. In clinical testing, 64 out of 200 people 
taking the medication report symptoms of anxiety. Of the 
people receiving a placebo, 92 out of 200 report symptoms of 
anxiety. Is the medication working any differently than the 
placebo? Test this claim using alpha = 0.05.
The denominator is the estimated standard error: 
풁풔풕풂풕풊풔풕풊풄 = 
(−.12) 
푝 1 − 푝 
1 
푛1 
+ 
1 
푛2 
This proportion is 
called the pooled 
standard deviation. 
It is the same value 
we use with 
independent 
sample t-tests. 
Researchers want to test the effectiveness of a new anti-anxiety 
medication. In clinical testing, 64 out of 200 people 
taking the medication report symptoms of anxiety. Of the 
people receiving a placebo, 92 out of 200 report symptoms of 
anxiety. Is the medication working any differently than the 
placebo? Test this claim using alpha = 0.05.
The denominator is the estimated standard error: 
풁풔풕풂풕풊풔풕풊풄 = 
(−.12) 
푝 1 − 푝 
1 
푛1 
+ 
1 
푛2 
It is interesting to note that when you multiply a 
proportion (.80) by its complement (1-.8 = .20) 
you get the variance (.80*.20 = .16). 
If you square that amount it comes to .04 and that 
is the standard deviation.
Why is this important? Because the standard deviation 
divided by the square root of the sample size is the 
standard error. 
풁풔풕풂풕풊풔풕풊풄 = 
(−.12) 
푝 1 − 푝 
1 
푛1 
+ 
1 
푛2 
It is interesting to note that when you multiply a 
proportion (.80) by its complement (1-.8 = .20) 
you get the variance (.80*.20 = .16). 
If you square that amount it comes to .04 and that 
is the standard deviation.
And the larger the standard error the less likely the two 
groups will be statistically significantly different. 
풁풔풕풂풕풊풔풕풊풄 = 
(−.12) 
푝 1 − 푝 
1 
푛1 
+ 
1 
푛2 
It is interesting to note that when you multiply a 
proportion (.80) by its complement (1-.8 = .20) 
you get the variance (.80*.20 = .16). 
If you square that amount it comes to .04 and that 
is the standard deviation.
Conversely, the smaller the standard error the more 
likely the two groups will be statistically significantly 
different. 
풁풔풕풂풕풊풔풕풊풄 = 
(−.12) 
푝 1 − 푝 
1 
푛1 
+ 
1 
푛2 
It is interesting to note that when you multiply a 
proportion (.80) by its complement (1-.8 = .20) 
you get the variance (.80*.20 = .16). 
If you square that amount it comes to .04 and that 
is the standard deviation.
So, let’s compute the pooled standard deviation: 
풑 1 − 풑
So, let’s compute the pooled standard deviation: 
풑 1 − 풑 풑 = 
푥1 + 푥2 
푛1 + 푛2
So, let’s compute the pooled standard deviation: 
풑 1 − 풑 풑 = 
푥1 + 푥2 
푛1 + 푛2 
Here’s the problem again: 
Researchers want to test the effectiveness of a new anti-anxiety 
medication. In clinical testing, 64 out of 200 people 
taking the medication report symptoms of anxiety. Of the 
people receiving a placebo, 92 out of 200 report symptoms of 
anxiety. Is the medication working any differently than the 
placebo? Test this claim using alpha = 0.05.
So, let’s compute the pooled standard deviation: 
풑 1 − 풑 풑 = 
푥1 + 푥2 
푛1 + 푛2 
Researchers want to test the effectiveness of a new anti-anxiety 
medication. In clinical testing, 64 out of 200 people 
taking the medication report symptoms of anxiety. Of the 
people receiving a placebo, 92 out of 200 report symptoms of 
anxiety. Is the medication working any differently than the 
placebo? Test this claim using alpha = 0.05.
So, let’s compute the pooled standard deviation: 
풑 1 − 풑 풑 = 
64 + 푥2 
푛1 + 푛2 
Researchers want to test the effectiveness of a new anti-anxiety 
medication. In clinical testing, 64 out of 200 people 
taking the medication report symptoms of anxiety. Of the 
people receiving a placebo, 92 out of 200 report symptoms of 
anxiety. Is the medication working any differently than the 
placebo? Test this claim using alpha = 0.05.
So, let’s compute the pooled standard deviation: 
풑 1 − 풑 풑 = 
64 + 푥2 
푛1 + 푛2 
Researchers want to test the effectiveness of a new anti-anxiety 
medication. In clinical testing, 64 out of 200 people 
taking the medication report symptoms of anxiety. Of the 
people receiving a placebo, 92 out of 200 report symptoms of 
anxiety. Is the medication working any differently than the 
placebo? Test this claim using alpha = 0.05.
So, let’s compute the pooled standard deviation: 
풑 1 − 풑 풑 = 
64 + 푥2 
200 + 푛2 
Researchers want to test the effectiveness of a new anti-anxiety 
medication. In clinical testing, 64 out of 200 people 
taking the medication report symptoms of anxiety. Of the 
people receiving a placebo, 92 out of 200 report symptoms of 
anxiety. Is the medication working any differently than the 
placebo? Test this claim using alpha = 0.05.
So, let’s compute the pooled standard deviation: 
풑 1 − 풑 풑 = 
64 + 푥2 
200 + 푛2 
Researchers want to test the effectiveness of a new anti-anxiety 
medication. In clinical testing, 64 out of 200 people 
taking the medication report symptoms of anxiety. Of the 
people receiving a placebo, 92 out of 200 report symptoms of 
anxiety. Is the medication working any differently than the 
placebo? Test this claim using alpha = 0.05.
So, let’s compute the pooled standard deviation: 
풑 1 − 풑 풑 = 
64 + 92 
200 + 푛2 
Researchers want to test the effectiveness of a new anti-anxiety 
medication. In clinical testing, 64 out of 200 people 
taking the medication report symptoms of anxiety. Of the 
people receiving a placebo, 92 out of 200 report symptoms of 
anxiety. Is the medication working any differently than the 
placebo? Test this claim using alpha = 0.05.
So, let’s compute the pooled standard deviation: 
풑 1 − 풑 풑 = 
64 + 92 
200 + 푛2 
Researchers want to test the effectiveness of a new anti-anxiety 
medication. In clinical testing, 64 out of 200 people 
taking the medication report symptoms of anxiety. Of the 
people receiving a placebo, 92 out of 200 report symptoms of 
anxiety. Is the medication working any differently than the 
placebo? Test this claim using alpha = 0.05.
So, let’s compute the pooled standard deviation: 
풑 1 − 풑 풑 = 
64 + 92 
200 + 200 
Researchers want to test the effectiveness of a new anti-anxiety 
medication. In clinical testing, 64 out of 200 people 
taking the medication report symptoms of anxiety. Of the 
people receiving a placebo, 92 out of 200 report symptoms of 
anxiety. Is the medication working any differently than the 
placebo? Test this claim using alpha = 0.05.
Add the fractions: 
풑 1 − 풑 풑 = 
64 + 92 
200 + 200
Add the fractions: 
풑 1 − 풑 풑 = 
156 
200 + 200
Add the fractions: 
풑 1 − 풑 풑 = 
156 
200 + 200
Add the fractions: 
풑 1 − 풑 풑 = 
156 
200
Add the fractions: 
풑 1 − 풑 풑 = .78
Now we plug this pooled proportion: 
풑 1 − 풑 풑 = .78
Now we plug this pooled proportion: 
풑 1 − 풑 풑 = .78 
into the standard error formula in the denominator
Now we plug this pooled proportion: 
풑 1 − 풑 풑 = .78 
into the standard error formula in the denominator
Now we plug this pooled proportion: 
.78 1−. ퟕퟖ 풑 = .78 
into the standard error formula in the denominator
Now we plug this pooled proportion: 
.78 .22 
into the standard error formula in the denominator
Now we plug this pooled proportion: 
. ퟏퟕퟐ 
into the standard error formula in the denominator
Now we plug this pooled proportion: 
푍푠푡푎푡푖푠푡푖푐 = 
(−. ퟏퟒ) 
. ퟏퟕퟐ 
1 
풏ퟏ 
+ 
1 
푛2 
Researchers want to test the effectiveness of a new anti-anxiety 
medication. In clinical testing, 64 out of 200 people 
taking the medication report symptoms of anxiety. Of the 
people receiving a placebo, 92 out of 200 report symptoms of 
anxiety. Is the medication working any differently than the 
placebo? Test this claim using alpha = 0.05.
Now we need to calculate n or the sample size: 
푍푠푡푎푡푖푠푡푖푐 = 
(−. ퟏퟒ) 
.172 
1 
200 
+ 
1 
푛 
Researchers want to test the effectiveness of a new anti-anxiety 
medication. In clinical testing, 64 out of 200 people 
taking the medication report symptoms of anxiety. Of the 
people receiving a placebo, 92 out of 200 report symptoms of 
anxiety. Is the medication working any differently than the 
placebo? Test this claim using alpha = 0.05.
Now we need to calculate n or the sample size: 
푍푠푡푎푡푖푠푡푖푐 = 
(−. ퟏퟒ) 
.172 
1 
200 
+ 
1 
200 
Researchers want to test the effectiveness of a new anti-anxiety 
medication. In clinical testing, 64 out of 200 people 
taking the medication report symptoms of anxiety. Of the 
people receiving a placebo, 92 out of 200 report symptoms of 
anxiety. Is the medication working any differently than the 
placebo? Test this claim using alpha = 0.05.
Now we need to calculate the Zstatistic 
푍푠푡푎푡푖푠푡푖푐 = 
(−. ퟏퟒ) 
.172 
1 
200 
+ 
1 
200 
Researchers want to test the effectiveness of a new anti-anxiety 
medication. In clinical testing, 64 out of 200 people 
taking the medication report symptoms of anxiety. Of the 
people receiving a placebo, 92 out of 200 report symptoms of 
anxiety. Is the medication working any differently than the 
placebo? Test this claim using alpha = 0.05.
Now we need to calculate the Zstatistic 
푍푠푡푎푡푖푠푡푖푐 = 
(−. ퟏퟒ) 
.172 
2 
200
Now we need to calculate the Zstatistic 
푍푠푡푎푡푖푠푡푖푐 = 
(−. ퟏퟒ) 
.172 
1 
100
Now we need to calculate the Zstatistic 
푍푠푡푎푡푖푠푡푖푐 = 
(−. ퟏퟒ) 
.172 .01
Now we need to calculate the Zstatistic 
푍푠푡푎푡푖푠푡푖푐 = 
(−. ퟏퟒ) 
.172 (.1)
Now we need to calculate the Zstatistic 
푍푠푡푎푡푖푠푡푖푐 = 
(−. ퟏퟒ) 
(.414) (.1)
Now we need to calculate the Zstatistic 
푍푠푡푎푡푖푠푡푖푐 = 
(−. ퟏퟒ) 
.0414
Now we need to calculate the Zstatistic 
푍푠푡푎푡푖푠푡푖푐 = −3.379
Let’s see where this lies in the distribution: 
rare 
-1.96 
Common rare 
+1.96
Let’s see where this lies in the distribution: 
rare 
-1.96 
Common rare 
-3.38 +1.96
Because -3.38 is outside the -1.96 range we consider it 
to be a rare occurrence and therefore we will reject the 
null hypothesis and accept the alternative hypothesis:
Because -3.38 is outside the -1.96 range we consider it 
to be a rare occurrence and therefore we will reject the 
null hypothesis and accept the alternative hypothesis: 
There was a significant difference in effectiveness between the 
medication group and the placebo group, z = -3.379, p < 0.05.
Because -3.38 is outside the -1.96 range we consider it 
to be a rare occurrence and therefore we will reject the 
null hypothesis and accept the alternative hypothesis: 
There was a significant difference in effectiveness between the 
medication group and the placebo group, z = -3.379, p < 0.05 
In summary 
A two-sample Z test is used to compare the differences 
statistically between two sample proportions.

More Related Content

PPTX
PPT
PDF
Statistical Distributions
PPT
Hypothesis
PPTX
Estimation and confidence interval
PPTX
Testing of hypothesis
PPT
F Distribution
PPTX
Kruskal Wall Test
Statistical Distributions
Hypothesis
Estimation and confidence interval
Testing of hypothesis
F Distribution
Kruskal Wall Test

What's hot (20)

PPTX
STATISTICS: Hypothesis Testing
PPTX
Goodness of fit (ppt)
PPTX
Elements of inferential statistics
PPTX
Hypothesis Testing
PPTX
Sign test
PPTX
PPT
oneway ANOVA.ppt
PPTX
Regression analysis
PDF
Confidence Intervals: Basic concepts and overview
PPTX
Inferential Statistics
PPTX
Inferential statistics
PPTX
The mann whitney u test
PPT
T Test For Two Independent Samples
PPT
One Sample T Test
PPTX
Inferential statistics
PPTX
Presentation On Regression
PPTX
Hypothesis testing ppt final
PPT
Small Sampling Theory Presentation1
PPTX
The Sign Test
STATISTICS: Hypothesis Testing
Goodness of fit (ppt)
Elements of inferential statistics
Hypothesis Testing
Sign test
oneway ANOVA.ppt
Regression analysis
Confidence Intervals: Basic concepts and overview
Inferential Statistics
Inferential statistics
The mann whitney u test
T Test For Two Independent Samples
One Sample T Test
Inferential statistics
Presentation On Regression
Hypothesis testing ppt final
Small Sampling Theory Presentation1
The Sign Test
Ad

Viewers also liked (20)

PPTX
It Presentation
PPTX
Identifying predictable patterns
PPTX
Reporting kendall's tau in apa (1)
PPTX
Are there ranked order ties or not?
PPTX
Is the relationship arbitrary or causal?
PPTX
Is it a sample to sample or a sample to population comparison?
PPTX
What is a Single Linear Regression
PPTX
What is a nonparametric method?
PPTX
What is a Kendall's Tau (independence)?
PPTX
Quick reminder ordinal or nominal tallied
PPTX
Identifying inconsistent patterns in Survey Responses
PPTX
Diff rel-ind-good fit( (practice problems)
PPTX
Sample to sample or sample to population
PPTX
Missing data eliminate cases
PPTX
Teach me ordinal or scaled (central tendency)
PPTX
Quick reminder ordinal, scaled or nominal proportional
PPTX
What is the Mode?
PPTX
How many variables are there?
PPTX
Differences between non parametric tests of independence
PPTX
Are there covariates?
It Presentation
Identifying predictable patterns
Reporting kendall's tau in apa (1)
Are there ranked order ties or not?
Is the relationship arbitrary or causal?
Is it a sample to sample or a sample to population comparison?
What is a Single Linear Regression
What is a nonparametric method?
What is a Kendall's Tau (independence)?
Quick reminder ordinal or nominal tallied
Identifying inconsistent patterns in Survey Responses
Diff rel-ind-good fit( (practice problems)
Sample to sample or sample to population
Missing data eliminate cases
Teach me ordinal or scaled (central tendency)
Quick reminder ordinal, scaled or nominal proportional
What is the Mode?
How many variables are there?
Differences between non parametric tests of independence
Are there covariates?
Ad

Similar to What is a two sample z test? (20)

PPTX
Calculating a two sample z test by hand
PPTX
Single sample z test - explain (final)
PDF
spss
PPTX
What is a Single Sample Z Test?
PPTX
Testing hypothesis (methods of testing the statement of organizations)
PPTX
STATISTICAL TESTS USED IN VARIOUS STUDIES
PPS
Lesson 10
PDF
inferentialstatistics-210411214248.pdf
PPT
Review_biostatistics and cohorts. Correlations
DOCX
PAGE O&M Statistics – Inferential Statistics Hypothesis Test.docx
PPTX
Calculating a single sample z test
PPT
Testing the hypothesis
PPTX
Calculating a single sample z test by hand
DOCX
Steps of hypothesis testingSelect the appropriate testSo far.docx
PPTX
Test of-significance : Z test , Chi square test
PPTX
Parametric test jdixhbdicndjxnxixhbdjxjxhxn
PDF
Bio-statistics definitions and misconceptions
PPTX
Intro to tests of significance qualitative
PPTX
Test of significance
PDF
Comparing-Sample-Proportion-and-Population-Proportion.pdf
Calculating a two sample z test by hand
Single sample z test - explain (final)
spss
What is a Single Sample Z Test?
Testing hypothesis (methods of testing the statement of organizations)
STATISTICAL TESTS USED IN VARIOUS STUDIES
Lesson 10
inferentialstatistics-210411214248.pdf
Review_biostatistics and cohorts. Correlations
PAGE O&M Statistics – Inferential Statistics Hypothesis Test.docx
Calculating a single sample z test
Testing the hypothesis
Calculating a single sample z test by hand
Steps of hypothesis testingSelect the appropriate testSo far.docx
Test of-significance : Z test , Chi square test
Parametric test jdixhbdicndjxnxixhbdjxjxhxn
Bio-statistics definitions and misconceptions
Intro to tests of significance qualitative
Test of significance
Comparing-Sample-Proportion-and-Population-Proportion.pdf

More from Ken Plummer (20)

PPTX
Diff rel gof-fit - jejit - practice (5)
PPTX
Learn About Range - Copyright updated
PPTX
Inferential vs descriptive tutorial of when to use - Copyright Updated
PPTX
Diff rel ind-fit practice - Copyright Updated
PPTX
Normal or skewed distributions (inferential) - Copyright updated
PPTX
Normal or skewed distributions (descriptive both2) - Copyright updated
PPTX
Nature of the data practice - Copyright updated
PPTX
Nature of the data (spread) - Copyright updated
PPTX
Mode practice 1 - Copyright updated
PPTX
Nature of the data (descriptive) - Copyright updated
PPTX
Dichotomous or scaled
PPTX
Skewed less than 30 (ties)
PPTX
Skewed sample size less than 30
PPTX
Ordinal (ties)
PPTX
Ordinal and nominal
PPTX
Relationship covariates
PPTX
Relationship nature of data
PPTX
Number of variables (predictive)
PPTX
Levels of the iv
PPTX
Independent variables (2)
Diff rel gof-fit - jejit - practice (5)
Learn About Range - Copyright updated
Inferential vs descriptive tutorial of when to use - Copyright Updated
Diff rel ind-fit practice - Copyright Updated
Normal or skewed distributions (inferential) - Copyright updated
Normal or skewed distributions (descriptive both2) - Copyright updated
Nature of the data practice - Copyright updated
Nature of the data (spread) - Copyright updated
Mode practice 1 - Copyright updated
Nature of the data (descriptive) - Copyright updated
Dichotomous or scaled
Skewed less than 30 (ties)
Skewed sample size less than 30
Ordinal (ties)
Ordinal and nominal
Relationship covariates
Relationship nature of data
Number of variables (predictive)
Levels of the iv
Independent variables (2)

Recently uploaded (20)

PPTX
Radiologic_Anatomy_of_the_Brachial_plexus [final].pptx
PDF
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
PDF
01-Introduction-to-Information-Management.pdf
PDF
Paper A Mock Exam 9_ Attempt review.pdf.
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
History, Philosophy and sociology of education (1).pptx
PDF
Practical Manual AGRO-233 Principles and Practices of Natural Farming
PDF
Updated Idioms and Phrasal Verbs in English subject
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PDF
Weekly quiz Compilation Jan -July 25.pdf
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
UV-Visible spectroscopy..pptx UV-Visible Spectroscopy – Electronic Transition...
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
Radiologic_Anatomy_of_the_Brachial_plexus [final].pptx
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
01-Introduction-to-Information-Management.pdf
Paper A Mock Exam 9_ Attempt review.pdf.
Supply Chain Operations Speaking Notes -ICLT Program
Final Presentation General Medicine 03-08-2024.pptx
History, Philosophy and sociology of education (1).pptx
Practical Manual AGRO-233 Principles and Practices of Natural Farming
Updated Idioms and Phrasal Verbs in English subject
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Microbial disease of the cardiovascular and lymphatic systems
2.FourierTransform-ShortQuestionswithAnswers.pdf
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
Weekly quiz Compilation Jan -July 25.pdf
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
STATICS OF THE RIGID BODIES Hibbelers.pdf
UV-Visible spectroscopy..pptx UV-Visible Spectroscopy – Electronic Transition...
202450812 BayCHI UCSC-SV 20250812 v17.pptx
Chinmaya Tiranga quiz Grand Finale.pdf

What is a two sample z test?

  • 1. Two-Sample Z Test Explanation
  • 2. A two-sample Z test is used to compare the differences statistically between two sample proportions.
  • 3. A two-sample Z test is used to compare the differences statistically between two sample proportions. Consider the following question:
  • 4. A two-sample Z test is used to compare the differences statistically between two sample proportions. Consider the following question: Researchers want to test the effectiveness of a new anti-anxiety medication. In clinical testing, 64 out of 200 people taking the medication report symptoms of anxiety. Of the people receiving a placebo, 92 out of 200 report symptoms of anxiety. Is the medication working any differently than the placebo? Test this claim using alpha = 0.05.
  • 5. What are the researchers asking here?
  • 6. What are the researchers asking here? They are trying to determine if there is a difference in reported anxiety symptoms between those taking the new anti-anxiety drug and those taking the placebo.
  • 7. What are the researchers asking here? They are trying to determine if there is a difference in reported anxiety symptoms between those taking the new anti-anxiety drug and those taking the placebo. What makes this question one that can be answered using a two-sample Z test is the fact that we are examining the difference between proportions (64 out of 200 or .32 compared to 92 out 200 or .46).
  • 8. What are the researchers asking here? They are trying to determine if there is a difference in reported anxiety symptoms between those taking the new anti-anxiety drug and those taking the placebo. What makes this question one that can be answered using a two-sample Z test is the fact that we are examining the difference between proportions (64 out of 200 or .32 compared to 92 out 200 or .46). Are these differences similar enough to make any differences we would find if we were to repeat the experiment to be due to chance or not?
  • 9. With that in mind, we are able to state the null-hypothesis and then determine if we will reject or fail to reject it:
  • 10. With that in mind, we are able to state the null-hypothesis and then determine if we will reject or fail to reject it: There is NO significant proportional difference in reported anxiety symptoms between a sample of participants who took a new anti-anxiety drug and a sample who took a placebo.
  • 11. Since the test uses a .05 alpha value, that is what we will use to determine if the probability of a meaningful difference is rare or common.
  • 12. Since the test uses a .05 alpha value, that is what we will use to determine if the probability of a meaningful difference is rare or common. The alpha value makes it possible to determine what is called the z critical. If the z statistic that we are about to calculate from the data in the question is outside of the z critical [for a one-tailed test (e.g., +1.64) or a two-tailed test (e.g., -1.96 or +1.96]
  • 13. One tailed test visual depiction: If the z value we are about to calculate lands above this point, we will reject the null hypothesis common rare +1.64
  • 14. One tailed test visual depiction: common rare +1.64 If the z value lands below this point we will fail to reject the null hypothesis
  • 15. A one tailed test could also go the other direction if we are testing the probability of one sample having a smaller proportion than another. rare common -1.64
  • 16. A two-tailed test implies that we are not sure as to which direction it will go. We don’t know if the placebo or the new anxiety medicine will have better results.
  • 17. Here is a visual depiction of the two-tailed test. rare -1.96 Common rare +1.96
  • 18. All we have left to do now is calculate the z statistic.
  • 19. All we have left to do now is calculate the z statistic. Here is the formula for the z statistic for a Two-Sample Z-Test: 풁풔풕풂풕풊풔풕풊풄 = (푝 1 − 푝 2) 푝 1 − 푝 1 푛1 + 1 푛2
  • 20. In the numerator we are subtracting one sample proportion from another sample proportion: 풁풔풕풂풕풊풔풕풊풄 = (푝 1 − 푝 2) 푝 1 − 푝 1 푛1 + 1 푛2
  • 21. In the numerator we are subtracting one sample proportion from another sample proportion: 풁풔풕풂풕풊풔풕풊풄 = (푝 1 − 푝 2) 푝 1 − 푝 1 푛1 + 1 푛2 Researchers want to test the effectiveness of a new anti-anxiety medication. In clinical testing, 64 out of 200 people taking the medication report symptoms of anxiety. Of the people receiving a placebo, 92 out of 200 report symptoms of anxiety. Is the medication working any differently than the placebo? Test this claim using alpha = 0.05.
  • 22. In the numerator we are subtracting one sample proportion from another sample proportion: 풁풔풕풂풕풊풔풕풊풄 = (푝 1 − 푝 2) 푝 1 − 푝 1 푛1 + 1 푛2 Researchers want to test the effectiveness of a new anti-anxiety medication. In clinical testing, 64 out of 200 people taking the medication report symptoms of anxiety. Of the people receiving a placebo, 92 out of 200 report symptoms of anxiety. Is the medication working any differently than the placebo? Test this claim using alpha = 0.05.
  • 23. In the numerator we are subtracting one sample proportion from another sample proportion: 풁풔풕풂풕풊풔풕풊풄 = (푝 1 − 푝 2) 푝 1 − 푝 1 푛1 + 1 푛2 92/200=.46 64/200=.32 Researchers want to test the effectiveness of a new anti-anxiety medication. In clinical testing, 64 out of 200 people taking the medication report symptoms of anxiety. Of the people receiving a placebo, 92 out of 200 report symptoms of anxiety. Is the medication working any differently than the placebo? Test this claim using alpha = 0.05.
  • 24. In the numerator we are subtracting one sample proportion from another sample proportion: 풁풔풕풂풕풊풔풕풊풄 = (.32 − .46) 푝 1 − 푝 1 푛1 + 1 푛2 92/200=.46 64/200=.32 Researchers want to test the effectiveness of a new anti-anxiety medication. In clinical testing, 64 out of 200 people taking the medication report symptoms of anxiety. Of the people receiving a placebo, 92 out of 200 report symptoms of anxiety. Is the medication working any differently than the placebo? Test this claim using alpha = 0.05.
  • 25. In the numerator we are subtracting one sample proportion from another sample proportion: 풁풔풕풂풕풊풔풕풊풄 = (−. ퟏퟐ) 푝 1 − 푝 1 푛1 + 1 푛2 Researchers want to test the effectiveness of a new anti-anxiety medication. In clinical testing, 64 out of 200 people taking the medication report symptoms of anxiety. Of the people receiving a placebo, 92 out of 200 report symptoms of anxiety. Is the medication working any differently than the placebo? Test this claim using alpha = 0.05.
  • 26. The denominator is the estimated standard error: 풁풔풕풂풕풊풔풕풊풄 = (−.12) 푝 1 − 푝 1 푛1 + 1 푛2 This proportion is called the pooled standard deviation. It is the same value we use with independent sample t-tests. Researchers want to test the effectiveness of a new anti-anxiety medication. In clinical testing, 64 out of 200 people taking the medication report symptoms of anxiety. Of the people receiving a placebo, 92 out of 200 report symptoms of anxiety. Is the medication working any differently than the placebo? Test this claim using alpha = 0.05.
  • 27. The denominator is the estimated standard error: 풁풔풕풂풕풊풔풕풊풄 = (−.12) 푝 1 − 푝 1 푛1 + 1 푛2 It is interesting to note that when you multiply a proportion (.80) by its complement (1-.8 = .20) you get the variance (.80*.20 = .16). If you square that amount it comes to .04 and that is the standard deviation.
  • 28. Why is this important? Because the standard deviation divided by the square root of the sample size is the standard error. 풁풔풕풂풕풊풔풕풊풄 = (−.12) 푝 1 − 푝 1 푛1 + 1 푛2 It is interesting to note that when you multiply a proportion (.80) by its complement (1-.8 = .20) you get the variance (.80*.20 = .16). If you square that amount it comes to .04 and that is the standard deviation.
  • 29. And the larger the standard error the less likely the two groups will be statistically significantly different. 풁풔풕풂풕풊풔풕풊풄 = (−.12) 푝 1 − 푝 1 푛1 + 1 푛2 It is interesting to note that when you multiply a proportion (.80) by its complement (1-.8 = .20) you get the variance (.80*.20 = .16). If you square that amount it comes to .04 and that is the standard deviation.
  • 30. Conversely, the smaller the standard error the more likely the two groups will be statistically significantly different. 풁풔풕풂풕풊풔풕풊풄 = (−.12) 푝 1 − 푝 1 푛1 + 1 푛2 It is interesting to note that when you multiply a proportion (.80) by its complement (1-.8 = .20) you get the variance (.80*.20 = .16). If you square that amount it comes to .04 and that is the standard deviation.
  • 31. So, let’s compute the pooled standard deviation: 풑 1 − 풑
  • 32. So, let’s compute the pooled standard deviation: 풑 1 − 풑 풑 = 푥1 + 푥2 푛1 + 푛2
  • 33. So, let’s compute the pooled standard deviation: 풑 1 − 풑 풑 = 푥1 + 푥2 푛1 + 푛2 Here’s the problem again: Researchers want to test the effectiveness of a new anti-anxiety medication. In clinical testing, 64 out of 200 people taking the medication report symptoms of anxiety. Of the people receiving a placebo, 92 out of 200 report symptoms of anxiety. Is the medication working any differently than the placebo? Test this claim using alpha = 0.05.
  • 34. So, let’s compute the pooled standard deviation: 풑 1 − 풑 풑 = 푥1 + 푥2 푛1 + 푛2 Researchers want to test the effectiveness of a new anti-anxiety medication. In clinical testing, 64 out of 200 people taking the medication report symptoms of anxiety. Of the people receiving a placebo, 92 out of 200 report symptoms of anxiety. Is the medication working any differently than the placebo? Test this claim using alpha = 0.05.
  • 35. So, let’s compute the pooled standard deviation: 풑 1 − 풑 풑 = 64 + 푥2 푛1 + 푛2 Researchers want to test the effectiveness of a new anti-anxiety medication. In clinical testing, 64 out of 200 people taking the medication report symptoms of anxiety. Of the people receiving a placebo, 92 out of 200 report symptoms of anxiety. Is the medication working any differently than the placebo? Test this claim using alpha = 0.05.
  • 36. So, let’s compute the pooled standard deviation: 풑 1 − 풑 풑 = 64 + 푥2 푛1 + 푛2 Researchers want to test the effectiveness of a new anti-anxiety medication. In clinical testing, 64 out of 200 people taking the medication report symptoms of anxiety. Of the people receiving a placebo, 92 out of 200 report symptoms of anxiety. Is the medication working any differently than the placebo? Test this claim using alpha = 0.05.
  • 37. So, let’s compute the pooled standard deviation: 풑 1 − 풑 풑 = 64 + 푥2 200 + 푛2 Researchers want to test the effectiveness of a new anti-anxiety medication. In clinical testing, 64 out of 200 people taking the medication report symptoms of anxiety. Of the people receiving a placebo, 92 out of 200 report symptoms of anxiety. Is the medication working any differently than the placebo? Test this claim using alpha = 0.05.
  • 38. So, let’s compute the pooled standard deviation: 풑 1 − 풑 풑 = 64 + 푥2 200 + 푛2 Researchers want to test the effectiveness of a new anti-anxiety medication. In clinical testing, 64 out of 200 people taking the medication report symptoms of anxiety. Of the people receiving a placebo, 92 out of 200 report symptoms of anxiety. Is the medication working any differently than the placebo? Test this claim using alpha = 0.05.
  • 39. So, let’s compute the pooled standard deviation: 풑 1 − 풑 풑 = 64 + 92 200 + 푛2 Researchers want to test the effectiveness of a new anti-anxiety medication. In clinical testing, 64 out of 200 people taking the medication report symptoms of anxiety. Of the people receiving a placebo, 92 out of 200 report symptoms of anxiety. Is the medication working any differently than the placebo? Test this claim using alpha = 0.05.
  • 40. So, let’s compute the pooled standard deviation: 풑 1 − 풑 풑 = 64 + 92 200 + 푛2 Researchers want to test the effectiveness of a new anti-anxiety medication. In clinical testing, 64 out of 200 people taking the medication report symptoms of anxiety. Of the people receiving a placebo, 92 out of 200 report symptoms of anxiety. Is the medication working any differently than the placebo? Test this claim using alpha = 0.05.
  • 41. So, let’s compute the pooled standard deviation: 풑 1 − 풑 풑 = 64 + 92 200 + 200 Researchers want to test the effectiveness of a new anti-anxiety medication. In clinical testing, 64 out of 200 people taking the medication report symptoms of anxiety. Of the people receiving a placebo, 92 out of 200 report symptoms of anxiety. Is the medication working any differently than the placebo? Test this claim using alpha = 0.05.
  • 42. Add the fractions: 풑 1 − 풑 풑 = 64 + 92 200 + 200
  • 43. Add the fractions: 풑 1 − 풑 풑 = 156 200 + 200
  • 44. Add the fractions: 풑 1 − 풑 풑 = 156 200 + 200
  • 45. Add the fractions: 풑 1 − 풑 풑 = 156 200
  • 46. Add the fractions: 풑 1 − 풑 풑 = .78
  • 47. Now we plug this pooled proportion: 풑 1 − 풑 풑 = .78
  • 48. Now we plug this pooled proportion: 풑 1 − 풑 풑 = .78 into the standard error formula in the denominator
  • 49. Now we plug this pooled proportion: 풑 1 − 풑 풑 = .78 into the standard error formula in the denominator
  • 50. Now we plug this pooled proportion: .78 1−. ퟕퟖ 풑 = .78 into the standard error formula in the denominator
  • 51. Now we plug this pooled proportion: .78 .22 into the standard error formula in the denominator
  • 52. Now we plug this pooled proportion: . ퟏퟕퟐ into the standard error formula in the denominator
  • 53. Now we plug this pooled proportion: 푍푠푡푎푡푖푠푡푖푐 = (−. ퟏퟒ) . ퟏퟕퟐ 1 풏ퟏ + 1 푛2 Researchers want to test the effectiveness of a new anti-anxiety medication. In clinical testing, 64 out of 200 people taking the medication report symptoms of anxiety. Of the people receiving a placebo, 92 out of 200 report symptoms of anxiety. Is the medication working any differently than the placebo? Test this claim using alpha = 0.05.
  • 54. Now we need to calculate n or the sample size: 푍푠푡푎푡푖푠푡푖푐 = (−. ퟏퟒ) .172 1 200 + 1 푛 Researchers want to test the effectiveness of a new anti-anxiety medication. In clinical testing, 64 out of 200 people taking the medication report symptoms of anxiety. Of the people receiving a placebo, 92 out of 200 report symptoms of anxiety. Is the medication working any differently than the placebo? Test this claim using alpha = 0.05.
  • 55. Now we need to calculate n or the sample size: 푍푠푡푎푡푖푠푡푖푐 = (−. ퟏퟒ) .172 1 200 + 1 200 Researchers want to test the effectiveness of a new anti-anxiety medication. In clinical testing, 64 out of 200 people taking the medication report symptoms of anxiety. Of the people receiving a placebo, 92 out of 200 report symptoms of anxiety. Is the medication working any differently than the placebo? Test this claim using alpha = 0.05.
  • 56. Now we need to calculate the Zstatistic 푍푠푡푎푡푖푠푡푖푐 = (−. ퟏퟒ) .172 1 200 + 1 200 Researchers want to test the effectiveness of a new anti-anxiety medication. In clinical testing, 64 out of 200 people taking the medication report symptoms of anxiety. Of the people receiving a placebo, 92 out of 200 report symptoms of anxiety. Is the medication working any differently than the placebo? Test this claim using alpha = 0.05.
  • 57. Now we need to calculate the Zstatistic 푍푠푡푎푡푖푠푡푖푐 = (−. ퟏퟒ) .172 2 200
  • 58. Now we need to calculate the Zstatistic 푍푠푡푎푡푖푠푡푖푐 = (−. ퟏퟒ) .172 1 100
  • 59. Now we need to calculate the Zstatistic 푍푠푡푎푡푖푠푡푖푐 = (−. ퟏퟒ) .172 .01
  • 60. Now we need to calculate the Zstatistic 푍푠푡푎푡푖푠푡푖푐 = (−. ퟏퟒ) .172 (.1)
  • 61. Now we need to calculate the Zstatistic 푍푠푡푎푡푖푠푡푖푐 = (−. ퟏퟒ) (.414) (.1)
  • 62. Now we need to calculate the Zstatistic 푍푠푡푎푡푖푠푡푖푐 = (−. ퟏퟒ) .0414
  • 63. Now we need to calculate the Zstatistic 푍푠푡푎푡푖푠푡푖푐 = −3.379
  • 64. Let’s see where this lies in the distribution: rare -1.96 Common rare +1.96
  • 65. Let’s see where this lies in the distribution: rare -1.96 Common rare -3.38 +1.96
  • 66. Because -3.38 is outside the -1.96 range we consider it to be a rare occurrence and therefore we will reject the null hypothesis and accept the alternative hypothesis:
  • 67. Because -3.38 is outside the -1.96 range we consider it to be a rare occurrence and therefore we will reject the null hypothesis and accept the alternative hypothesis: There was a significant difference in effectiveness between the medication group and the placebo group, z = -3.379, p < 0.05.
  • 68. Because -3.38 is outside the -1.96 range we consider it to be a rare occurrence and therefore we will reject the null hypothesis and accept the alternative hypothesis: There was a significant difference in effectiveness between the medication group and the placebo group, z = -3.379, p < 0.05 In summary A two-sample Z test is used to compare the differences statistically between two sample proportions.