Wk5 DQ - Data Analysis and Business Intelligence
Nonparametric Methods: Nominal Level Hypothesis Tests
Chapter 15
Copyright ©2021 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
15-1
This chapter considers tests of hypothesis for nominal level data. Nonparametric hypothesis tests do not require the assumption that the population be normal. First we consider two mutually exclusive groups, then several mutually exclusive groups. We will use the chi-square distribution as a test statistic in this chapter too.
1
Learning Objectives
Copyright ©2021 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
LO15-1 Test a hypothesis about a population proportion
LO15-2 Test a hypothesis about two population proportions
LO15-3 Test a hypothesis comparing an observed set of frequencies to an expected frequency distribution
LO15-4 Explain the limitations of using the chi-square statistic in goodness-of-fit tests
LO15-5 Test a hypothesis that an observed frequency distribution is normally distributed
LO15-6 Perform a chi-square test for independence on a contingency table
15-2
Test a Hypothesis of a Population Proportion
Copyright ©2021 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
Recall that a proportion is the ratio of the number of successes to the number of observations
Examples
Historically, GM reports that 70% of leased vehicles are returned with less than 36,000 miles; a recent sample of 200 found that 158 had less than 36,000 miles. Has the proportion increased?
Able Moving and Storage advises its clients that their household goods will be delivered in 3 to 5 days for a long-distance move. Records show this is true 90% of the time. A recent sample of 200 moves found that they were successful 190 times. Has the success rate increased?
15-3
Here are examples of potential hypothesis testing situations. To test, first take a random sample from the population. We will assume the binomial assumptions discussed in chapter 6 are met.
3
Hypothesis Test of a Population Proportion
Copyright ©2021 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
To test a hypothesis about a population proportion, the binomial conditions must be met
The sample data collected are the result of counts
The outcome of the experiment must be classified in one of two mutually exclusive classes
The probability of a success is the same for each trial
The trials are independent
Both n and n(1 – ) must be at least 5
The test statistic is
15-4
When we sample from a single population and the variable of interest has only two possible outcomes, we call this a test of proportion. In formula 15-1, p is the sample proportion, is the population proportion, and n is the sample size.
4
Population Proportion Test Example
Copyright ©2021 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
A Republican governor of a western state is thinking about running for reelection. Historically, to be reelected, a Republican needed at least 80% of the vote in the northern part of the state. The governor hires a polling organization to survey the voters there. The polling organization will poll 2,000 voters. Use a statistical hypothesis-testing procedure to assess the governor’s chances of winning reelection.
15-5
Step 1: State the null and alternate hypothesis
H0: ≥ .80
H1: < .80
Step 2: Select the level of significance, we’ll use .05
Step 3: Select the test statistic, we use z
Step 4: Formulate the decision rule,
reject H0 if z < -1.645
This situation regarding the governor’s reelection meets the binomial conditions. This is a one-tailed test, (left-tailed), so the region of rejection is in the left tail. The level of significance is the likelihood of rejecting the null hypothesis when it is true. The critical value is found by referring to Appendix B.3. Go to the column indicating a .05 significance level and then down that column to the row with infinite degrees of freedom; the value is 1.645. Therefore, the critical value is −1.645. The survey revealed that 1,550 planned to vote for the incumbent governor; the sample proportion is .775 (found by 1550 ÷ 2000). The computed value of z is −2.80 and is less than the critical value. The evidence does not support the claim that the incumbent governor will return to the governor’s mansion for another 4 years.
5
Population Proportion Test Example Continued
Copyright ©2021 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
15-6
Step 5: Take sample, make a decision, reject the null hypothesis
Step 6: Interpret; the governor does not have the votes to win
Two-Sample Tests about Proportions
Copyright ©2021 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
We can also test whether two samples came from populations with an equal proportion of successes
Examples
The vice president of human resources wishes to know whether there is a difference in the proportion of hourly employees who miss more than 5 days of work per year at the Atlanta and the Houston plants
A consultant to the airline industry is investigating the fear of flying among adults. The company wishes to know if there is a difference between the proportion of men versus women who are fearful of flying
15-7
In the above cases, each sampled item or individual can be classified as a “success” or “failure.” In the next example, we will assume that each sample is large enough that the normal distribution will serve as a good approximation of the binomial distribution, and we will use z as our test statistic.
7
The Two-Sample Test of Proportions
Copyright ©2021 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
To test whether two samples came from populations with an equal proportion of successes
First pool the two sample proportions using the following formula
Then we compute the value of the test statistic from the following formula
15-8
In the formulas, x1 is the number possessing the trait in the first sample, x2 is the number possessing the trait in the second sample, n1 is the number of observations in the first sample, and n2 is the number of observations in the second sample; pc is the pooled proportion possessing the trait in the combined samples and is called the pooled estimate of the population proportion, p1 is the proportion in the first sample possessing the trait and p2 is the proportion in the second sample possessing the trait.
8
Two-Sample Tests about Proportions Example
Copyright ©2021 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
Manelli Perfume Company recently developed a new fragrance that it plans to market under the name Heavenly. Market studies indicate that Heavenly has very good market potential. The sales department at Manelli is interested in whether there is a difference in the proportion of working women and stay-at-home women who would purchase Heavenly.
15-9
Step 1: State the null and the alternate hypothesis
H0:
H1:
Step 2: Select the level of significance, we select .05
Step 3: Determine the test statistic, we’ll use z
Step 4: Formulate the decision rule, Reject H0 if z < -1.96 or z > 1.96
The null hypothesis in this example is that there is no difference in the proportion of working women and stay-at-home women who prefer Heavenly. The alternate is that the two populations are not equal. The two samples are sufficiently large so we use the standard normal distribution, z, as the test statistic.
To find the critical value, go to Appendix B.5. In the table headings find the row labeled “Level of Significance for Two-Tailed Test” and select the column with an alpha of .05. Go to the bottom row with infinite degrees of freedom. The z value is 1.96, so the critical value for this test is −1.96 and 1.96. This test is continued on the next slide.
9
Two-Sample Tests about Proportions Example Continued
Copyright ©2021 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
Manelli Perfume Company samples 100 working women and 200 stay-at-home women to find out if the population proportions are equal. Each of the sampled women will be asked to smell Heavenly and indicate whether she likes it well enough to purchase a bottle.
Step 5: Take sample, make decision, reject H0
Step 6: Interpret; working women and stay-at-home women will purchase Heavenly at different rates or proportions.
15-10
The random sample of the 100 working women revealed that 81 liked the fragrance well enough to purchase it; the random sample of 200 stay-at-home women revealed 138 liked the fragrance well enough to purchase it. The research question now is, is the difference of .12 in the two sampled proportions due to chance or whether there is a difference in the two populations. Pool the two sample proportions and then calculate the test statistic; z= 2.207 and falls in the area of rejection, to the right of 1.960. So reject the null hypothesis that the proportion of working women that will purchase Heavenly is equal to the proportion of stay-at-home women who will purchase it.
10
Goodness-of-Fit Test
Copyright ©2021 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
We can compare an observed frequency distribution to an expected frequency distribution
Example
An insurance company wishes to compare the historical distribution of policy types with a sample of 2,000 current policies
Does the current distribution of policies “fit” this historical distribution, or has it changed?
15-11
A goodness-of-fit test is one of the most commonly used statistical tests. The table shows the historical relative frequency distribution of policy types; these are the expected frequencies.
11
Goodness-of-Fit Test Example
Copyright ©2021 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
Bubba’s Fish and Pasta is a chain of restaurants along the Gulf Coast of Florida. Bubba is considering adding steak to the menu. Before doing so, he hires a research firm to conduct a survey to find out what the patron’s favorite meal is when eating out. Here are the results of the survey of 120 adults.
Is the difference in the number of times each entrée is selected due to chance, or should we conclude that the entrées are not equally preferred?
Is it reasonable to conclude there is no preference among the four entrées?
15-12
The purpose of this test is to compare an observed frequency distribution to an expected frequency distribution. The scale of measurement is nominal; each of the categories (chicken, fish, meat, and pasta) are also referred to as cells. If the entrées are equally popular, we would expect 30 adults to like each entrée (120 sampled ÷ 4 categories = 30); this is the expected frequency. To investigate, we use the six-step hypothesis-testing procedure.
12
Goodness-of-Fit Test Example Continued
Copyright ©2021 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
15-13
Step 1: State the null and the alternate hypothesis
H0: There is no difference in the proportion of adults selecting each entrée
H1: There is a difference in the proportion of adults selecting each entrée
Step 2: Select the level of significance, we select .05
Step 3: Select the test statistic, we’ll use chi-square,
Step 4: Formulate the decision rule, reject H0 if >7.815
The null hypothesis is that there is no difference between the observed values and the expected values; any differences are due to sampling error. The probability is .05 that a true null hypothesis is rejected. The test statistic follows the chi-square distribution, designated . In this example there are 3 degrees of freedom (k − 1, where k = 4), so to find the critical value go to Appendix B.7. The critical value is 7.815, found by locating 3 df in the left margin and then moving horizontally and reading the cv in the .05 column. The test is concluded on the next slide.
13
Chi-Square Characteristics
Copyright ©2021 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
The characteristics of the chi-square distribution are
The value of chi-square is never negative
There is a family of chi-square distributions
The chi-square distribution is positively skewed
As the degrees of freedom increase, the distribution approaches a normal distribution
15-14
The chi-square distribution has many applications in statistics. Notice how each time the degrees of freedom change, a new distribution is formed; see the chi-square distributions for selected degrees of freedom in the chart. We can use MegaStat to compute the goodness-of-fit test; see the Software Commands in Appendix C.
14
Goodness-of-Fit Test Example Concluded
Copyright ©2021 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
Step 5: Take sample, make decision, do not reject H0, 2.200 is not greater than 7.815
Step 6: Interpret; the data do not suggest the preferences among the four entrées are different.
15-15
In the formula, fo is the observed frequency and fe is the expected frequency. Basically, once the observed frequencies and the expected frequencies are listed in columns, subtract the expected frequency from the observed frequency in the next column. Then square that difference and then finally divide the squared difference by the expected frequency and sum the results. This sum is the chi-square statistic. We do not reject the null hypothesis. We conclude the differences between the observed values and the expected values are due to chance.
15
Hypothesis Test of Unequal Expected Frequencies Example
Copyright ©2021 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
The American Hospital Administration Association reports the number of times senior citizens are admitted to a hospital during a one-year period; 40% are not admitted, 30% are admitted once, 20% are admitted twice, and 10% are admitted 3 or more times.
Then, a survey of 150 residents of Bartow Estates, a community devoted to active seniors located in central Florida, revealed 55 residents were not admitted, 50 were admitted once, 32 were admitted twice, and the rest in the survey were admitted three or more times. Can we conclude the survey at Bartow Estates is consistent with the information reported by the AHAA?
15-16
The chi-square test can also be used if the expected frequencies are not equal. This example gives a practical use of the chi-square goodness-of-fit test—namely, to find whether a local experience differs from the national experience. We can use the AHAA information to compute expected frequencies for the Bartow Estates residents. If there is no difference between the national experience and the Bartow study, then the expectation is that 40% of the Bartow residents would have been admitted once; (.40)(150)= 60 and so on. The observed and expected frequencies for Bartow residents are given in the table. The six-step hypothesis test follows on the next slide.
16
Hypothesis Test of Unequal Expected Frequencies Example Continued
Copyright ©2021 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
15-17
Step 1: State the null and alternate hypothesis
H0: There is no difference between local and national experience for hospital admissions
H1: There is a difference between local and national experience for hospital admissions
Step 2: Select the level of significance, we select .05
Step 3: Select the test statistic, we’ll use 2
Step 4: Formulate the decision rule, reject H0 if 2 >7.815
Use Appendix B.7 and the .05 significance level to find the critical value for the decision rule. The number of degrees of freedom is 3, found by k − 1 and k = 4. The critical value is 7.815. The decision rule is to reject the null hypothesis if the chi-square statistic > 7.815. The chi-square statistic is 1.3723, so we fail to reject the null hypothesis. We conclude there is no difference between the local and the national experience for hospital admissions.
17
Hypothesis Test of Unequal Expected Frequencies Example Concluded
Copyright ©2021 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
15-18
Step 5: Calculate the test statistic, make decision, do not reject H0,1.3723 < 7.815
Step 6: Interpret; there is no evidence of a difference between the local and the national experience for hospital admissions
Limitations of Chi-Square
Copyright ©2021 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
If there is an unusually small frequency in a cell, chi-square might result in an erroneous conclusion
A very small number in the denominator can make the quotient quite large
For only two cells, the fe should be at least 5
For more than two cells, chi-square should not be used if more than 20% of the fe cells have an expected frequency that is less than 5
15-19
When there is a small frequency in a cell (category), it results in too much weight being given to those categories. When possible, combine categories to resolve the problem. In this example of levels of management, the three vice president cells were combined to create an expected frequency of 7.
19
Limitations of Chi-Square Continued
Copyright ©2021 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
15-20
The issue can be resolved by combining categories if it is logical to do so. In this example, we combine the three vice president categories, which satisfies the 20% policy.
Goodness-of-Fit Test Continued
Copyright ©2021 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
A goodness-of-fit test can be used to determine whether a sample of observations is from a normal population
Calculate the mean and standard deviation of the sample data
Group the data into a frequency distribution
Convert the class limits to z values and find the standard normal probability distribution for each class
For each class, find the expected normally distributed frequency by multiplying the standard normal probability distribution by the class frequency
Calculate the chi-square goodness-of-fit statistic based on the observed and expected class frequencies
Find the expected frequency in each cell by determining the product of the probability of finding a value in each cell by the total number of observations
If we use the information on the sample mean and the sample standard deviation from the sample data, the degrees of freedom are k − 3
15-21
Here are the steps to perform a goodness-of-fit test to determine whether a sample of observations is from a normal population.
21
Hypothesis Test that a Distribution is Normal Example
Copyright ©2021 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
We investigate whether the profit data of Applewood Auto Group follows the normal distribution. In chapter 3, we found the mean profit was $1,843.17 and the standard deviation was $643.63.
15-22
Now, calculate z values to calculate the area of probability for each of the eight classes. This multiplied by the total, 180, will represent the expected frequencies for each class.
z = = = -2.55 z = = = -1.93
P(x < $200) = P(z < -2.55) = .5000 - .4946 = .0054
P($200 < x < $600) = P(-2.55 < z < -1.93) = .0268 - .0054 = .0214
Once all the expected frequencies have been calculated, put them in the table in the column for area. The areas should add up to 1.0000
22
Hypothesis Test that a Distribution is Normal Example Continued
Copyright ©2021 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
Now, combine the classes that have fe < 5.
Once that is done, we can calculate the chi-square statistic.
15-23
Next, we’ll conduct a hypothesis test.
23
Hypothesis Test that a Distribution is Normal Example Concluded
Copyright ©2021 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
15-24
Step 1: State the null and alternate hypothesis
H0: The population of profits follows the normal distribution.
H1: The population of profits does not follow the normal distribution.
Step 2: Select the level of significance, we select .05
Step 3: Select the test statistic, we’ll use chi-square, 2
Step 4: Formulate the decision rule, reject H0 if 2 > 11.070
Step 5: Make decision, 2 = 5.220, we do not reject H0
2 = = + ……… + = 5.220
Step 6: Interpret, we conclude the evidence does not suggest the distribution of profits is other than normal.
Now, we’ll conduct a hypothesis test. When we estimate population parameters with sample data, we lose one degree of freedom for each estimate. So the number of the degrees of freedom is k − 2 − 1, 8 − 2 − 1= 5 since we used the sample mean and the sample standard deviation. From Appendix B.7 using the .05 significance level, the critical value is 11.070. Using formula 15-4, we calculate the chi-square test statistic to be 5.220. Do not reject H0; it appears that the distribution of profits is normal.
24
Contingency Table
Copyright ©2021 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
We can use a contingency table to test whether two traits or characteristics are related
The expected frequency will be determined as follows
The degrees of freedom = (Rows – 1)(Columns – 1)
Example
Ford Motor Company operates the Dearborn plant with 3 shifts per day, 5 days a week. Vehicles are classified as to quality level (acceptable, unacceptable) and shift (day, afternoon, night). Is there a difference in the quality level on the three shifts?
15-25
Here is an example where we are interested in testing whether two nominal-scaled variables are related. Each observation is classified according to two traits.
25
Contingency Table Example
Copyright ©2021 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
Rainbow Chemical, Inc. employs hourly and salaried employees. The vice president of human resources surveyed 380 employees about their satisfaction levels with the current health care benefits program. The employees were then classified according to pay type, salary or hourly. Is it reasonable to conclude that pay type and level of satisfaction with the health care benefits are related?
Step 1: State the null and alternate hypothesis
H0: There is no relationship between level of satisfaction and pay type
H1: There is a relationship between level of satisfaction and pay type
Step 2: Select the level of significance; we select .05
Step 3: Select the test statistic; we’ll use chi-square, 2
15-26
The usual hypothesis testing procedure is used. The HR manager requested the .05 significance level. The level of measurement for pay type is nominal scale. The satisfaction level with health benefits is actually ordinal scale, but we use it as a nominal scale variable. Each sampled employee is classified by two criteria, level of satisfaction with benefits and pay type, and the information is tabulated in a contingency table. The hypothesis test is continued on the next slide.
26
Contingency Table Example Continued
Copyright ©2021 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
Step 4: Formulate the decision rule, reject H0 if chi-square > 5.991
Step 5: Make decision, chi-square is 2.506, do not reject H0
Step 6: Interpret; the sample data do not provide evidence that pay type and satisfaction level with health care benefits are related.
15-27
Since there are two rows and three columns in the contingency table, the degrees of freedom are 2; df = (number of rows − 1)(number of columns − 1)=(2 − 1)(3 − 1)=2 Refer to Appendix B.7, move down the df column in the left margin to the row with 2 df. Move across this row to the column headed .05. The value is 5.991. Use formula 15-5 to calculate the expected frequencies for the table. Then use formula 15-4 to calculate chi-square. It is 2.506, therefore we do not reject H0; it appears that pay type and health care benefits are not related.
27
Chapter 15 Practice Problems
Copyright ©2021 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
15-28
Question 3
Copyright ©2021 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
15-29
The U.S. Department of Transportation estimates that 10% of Americans carpool. Does that imply that 10% of cars will have two or more occupants? A sample of 300 cars traveling southbound on the New Jersey Turnpike yesterday revealed that 63 had two or more occupants. At the .01 significance level, can we conclude that 10% of cars traveling on the New Jersey Turnpike have two or more occupants?
LO15-1
Question 7
Copyright ©2021 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
15-30
The null and alternate hypotheses are:
H0: π1 ≤ π2
H1: π1 > π2
A sample of 100 observations from the first population indicated that x1 is 70. A sample of 150 observations from the second population revealed x2 to be 90. Use the .05 significance level to test the hypothesis.
State the decision rule.
Compute the pooled proportion.
Compute the value of the test statistic.
What is your decision regarding the null hypothesis?
LO15-2
Question 19
Copyright ©2021 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
15-31
A group of department store buyers viewed a new line of dresses and gave their opinions of them. The results were:
Because the largest number (47) indicated the new line is outstanding, the head designer thinks that this is a mandate to go into mass production of the dresses. The head sweeper (who somehow became involved in this) believes that there is not a clear mandate and claims that the opinions are evenly distributed among the six categories. He further states that the slight differences among the various counts are probably due to chance. Test the null hypothesis that there is no significant difference among the opinions of the buyers at the .01 level of significance.
LO15-3
Question 23
Copyright ©2021 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
15-32
From experience, the bank credit card department of Carolina Bank knows that 5% of its card holders have had some high school, 15% have completed high school, 25% have had some college, and 55% have completed college. Of the 500 card holders whose cards have been called in for failure to pay their charges this month, 50 had some high school, 100 had completed high school, 190 had some college, and 160 had completed college. Can we conclude that the distribution of card holders who do not pay their charges is different from all others? Use the .01 significance level.
LO15-3
Question 25
Copyright ©2021 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
15-33
The IRS is interested in the number of individual tax forms prepared by small accounting firms. The IRS randomly sampled 50 public accounting firms with 10 or fewer employees in the Dallas–Fort Worth area. The following frequency table reports the results of the study. Assume the sample mean is 44.8 clients and the sample standard deviation is 9.37 clients. Is it reasonable to conclude that the sample data are from a population that follows a normal probability distribution? Use the .05 significance level.
LO15-5
Question 29
Copyright ©2021 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
15-34
The quality control department at Food Town Inc., a grocery chain in upstate New York, conducts a monthly check on the comparison of scanned prices to posted prices. The following chart summarizes the results of a sample of 500 items last month. Company management would like to know whether there is any relationship between error rates on regularly priced items and specially priced items. Use the .01 significance level.
LO15-6