We are learning how to do one sample z-test. In this example, I'm going to
teach you how to do the one sample z-test by hand. In the previous video we
walked through the first three steps of hypothesis testing - selecting a test,
establishing the null and alternative hypotheses, and determining the critical
value. Now we are ready to calculate the statistics. We will begin with the
formula for a z-test. This formula looks very similar to the formula that we used
for calculating a z-score, except for the denominator. For reasons that I explained
in the video about the central limit theorem, the denominator will be the
standard deviation of the population divided by the square root of n. This is
called the standard error of the mean. So let's apply this formula. Again, our
research question is whether the average age of the sample of LinkedIn users is
different from the US population of social networking users. The population
mean is 36.9. The population standard deviation is 10. The sample size is 25
and the sample mean is 44.2. To use the z-test formula we will plug in these
values. First, we will calculate the standard error of the mean, abbreviated
sigma sub M or SE sub M. We plug in 10 and 25. The square root of 25 is 5, 10 divided by 5
is 2. Second, we will plug in the standard error of the mean to the z-test formula.
Z equals 44.2, minus 36.9, divided by 2, so this is 7.3, divided by 2, or 3.65.
So our z equals +3.65, and our critical value you will
remember is +1.96. Clearly, our Z of 3.65
is further away from the Z distribution mean of zero then the critical value of
1.96. So we are ready for step five: make the decision. Here we have our normal
distribution. We have set two fences for our two-tailed test. One at +1.96
and the other at -1.96 this contains 95% of the
scores inside of the fences and 5% of the scores split between the
two tails. The probability of obtaining a specific sample mean inside of these
fences is greater than 5% (or .05) the probability of
randomly selecting a sample with a mean outside of these fences is less than
5%. This is what we mean by alpha equals .05. For this
example, we're going to focus on the upper fence, the critical value to the
right, Z equals positive 1.96. We can add our number line across the bottom. These
represent sample means. Our population mean is 36.9. The mean of a Z
distribution is always 0, so the mean of 36.9 corresponds to a z-score of 0. We
calculated a sample mean of 44.2, which has an accompanying z-score of
+3.65. We can see that this value is outside of the fence in the shaded
purple area, the region of rejection, and is less likely to occur by chance than
5% of the time. Compare the obtained Z value 3.65, to the critical
value, +1.96 from step 2, since the Z obtained exceeds or is further
from a z of 0 than the Z critical value, the results are statistically
significant. If not, the results would not be significant. In this case, z equals 3.65
exceeds the critical value 1.96, so the results are statistically significant; we
will reject the null hypothesis. The null hypothesis states that there was no
difference between the sample mean and the population mean. We reject the idea
that there was no difference. We conclude that there was a difference between the
sample mean and the population mean. So let's review these 5 steps of hypothesis
testing for the one sample z-test. Step One: Select the appropriate statistic. We used
the one sample z-test to compare the sample and population mean when the
population standard deviation was known. Step two: State the null and alternative
hypotheses. H sub 0 : mu equals 36.9 (that's the null) H sub 1 : mu does
not equal 36.9. Step Three: select a level of significance. We use a two-tailed test
with an alpha of .05. The critical value for such as Z test is positive or
negative 1.96. Step Four: Calculate the statistics. Our Z was a + 3.65.
Remember that it is very rare that we were to get a Z greater than 3 by random
chance, because 99% of the scores are between positive and
negative three. Step Five: Make the decision. The average age of LinkedIn users is
higher than the U.S. population of social networking users. Z equals
positive 3.65, p < .05. Finally, we should write up our findings in
proper APA style. We should describe our research question, the type of test we used,
sample size, means of the sample, and standard deviations when we know them,
and the findings. Basically we should include everything that would be
required for someone else to recalculate our statistics, and here is an example of
how we might word this. A study was conducted to determine whether the users
of the social networking website LinkedIn are statistically significantly
different in age than typical users of social networking sites. A z-test was
used to compare the average age of a sample of 25 LinkedIn users (Mean = 44.2)
to the average age of social networking users (Mean = 36.9, Standard Deviation = 10).
LinkedIn users are significantly older than the typical social networking
user, Z = +3.65, p < .05, reflecting the business and
corporate focus of the site. Here are some final notes about z tests. The
z-test can only be used when we know the true standard deviation of the
population. Unfortunately we almost never know the true standard deviation of the
population, and that is a problem. However when we do not know the true standard
deviation of the population, we can estimate the standard deviation of the
population using the standard deviation of the sample. But when we estimate a
population parameter from that sample statistic, it creates an interesting
problem that we're going to have to solve next time when we talk about t-tests.