Chapter 10

One-Sample Hypothesis Testing

IN THIS CHAPTER

Introducing hypothesis tests

Testing hypotheses about means

Testing hypotheses about variances

Visualizing distributions

Whatever your occupation, you often have to assess whether something out of the ordinary has happened. Sometimes you start with a sample from a population about whose parameters you know a great deal. You have to decide whether that sample is like the rest of the population or whether it’s different.

Measure that sample and calculate its statistics. Finally, compare those statistics with the population parameters. Are they the same? Are they different? Does the sample represent something that’s off the beaten path? Proper use of statistics helps you decide.

Sometimes you don’t know the parameters of the population you’re dealing with. Then what? In this chapter, I discuss statistical techniques and worksheet functions for dealing with both cases.

Hypotheses, Tests, and Errors

A hypothesis is a guess about the way the world works. It’s a tentative explanation of some process, whether that process is natural or artificial. Before studying and measuring the individuals in a sample, a researcher formulates hypotheses that predict what the data should look like.

Generally, one hypothesis predicts that the data won’t show anything new or interesting. Dubbed the null hypothesis (abbreviated H0), this hypothesis holds that if the data deviate from the norm in any way, that deviation is due strictly to chance. Another hypothesis, the alternative hypothesis (abbreviated H1), explains things differently. According to the alternative hypothesis, the data show something important.

After gathering the data, it’s up to the researcher to make a decision. The way the logic works, the decision centers around the null hypothesis. The researcher must decide to either reject the null hypothesis or to not reject the null hypothesis. Hypothesis testing is the process of formulating hypotheses, gathering data, and deciding whether to reject or not reject the null hypothesis.

remember Nothing in the logic involves accepting either hypothesis. Nor does the logic entail any decisions about the alternative hypothesis. It’s all about rejecting or not rejecting H0.

Regardless of the reject-don’t-reject decision, an error is possible. One type of error occurs when you believe that the data show something important and you reject H0, and in reality the data are due just to chance. This is called a Type I error. At the outset of a study, you set the criteria for rejecting H0. In so doing, you set the probability of a Type I error. This probability is called alpha (α).

The other type of error occurs when you don’t reject H0 and the data are really due to something out of the ordinary. For one reason or another, you happened to miss it. This is called a Type II error. Its probability is called beta (β). Table 10-1 summarizes the possible decisions and errors.

TABLE 10-1 Decisions and Errors in Hypothesis Testing

“True State” of the World

H0 is True

H1 is True

Reject H0

Type I Error

Correct Decision

Decision

Do Not Reject H0

Correct Decision

Type II Error

Note that you never know the true state of the world. All you can ever do is measure the individuals in a sample, calculate the statistics, and make a decision about H0.

Hypothesis Tests and Sampling Distributions

In Chapter 9, I discuss sampling distributions. A sampling distribution, remember, is the set of all possible values of a statistic for a given sample size.

Also in Chapter 9, I discuss the Central Limit Theorem. This theorem tells you that the sampling distribution of the mean approximates a normal distribution if the sample size is large (for practical purposes, at least 30). This holds whether or not the population is normally distributed. If the population is a normal distribution, the sampling distribution is normal for any sample size. Two other points from the Central Limit Theorem:

  • The mean of the sampling distribution of the mean is equal to the population mean.

    The equation for this is

    images
  • The standard error of the mean (the standard deviation of the sampling distribution) is equal to the population standard deviation divided by the square root of the sample size.

    This equation is

    images

The sampling distribution of the mean figures prominently into the type of hypothesis testing I discuss in this chapter. Theoretically, when you test a null hypothesis versus an alternative hypothesis, each hypothesis corresponds to a separate sampling distribution.

Figure 10-1 shows what I mean. The figure shows two normal distributions. I placed them arbitrarily. Each normal distribution represents a sampling distribution of the mean. The one on the left represents the distribution of possible sample means if the null hypothesis is truly how the world works. The one on the right represents the distribution of possible sample means if the alternative hypothesis is truly how the world works.

image

FIGURE 10-1: H0 and H1 each correspond to a sampling distribution.

Of course, when you do a hypothesis test, you never know which distribution produces the results. You work with a sample mean — a point on the horizontal axis. It’s your job to decide which distribution the sample mean is part of. You set up a critical value — a decision criterion. If the sample mean is on one side of the critical value, you reject H0. If not, you don’t.

In this vein, the figure also shows α and β. These, as I mention earlier, are the probabilities of decision errors. The area that corresponds to α is in the H0 distribution. I shaded it in dark gray. It represents the probability that a sample mean comes from the H0 distribution, but it’s so extreme that you reject H0.

remember Where you set the critical value determines α. In most hypotheses testing, you set α at .05. This means that you’re willing to tolerate a Type I error (incorrectly rejecting H0) 5 percent of the time. Graphically, the critical value cuts off 5 percent of the area of the sampling distribution. By the way, if you’re talking about the 5 percent of the area that’s in the right tail of the distribution (refer to Figure 10-1), you’re talking about the upper 5 percent. If it’s the 5 percent in the left tail you’re interested in, that’s the lower 5 percent.

The area that corresponds to β is in the H1 distribution. I shaded it in light gray. This area represents the probability that a sample mean comes from the H1 distribution, but it’s close enough to the center of the H0 distribution that you don’t reject H0. You don’t get to set β. The size of this area depends on the separation between the means of the two distributions, and that’s up to the world we live in — not up to you.

These sampling distributions are appropriate when your work corresponds to the conditions of the Central Limit Theorem: if you know the population you’re working with is a normal distribution or if you have a large sample.

Catching Some Z’s Again

Here’s an example of a hypothesis test that involves a sample from a normally distributed population. Because the population is normally distributed, any sample size results in a normally distributed sampling distribution. Because it’s a normal distribution, you use z-scores in the hypothesis test:

images

One more “because”: Because you use the z-score in the hypothesis test, the z-score here is called the test statistic.

Suppose you think that people living in a particular ZIP code have higher-than-average IQs. You take a sample of 16 people from that ZIP code, give them IQ tests, tabulate the results, and calculate the statistics. For the population of IQ scores, μ = 100 and σ = 16 (for the Stanford-Binet version).

The hypotheses are

H0: μZIP code ≤ 100

H1: μZIP code > 100

Assume σ = .05. That’s the shaded area in the tail of the H0 distribution in Figure 10-1.

Why the ≤ in H0? You use that symbol because you’ll only reject H0 if the sample mean is larger than the hypothesized value. Anything else is evidence in favor of not rejecting H0.

Suppose the sample mean is 107.75. Can you reject H0?

The test involves turning 107.75 into a standard score in the sampling distribution of the mean:

images

Is the value of the test statistic large enough to enable you to reject H0 with α = .05? It is. The critical value — the value of z that cuts off 5 percent of the area in a standard normal distribution — is 1.645. (After years of working with the standard normal distribution, I happen to know this. Read Chapter 8, find out about Excel’s NORM.S.INV function, and you can have information like that at your fingertips, too.) The calculated value, 1.94, exceeds 1.645, so it’s in the rejection region. The decision is to reject H0.

This means that if H0 is true, the probability of getting a test statistic value that’s at least this large is less than .05. That’s strong evidence in favor of rejecting H0. In statistical parlance, any time you reject H0 the result is said to be “statistically significant.”

This type of hypothesis testing is called one-tailed because the rejection region is in one tail of the sampling distribution.

A hypothesis test can be one-tailed in the other direction. Suppose you have reason to believe that people in that ZIP code had lower-than-average IQs. In that case, the hypotheses are

H0: μZIP code ≥ 100

H1: μZIP code < 100

For this hypothesis test, the critical value of the test statistic is –1.645 if α = .05.

A hypothesis test can be two-tailed, meaning that the rejection region is in both tails of the H0 sampling distribution. That happens when the hypotheses look like this:

H0: μZIP code = 100

H1: μZIP code ≠ 100

In this case, the alternative hypothesis just specifies that the mean is different from the null-hypothesis value, without saying whether it’s greater or whether it’s less. Figure 10-2 shows what the two-tailed rejection region looks like for α = .05. The 5 percent is divided evenly between the left tail (also called the lower tail) and the right tail (the upper tail).

image

FIGURE 10-2: The two-tailed rejection region for α = .05.

For a standard normal distribution, incidentally, the z-score that cuts off 2.5 percent in the right tail is 1.96. The z-score that cuts off 2.5 percent in the left tail is –1.96. (Again, I happen to know these values after years of working with the standard normal distribution.) The z-score in the preceding example, 1.94, does not exceed 1.96. The decision, in the two-tailed case, is to not reject H0.

tip This brings up an important point: A one-tailed hypothesis test can reject H0, while a two-tailed test on the same data might not. A two-tailed test indicates that you’re looking for a difference between the sample mean and the null-hypothesis mean, but you don’t know in which direction. A one-tailed test shows that you have a pretty good idea of how the difference should come out. For practical purposes, this means you should try to have enough knowledge to be able to specify a one-tailed test.

Z.TEST

Excel’s Z.TEST worksheet function does the calculations for hypothesis tests involving z-scores in a standard normal distribution. You provide sample data, a null-hypothesis value, and a population standard deviation. Z.TEST returns the probability in one tail of the H0 sampling distribution.

This is a bit different from the way things work when you apply the formulas I just showed you. The formula calculates a z-score. Then it’s up to you to see where that score stands in a standard normal distribution with respect to probability. Z.TEST eliminates the middleman (the need to calculate the z-score) and goes right to the probability.

Figure 10-3 shows the data and the Function Arguments dialog box for Z.TEST. The data are IQ scores for 16 people in the ZIP code example in the preceding section. That example, remember, tests the hypothesis that people in a particular ZIP code have a higher-than-average IQ.

image

FIGURE 10-3: Data and the Function Arguments dialog box for Z.TEST.

Here are the steps:

  1. Enter your data into an array of cells and select a cell for the result.

    The data in this example are in cells C3 through C18. I selected D3 for the result.

  2. From the Statistical Functions menu, select Z.TEST to open the Function Arguments dialog box for Z.TEST. (Refer to Figure 10-3.)
  3. In the Function Arguments dialog box, enter the appropriate values for the arguments.

    For this example, the Array is C3:C18. In the X box, I type the mean. That’s 100, the mean of IQ scores in the population. In the Sigma box, I type 16, the population standard deviation of IQ scores. The answer (0.026342) appears in the dialog box.

  4. Click OK to put the answer into the selected cell.

With α = .05 and a one-tailed test (H1: μ > 100), the decision is to reject H0, because the answer (0.026) is less than .05. Note that with a two-tailed test (H1: μ ≠ 100), the decision is to not reject H0. That’s because 2 × 0.026 is greater than .05 — just barely greater (.052) — but if you draw the line at .05, you cannot reject H0.

t for One

In the preceding example, I work with IQ scores. The population of IQ scores is a normal distribution with a well-known mean and standard deviation. This enables me to work with the Central Limit Theorem and describe the sampling distribution of the mean as a normal distribution. I then am able to use z as the test statistic.

In the real world, however, you typically don’t have the luxury of working with such well-defined populations. You usually have small samples, and you’re typically measuring something that isn’t as well known as IQ. The bottom line is that you often don’t know the population parameters, nor do you know whether or not the population is normally distributed.

When that’s the case, you use the sample data to estimate the population standard deviation, and you treat the sampling distribution of the mean as a member of a family of distributions called the t-distribution. You use t as a test statistic. In Chapter 9, I introduce this distribution, and mention that you distinguish members of this family by a parameter called degrees of freedom (df).

The formula for the test statistic is

images

Think of df as the denominator of the estimate of the population variance. For the hypothesis tests in this section, that’s N-1, where N is the number of scores in the sample. The higher the df, the more closely the t-distribution resembles the normal distribution.

Here’s an example. FarKlempt Robotics, Inc., markets microrobots. They claim their product averages four defects per unit. A consumer group believes this average is higher. The consumer group takes a sample of nine FarKlempt microrobots and finds an average of seven defects, with a standard deviation of 3.16. The hypothesis test is

H0: μ ≤ 4

H1: μ > 4

α = .05

The formula is

images

Can you reject H0? The Excel function in the next section tells you.

T.DIST, T.DIST.RT, and T.DIST.2T

The T.DIST family of worksheet functions indicates whether or not your calculated t value is in the region of rejection. With T.DIST, you supply a value for t, a value for df, and a value for an argument called Cumulative. The T.DIST returns the probability of obtaining a t value at least as high as yours if H0 is true. If that probability is less than your α, you reject H0.

The steps are:

  1. Select a cell to store the result.
  2. From the Statistical Functions menu, select T.DIST to open the Function Arguments dialog box for T.DIST. (See Figure 10-4.)
  3. In the Function Arguments dialog box, enter the appropriate values for the arguments.

    The calculated t value goes in the X box. For this example, the calculated t value is 2.85.

    Enter the degrees of freedom in the Deg_freedom box. For this example, that value is 8 (9 scores – 1).

    The Cumulative box takes either TRUE or FALSE. I type TRUE in this box to give the probability of getting a value of X or less in the t-distribution with the indicated degrees of freedom. Excel refers to this as the left-tailed distribution. Entering FALSE gives the height of the t-distribution at X. I use this option later in this chapter, when I create a chart of a t-distribution. Otherwise, I don’t know why you would ever type FALSE into this box.

    After I type TRUE, the answer (.98926047) appears in the dialog box.

  4. Click OK to close the dialog box and put the answer in the selected cell.
image

FIGURE 10-4: The Function Arguments dialog box for T.DIST.

The value in the dialog box in Figure 10-4 is greater than .95, so the decision is to reject H0.

You might find T.DIST.RT to be a bit more straightforward, at least for this example. Its Function Arguments dialog box is just like the one in Figure 10-4, but without the Cumulative box. This function returns the probability of getting a value of X or greater in the t-distribution. RT in the function name stands for right tail. For this example, the function returns .01073953. Because this value is less than .05, the decision is to reject H0.

T.DIST.2T gives the two-tailed probability. Its Function Arguments dialog box is just like the one for T.DIST.RT. It returns the probability to the right of X in the t-distribution plus the probability to the left of –X in the distribution.

T.INV and T.INV.2T

The T.INV family is the flip side of the T.DIST family. Give T.INV a probability and degrees of freedom, and it returns the value of t that cuts off that probability to its left. To use T.INV:

  1. Select a cell to store the result.
  2. From the Statistical Functions menu, select T.INV to open the Function Arguments dialog box for T.INV. (See Figure 10-5.)
  3. In the Function Arguments dialog box, enter the appropriate values for the arguments.

    I typed .05 into the Probability box and 8 into the Deg_freedom box. The answer (–1.859548038) appears in the dialog box.

  4. Click OK to close the dialog box and put the answer in the selected cell.
image

FIGURE 10-5: The T.INV Function Arguments dialog box.

T.INV.2T has an identical Function Arguments dialog box. Given Probability and Deg_freedom, this function cuts the probability in half. It returns the value of t in the right tail that cuts off half the probability. What about the other half? That would be the same numerical value multiplied by –1. That negative value of t cuts off the other half of the probability in the left tail of the distribution.

Visualizing a t-Distribution

As I mention in Chapter 8, visualizing a distribution often helps you understand it. It’s easy, and it’s instructive. Figure 10-6 shows how to do it for a t-distribution. The function you use is T.DIST, with the FALSE option in the Cumulative box.

image

FIGURE 10-6: Visualizing a t-distribution.

Here are the steps:

  1. Put the degrees of freedom in a cell.

    I put 15 into cell C2.

  2. Create a column of values for the statistic.

    In cells D2 through D42, I put the values –4 to 4 in increments of .2.

  3. In the first cell of the adjoining column, put the value of the probability density for the first value of the statistic.

    Because I’m graphing a t-distribution, I use T.DIST in cell E2. For the value of X, I click cell D2. For df, I click C2 and press the F4 key to anchor this selection. In the Cumulative box, I type FALSE to return the height of the distribution for this value of t. Then I click OK.

  4. Autofill the column with the values.
  5. Create the chart.

    Highlight both columns. On the Insert tab, in the Charts area, select Scatter with Smooth Lines.

  6. Modify the chart.

    The chart appears with the y-axis down the middle. Click on the x-axis to open the Format Axis panel. Under Axis Options, in the Vertical Axis Crosses area, click the radio button next to Axis Value and type -5 into the box. You can then click inside the chart to make the Chart Elements tool (the plus sign) appear and use it to add the axis titles (t and f(t)). I also delete the chart title and the gridlines, but that’s a matter of personal taste. And I like to stretch out the chart.

  7. Manipulate the chart.

    To help you get a feel for the distribution, try different values for df and see how the changes affect the chart.

Testing a Variance

So far, I mention one-sample hypothesis testing for means. You can also test hypotheses about variances.

This topic sometimes comes up in the context of manufacturing. Suppose FarKlempt Robotics, Inc., produces a part that has to be a certain length with a very small variability. You can take a sample of parts, measure them, find the sample variability, and perform a hypothesis test against the desired variability.

The family of distributions for the test is called chi-square. Its symbol is χ2. I won’t go into all the mathematics. I’ll just tell you that, once again, df is the parameter that distinguishes one member of the family from another. Figure 10-7 shows two members of the chi-square family.

image

FIGURE 10-7: Two members of the chi-square family.

The formula for this test statistic is

images

N is the number of scores in the sample, s2 is the sample variance, and σ2 is the population variance specified in H0.

With this test, you have to assume that what you’re measuring has a normal distribution.

Suppose the process for the FarKlempt part has to have at most a standard deviation of 1.5 inches for its length. (Notice I use standard deviation. This allows me to speak in terms of inches. If I use variance, the units would be square inches.) After measuring a sample of 26 parts, you find a standard deviation of 1.8 inches.

The hypotheses are

H0: σ2 ≤ 2.25 (remember to square the “at-most” standard deviation of 1.5 inches)

H1: σ2 > 2.25

α = .05

Working with the formula,

images

can you reject H0? Read on.

CHISQ.DIST and CHISQ.DIST.RT

After calculating a value for your chi-square test statistic, you use the CHSQ.DIST worksheet function to make a judgment about it. You supply the chi-square value and the df. Just like in T.DIST, you supply either TRUE or FALSE for Cumulative. If you type TRUE, CHISQ.DIST tells you the probability of obtaining a value at most that high if H0 is true. (This is the left-tail probability.) If that probability is greater than 1–α, reject H0.

To show you how it works, I apply the information from the example in the preceding section. Follow these steps:

  1. Select a cell to store the result.
  2. From the Statistical Functions menu, select CHISQ.DIST to open the Function Arguments dialog box for CHISQ.DIST. (See Figure 10-8.)
  3. In the Function Arguments dialog box, type the appropriate values for the arguments.

    In the X box, I typed the calculated chi-square value. For this example, that value is 36.

    In the Deg_freedom box, I typed the degrees of freedom. For this example, that’s 25 (26 – 1).

    In the Cumulative box, I typed TRUE. This returns the left-tailed probability — the probability of obtaining at most the value I typed in the X box. If I type FALSE, CHISQ.DIST returns the height of the chi-square distribution at X. This is helpful if you’re graphing out the chi-square distribution, which I do later in this chapter, but otherwise not so much.

    After you type TRUE, the dialog box shows the probability of obtaining at most this value of chi-square if H0 is true.

  4. Click OK to close the dialog box and put the answer in the selected cell.
image

FIGURE 10-8: The Function Arguments dialog box for CHISQ.DIST.

The value in the dialog box in Figure 10-8 is greater than 1-.05, so the decision is to not reject H0. (Can you conclude that the process is within acceptable limits of variability? See the nearby sidebar “A point to ponder.”)

CHISQ.DIST.2T works like CHISQ.DIST, except its Function Arguments dialog box has no Cumulative box. Supply a value for chi-square and degrees of freedom, and it returns the right-tail probability — the probability of obtaining a chi-square at least as high as the value you type into X.

CHISQ.INV and CHISQ.INV.RT

The CHISQ.INV family is the flip side of the CHISQ.DIST family. You supply a probability and df, and CHISQ.INV tells you the value of chi-square that cuts off the probability in the left tail of the chi-square distribution. Follow these steps:

  1. Select a cell to store the result.
  2. From the Statistical Functions menu, select CHISQ.INV and click OK to open the Function Arguments dialog box for CHISQ.INV. (See Figure 10-9.)
  3. In the Function Arguments dialog box, enter the appropriate values for the arguments.

    In the Probability box, I typed .05, the probability I’m interested in for this example.

    In the Deg_freedom box, I typed the degrees of freedom. The value for degrees of freedom in this example is 25 (26 – 1). After I type the df, the dialog box shows the value (14.61140764) that cuts off the lower 5 percent of the area in this chi-square distribution.

  4. Click OK to close the dialog box and put the answer in the selected cell.
image

FIGURE 10-9: The Function Arguments dialog box for CHISQ.INV.

The CHISQ.INV.RT Function Arguments dialog box is identical to the CHISQ.INV dialog box. The RT version returns the chi-square value that cuts off the right-tail probability. This is useful if you want to know the value that you have to exceed in order to reject H0. For this example, I typed .05 and 25 as the arguments to this function. The returned answer was 37.65248413. The calculated value, 36, didn’t miss by much. A miss is still a miss (to paraphrase “As Time Goes By”) and you cannot reject H0.

Visualizing a Chi-Square Distribution

To help you understand chi-square distributions, I show you how to create a chart for one. The function you use is CHISQ.DIST, with the FALSE option in the Cumulative box. Figure 10-10 shows what the numbers and the finished product look like.

image

FIGURE 10-10: Visualizing a chi-square distribution.

Here are the steps:

  1. Put the degrees of freedom in a cell.

    I put 8 into cell C2.

  2. Create a column of values for the statistic.

    In cells D2 through D50, I put the values 0 to 24 in increments of .5

  3. In the first cell of the adjoining column, put the value of the probability density for the first value of the statistic.

    Because I’m graphing a chi-square distribution, I use CHISQ.DIST in cell E2. For the value of X, I clicked cell D2. For df, I click C2 and press the F4 key to anchor this selection. In the Cumulative box, I type FALSE to return the height of the distribution for this value of χ2. Then I click OK.

  4. Autofill the column with the values.
  5. Create the chart.

    Highlight both columns. On the Insert tab, in the Charts area, select Scatter with Smooth Lines.

  6. Modify the chart.

    I click inside the chart to make the Chart Elements Tool (the plus sign) appear and use it to add the axis titles (χ2 and f(χ2)). I delete the chart title and the gridlines, but that’s a matter of personal taste. I also like to stretch the chart out.

  7. Manipulate the chart.

    To help you get a feel for the distribution, try different values for df, and see how the changes affect the chart.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset