Lab 13

Z-tests

 

In the last lab we looked at the null and alternative hypotheses. Now we will conduct z tests and decide to reject or retain the null hypotheses.

The next step after specifying the null and alternative hypotheses is to decide what criteria you are going to use to either reject or retain the null hypothesis. This is sometimes referred to as setting your a level (that's alpha level).

    So consider the problem that we have. We have a sample and its descriptive statistics are different from the population's parameters. How do we decide whether the difference that we see is due to a "real" difference (which reflects a difference between two populations) or is due to sampling error?

To deal with this problem the researcher must set the criteria or decision rule in advance.

    For example, think of the kinds of questions we were doing in lab 11.

    Given a population with a m = 65 and a s = 10, what is the probability that our sample (of size n = 25) will have a mean of 70 or more?

    To figure this out we computed the standard error and then a z-score.

    Need s = 10/sqrt(25) = 2.
    So z = (70 - 65) / 2 = 2.5
    p( > 70) = 1 - NORMDIST(70,65,2,TRUE) = 0.0062
    or
    p(z > 2.5) = 1- NORMDIST(2.5,0,1,TRUE) = 0.0062
    or
    p(z > 2.5) = 1 - NORMSDIST(2.5) = 0.0062

    NOTE: The NORMSDIST function in Excel is just like the NORMDIST function but it works for z-scores only. It is faster to use because you do not have to enter the mean and standard deviation of 0 and 1 and you don't have to type "TRUE" in the function. There is also a NORMSINV function that returns a z-score associated with specific probability just like the NORMINV function but it does not make you specify the mean and standard deviation.

We're going to be asking the same questions here, but taking it a step further and saying things like, "Gee, the probability that my sample has a mean of 70 or higher is 0.0062. That's pretty small. I'll bet that my sample isn't really from this population, but is instead from another population."

Setting the criteria in advance is concerned with the part about saying "that's pretty small". When we set the criteria in advance, we are essentially specifying how small a chance is small enough to reject the null hypothesis. Or in other words, how big a difference do I need to have to reject the null hypothesis. This cutoff probability is called alpha (a).

    Note: often alpha is determined by convention within your own discipline. For example, some fields may say that p < 0.05 is low enough to reject the H0. While other fields may chose p =< 0.01 or lower as alpha.

    For a 2-tailed hypothesis, the 2 critical regions (the shaded regions in the picture below) have to add up to 5% of the distribution (because alpha is 0.05). The 2 regions are equal in size so both are 2.5% or 0.025 of the whole distribution. The z-score associated the lowest 2.5% is NORMINV(.025,0,1) = -1.96. The z-score associated the highest 2.5% (cumulative probability of 0.975) is NORMINV(.975,0,1) = 1.96.

    Thus for a 2-tailed hypothesis with an α = 0.05, 1.96 (or -1.96) is called the critical z or zcrit. This is because any z-test that produces a z-score (now called the observed z or zobs) that is more extreme than 1.96 (>1.96 or <-1.96) results in the rejection of the null hypothesis.

    For a 1-tailed hypothesis with an α = 0.05, the critical region is associated with a critical z of either a 1.64 or -1.64, depending the direction of the hypothesis. This is because NORMINV(.05,0,1) = -1.64 and NORMINV(.95,0,1) = 1.64. The 1-tailed hypothesis in the image below specifies that the sample mean is higher than population mean. If the sample mean were expected to be lower, the shaded region would be in the left side of the distribution.



After calculating the observed z using the z-score formula presented in the last lab, you can decide to reject or retain the null hypothesis using 1 of 2 functionally equivalent methods:
Method 1: Compare the observed z to the critical z. If the observed z is as extreme as or more extreme than the critical z (i.e., the absolute value of observed z is >= the absolute value of the critical z), reject the null hypothesis, otherwise retain it.

Method 2 is a little complicated so don't worry if you have trouble understanding it. Method 1 is just as good.

Method 2: Compare the p-value to the α. If the cumulative proportion (p-value) of the absolute value of the observed z times -1 is less than α for a 1-tailed test or α/2 for a 2-tailed test, reject the null hypothesis, otherwise retain it. The formula for this in Excel is: =NORMSDIST(ABS(observed z)*-1). If the test is 1-tailed and α is .05, the p-value must be less than or equal to .05 to reject the null hypothesis. If the test is 2-tailed, the p-value must be less than or equal to .025. This is obviously more complicated than Method 1 but it gives the same answer. With other statistical tests, we'll see that looking at p-values is easier than looking at critical values because SPSS (and other statistical software packages) looks up the proper p-value and we merely have to check that it is less than or equal to the α we have set.

Although it is to your advantage to become good at calculating all of these things on your own, I have made this process easier with another spreadsheet that automates the z-test.

Download this spreadsheet
.

You have to enter the sample mean, population mean, population standard deviation, sample size, and α. You also have to specify which kind of test to perform (2-tailed or which direction the 1-tailed test goes). The standard error, observed z, critical z, and p-value are calculated. In addition, the decision to reject or retain the null hypothesis is printed. You can also look at the graph to see of the observed z falls in the critical region(s). Always check the graph to see if makes sense because it is easy to enter the wrong numbers in the dark gray cells or forget to specify the right kind of test.



I will demonstrate how to complete the questions that are on the worksheet. Suppose that the numbers from the example above refer to worker satisfaction in the telemarketing sector. That is, in the entire telemarketing sector, employees' satisfaction with the jobs is μ = 65 and σ = 10 on a questionnaire. DirectXYZ is a firm that believes that its policies are significantly better at keeping its telemarketers happy on the job. At DirectXYZ, a sample of 25 employees randomly selected scored a mean of 70 on the worker satisfaction questionnaire. Assume that α = 0.05.

If the correct numbers and options are entered into the spreadsheet as seen above, you can see a tiny red line in the green region at the right. This means that the observed z is in the critical region (i.e., it is more extreme than the critical z.) Thus, the null hypothesis should be rejected. Here is how I would complete the type of questions on the worksheet:

    a.    In order to reject the null hypothesis, the observed z must be: >=1.65
    NOTE: Had the 1-tailed hypothesis been in the other direction, the answer would have been "<=-1.65." Had the hypothesis been 2-tailed, the answer would have been "<= -1.96 or >= 1.96."
    b.    Observed z =2.5
    c.    p =.0062
    d.    Reject or retain the Null hypothesis? Reject
    e.    State conclusion in everyday language: Telemarketers at DirectXYZ are, on average, significantly happier than telemarketers at other firms.
    NOTE: Had the data been different and the null hypothesis were retained, the conclusion in everyday language might have been: "There is no evidence that telemarketers at DirectXYZ are happier than comparable employees at other telemarketing firms."

Download this worksheet and save it somewhere you will be able to find it again (e.g., your datastore).

You will notice that several of the problems are the same as in the last lab.

    Complete Worksheet questions 1 through 4 (NOTE: Be careful about 1-tailed hypotheses! Sometimes you get an extreme result in the opposite direction of what you expect and you have to retain the null hypothesis, even though it looks like there was a large difference between the sample mean and the population mean.).

    You'll probably have an easier time using the z-test spreadsheet described above but, if you wish, you can do the calculations yourself to make sure that you understand everything.

    Save your worksheet (somewhere you can find it again) and email it to your GA