UPI Study › Courses › Marketing Research › Free lessons › Lesson 11.4 Free lesson
The Z Test: Formula and Examples
Marketing Research · Chapter 11: Hypothesis Testing and Inferential StatisticsSection 11.4 · lesson 78 of 10111 min · free to watch
Lesson complete
Earn the 3 college credits for Marketing Research
Enrolling adds a quiz after each lesson, the graded work and the official transcript. Recommended for credit by NCCRS.
Next lesson: Parametric and Non-Parametric Tests in Marketing Research →← ANOVA: Comparing Differences Across Three or More GroupsNext lesson: Parametric and Non-Parametric Tests in Marketing Research →
In this lesson
Test a mean when the population standard deviation is known.
- Write and compute the z statistic for a mean with every symbol defined
- Use the critical values 1.96 and 2.576 and the p-value to make a decision
- Explain how one-tailed and two-tailed tests differ and why the direction is chosen first
- Decide when a z test fits and when a t-test is needed
Free study notes
Get this lesson's notes by email
The key points and 4 practice questions with answers, in your inbox. One email, free.
One email. Unsubscribe in one click.
Transcript
Everything said in the video, section by section (1,508 words). Read along, or search it.
Opening Question
A Coin With a Known Spread
Imagine a coin so well studied, that its exact spread of outcomes is known, down to the last decimal. Now someone hands you a new coin, that might be biased. You know precisely how a normal coin behaves. So every flip tells you exactly how surprised to be.
The z test works the same way, for averages. It is the cleanest of all the tests. But it needs one thing the others do not: a standard deviation that is already known. Fernway Snacks, a composite case built for teaching, has years of panel data. So Grace can use it.
By the end of this lesson, you will write the z formula for a mean, with every symbol defined, and compute it step by step. You will use the critical values 1.96 and 2.576, and the p-value, to decide. And you will know when to choose z instead of t, and how one-tailed and two-tailed tests differ.
Setup
Loyalty Club Members Versus a 6.0 Mean
First, the z test for a mean. Years of panel data tell Fernway something useful. Larkfield shoppers buy a mean of 6.0 bars a month. And the population standard deviation, called sigma, is 2.4.
Then Leo launches a loyalty club. Grace tracks 64 members. They average 6.7 bars a month. That is more than 6.0. But is the club lifting purchases? Or is 6.7 only luck?
The hypotheses, in words. The null: loyalty-club members buy the same average as everyone else. The alternative: they buy a different average. In symbols, the null says mu equals 6.0. The alternative says mu is not equal to 6.0. That makes it two-tailed. Alpha is 0.05.
Now the formula, in words. z is the sample mean, minus the mean the null hypothesis claims, divided by the standard error of the mean.
Formula
Distance Measured in Standard Errors
Let us name every symbol. X bar is the sample mean. Mu zero is the mean claimed by the null hypothesis. Sigma is the known population standard deviation. And n is the sample size.
The bottom part, sigma divided by the square root of n, is the standard error, from lesson 9.4. So the result says how many standard errors the sample mean sits, from the claim. That is all z is: a distance, measured in standard errors. A z of zero means the sample mean sits right on the claim. A z of one means it sits one standard error away. The further z gets from zero, in either direction, the harder the null hypothesis is to believe.
Here are the steps. The square root of 64 is 8. So the standard error is 2.4, divided by 8. That is 0.30.
Worked Example
A 0.7-Bar Gap Is 2.33 Standard Errors
The gap is 6.7, minus 6.0. That is 0.7. So z is 0.7, divided by 0.30. That gives 2.333. The sample mean is 2.33 standard errors above the claim. Notice what the sample size did. With 64 members, the standard error is small, only 0.30. So a gap of 0.7 bars looks large, measured in standard errors. With fewer members, the same gap would look smaller.
Critical Values
Cutoffs of 1.645, 1.96 and 2.576
Next: critical values, and the p-value. Because sigma is known, z follows the standard normal curve, when the null hypothesis is true. You met that curve in lesson 9.6. There are no extra "fat tails," as there were with the t curve. The t curve had fat tails, because the standard deviation itself was uncertain. Here, sigma is known. So there is no extra doubt to build in.
So the cutoffs come straight from the normal curve. Each one cuts off the extreme alpha of the curve. The cutoff is 1.96. Each tail holds two and a half percent. That is five percent in all.
Read the table row by row. At an alpha of 0.10, the two-tailed cutoff is 1.645. At 0.05, it is 1.960. At 0.01, it is 2.576. A stricter alpha pushes the cutoff further out. At 0.01, only half a percent sits in each tail. To land in such a thin tail, a result must be very far from the claim.
Two Decision Rules
Critical Value Way and P-Value Way
There are two ways to decide. And they always agree. The first is the critical value way. Take the size of z, ignoring its sign. Reject the null hypothesis, if that size exceeds the cutoff.
The second is the p-value way. Find the area in the tails, beyond our z. Reject, if that area is at most alpha. The p-value is the chance, if the null hypothesis were true, of landing at least this far from the claim. That is the same meaning you learned in lesson 11.1.
For Grace's z, the two shaded tails hold 0.0098 each. Together, the p-value is 0.0196. Why both tails? Because a two-tailed test counts a surprising result, in either direction.
Now the decision. The size of z is 2.33. That is above 1.96. And p is 0.0196, below 0.05. So we reject the null hypothesis, at an alpha of 0.05.
Stricter Alpha
Significant at 0.05 but Not at 0.01
But look at the stricter level. At an alpha of 0.01, the cutoff is 2.576. Our 2.33 falls short of it. And p is above 0.01. So at that level, we do not reject.
What does it mean for Fernway? Club members buy more than the average shopper. The evidence is fairly strong, but not overwhelming. The club may be worth keeping, while Grace gathers more data.
And one caution. The test cannot show that the club caused the rise. Members chose to join. As lesson 6.4 warned, people who choose to join may already be keen buyers. A shopper who loves the bar is more likely to sign up for its club. So the club may simply attract the fans, rather than create them. A significant z tells you the gap is real. It does not tell you where the gap came from.
One or Two Tails
Choose the Direction Before the Data
Next: one tail or two? And z, or t? Suppose Leo only cares whether the club raises sales. Then the alternative can be one-sided: mu is greater than 6.0.
With a one-sided test, all five percent goes in the right tail. The cutoff drops to 1.645. And the p-value is 0.0098, half the two-tailed value.
That sounds tempting. Half the p-value, and a lower cutoff! But one-tailed tests are easier to pass. Picture a researcher who looks at the data, sees the club mean went up, and only then picks the upper tail. That researcher has quietly doubled the false-alarm risk in the direction that suits the story. So you must decide the direction before seeing the data. Otherwise, the test is rigged. A two-tailed test is the safe default.
Z or T
Where the Standard Deviation Came From
Now, z or t? The z test is rarely perfect in practice, because sigma is almost never truly known. It fits in two cases. First, when sigma comes from long records, as in Grace's panel. Second, when the sample is so large, that the sample standard deviation stands in for it. Lesson 11.6 covers that case.
With a small sample, and only an estimated standard deviation, use the t-test, from lesson 11.2. That is exactly the job it was built for. So the choice comes down to one question. Where did the standard deviation come from? If it came from long, trusted records, z can work. When it comes from the same small sample you are testing, the t-test is the right choice.
Back to the office. Leo wants to announce that the loyalty club works. Grace says, "At 0.05, it passes. At 0.01, it does not. I would say promising."
Reporting
Write Down Alpha First
Nadia asks for a report that gives z, p, and the alpha used. That way, nobody can pick the alpha afterward, to suit the story. It is a simple habit, and it keeps the research honest. If the alpha is written down first, the result cannot be dressed up later. Readers see the evidence, and the bar it had to clear.
Here is a common mistake. Someone uses the sample's own standard deviation, in a z test of a small sample. But the z formula wants the population sigma. A standard deviation from ten shoppers is itself shaky. That is exactly why the t-test exists.
Try it yourself. In the practice file, change n to 36, and keep the mean of 6.7. Predict first. Will z go up, or down? And will the club still be significant, at 0.05? Then run it. Here is a hint: a smaller sample means a bigger standard error. And a bigger standard error shrinks z, even when the gap stays exactly the same.
Key Takeaways
Z Test Rules in Brief
Key takeaways. The z test for a mean takes the sample mean, minus the claimed mean, and divides by sigma over the square root of n. It needs the population sigma, known in advance. Reject the null hypothesis when the size of z is beyond 1.96, for a two-tailed test at 0.05. Or beyond 2.576, at 0.01. Or when the p-value is at most alpha. One-tailed tests need a direction, chosen in advance.
Next, in lesson 11.5, you will learn when a test that assumes bell-shaped data is wrong, and what to use instead. This lesson was made by UPI Study.
About Marketing Research at UPI Study
Marketing Research (Marketing 300) is a self-paced online course of 101 video lessons in 13 chapters, from consumer behavior, segmentation and the research process to qualitative methods, surveys and sampling, measurement, experiments, secondary and syndicated data, descriptive statistics, hypothesis tests, correlation and regression, research ethics and reports. It carries a NCCRS credit recommendation for 3 semester credits.
Every lesson transcript is free on pages like this one, and the videos are free with a free UPI Study account. Enrolling adds a practice quiz after each lesson, the graded work and final exam that earn the credit, lifetime access, and an official transcript on completion. UPI Study has helped over 130,000 students with college credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
Enroll now → Course details Download the syllabus All Business courses Every credit course with PRO →
Why take it here
Why students take Marketing Research with UPI Study
Where the credit goes
Universities that work with NCCRS
Marketing Research carries a NCCRS credit recommendation. These universities work with NCCRS; some are UPI Study's signed partners. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
Thomas Edison State UniversitySigned partner
University of the PeopleSigned partner
Charter Oak State CollegeSigned partner
Strayer UniversitySigned partner
Columbia Southern UniversitySigned partner
Indiana TechSigned partner
Penn StateWorks with NCCRS
Southern New Hampshire UniversityWorks with NCCRS
SUNYWorks with NCCRS
+many more cooperating universitiesFind my college →Find my college → Not listed? Ask Athena in the corner of this page, or book a 15-minute call.
FAQ
Questions students ask us
About The Z Test: Formula and Examples
What is the formula for a one-sample z test?
Why does a z test for a mean need a known population standard deviation?
What are the critical values for a two-tailed z test?
What is the difference between a one-tailed and a two-tailed z test?
About the Marketing Research course
How many college credits is Marketing Research?
How much does Marketing Research cost and what is included?
Which universities accept UPI Study credits?
How long does Marketing Research take?
How are the exams done?
How do my credits reach my college?
Ready for the full course? Earn 3 credits in Marketing Research.
101 video lessons, a quiz after each one, and the graded work that earns the credit. Recommended for credit by NCCRS.
Updated
3 credits · NCCRSEnroll →