# HYPOTHESIS TESTING WITH ONE · PDF file 2009-08-25 · CHAPTER 7 HYPOTHESIS TESTING...

date post

18-Mar-2020Category

## Documents

view

6download

1

Embed Size (px)

### Transcript of HYPOTHESIS TESTING WITH ONE · PDF file 2009-08-25 · CHAPTER 7 HYPOTHESIS TESTING...

CHAPTER 7

HYPOTHESIS TESTING WITH ONE SAMPLE

Hypothesis testing in this chapter test the value of a population parameter (population mean (μ), or population proportion (p)) against some specified value k. Hypothesis testing is a very important tool that helps us to decide whether to accept or reject a claim about the population parameter. In this chapter we will illustrate how to:

Use the z-test to test means of large samples or known δ. Use the t-test to test means of small samples and unknown δ. Use the z-test to test populations’ proportions.

Hypothesis Testing for the Mean (Large Samples or δ Known) When the population standard deviation δ is known or the sample size is large (n ≥ 30), the z-test is appropriate to test the null hypothesis (H0) against the alternative hypothesis (Ha). Excel’s function for the z-test is given below. ZTEST (array, x, sigma): This returns the P-value for a right tailed test (H0: μ ≤ k versus Ha: μ > k). Note that the Excel documentation for the z-test should be ignored. It is mistakenly says that z-test gives the result of two-tailed test. The Excel’s function ZTEST (array, x), i.e., if there is no sigma value is given then Excel calculates the sample standard deviation (s) from the sample data and it uses it instead of sigma (δ). Recall that the formula for finding the test statistics is z = (xbar- μ)/ (δ/√n), where xbar is the sample mean, μ is the hypothesis mean, δ is the standard deviation, and n is the sample size. z-test can also be used to apply a left-tailed test (H0: μ ≥ k versus Ha: μ < k) or a two-tailed test (H0: μ= k versus Ha: μ ≠ k). To apply a left tailed test, for the case μ < k, simply apply a right-tailed test and then subtract the result from 1. To apply a two-tailed test for the case μ ≠ k, either double the P- value from a right tailed test (μ>k) or double the P-value from a left tailed test (μ

The predefined Excel’s function ZTEST can be called as follows. Select Insert Function. Select Statistical category, and scroll through the list of functions and highlight ZTEST [see Figure (7.1)] and click OK. A dialog box should be opened [see Figure (7.2)], and then it has to be completed. Note that sigma (δ) is optional. If this box left blank, Excel will compute the standard deviation for the data in the specified array and use s instead of δ in the computation of z. In the dialog box X means the k value in the hypothesis test. Once the P-value is computed, the user can then compare it with α, the level of significance. If P-value ≤ α, the null hypothesis (H0) will be rejected. But if P-value > α, the null hypothesis will not be rejected.

Figure (7.1)

144

Figure (7.2)

Example 7.1:

The data below represent the miles per gallon gasoline consumption (highway) for a random sample of 44 makes and models of passenger cars.

30 35 24 27 25 35 31 33 30 27 24 18 15 29 28 32 32 24 25 37 26 26 30 49 28 25 27 51 24 28 27 26 31

13 27 31 29 24 17 29 17 29 32 18

In testing the hypothesis that the population mean mile per gallon gasoline consumption for such cars is greater than 25 mpg, find the P-value.

145

Solution: Since is δ is not known and n ≥ 30, we use s instead of δ in calculating test statistic.

- Open a new worksheet and enter the miles per gallon in column A. - In cell C1, type Null Hypothesis: μ ≤ 25, and in cell C2, type

Alternative Hypothesis: μ > 25. - In cell C3, type P-value for the right-tailed test. - In cell F3, enter the command = ZTEST (A2:A45, 25) and click

Enter. This returns a value 0.004392 as a P-value for the right-tailed test.

- In cell C5, select Tools Data Analysis Descriptive statistics. Select Summary Statistics, and click OK.

- In cell C23, type z = (Sample mean – Hyp. mean)/(Standard Error), where

Standard error is equal to δ/√n. If δ is unknown and the sample size is large (n ≥ 30), s is used instead of δ.

- In cell F23, type = (D7- 25)/D8, and click the Enter key. This returns 2.620363894 as a value of the test statistic z defined above.

- In cell C24, type P-value = P (z>2.62036894). - In cell F24, type = 1-NORMSDIST (2.620363814), and click the

Enter key. This return 0.004391799, which is another way of computing the P-value besides using the z-test [see Figure (7.3)].

Figure (7.3)

146

Now, a worksheet template will be created to test claims about populations’ means for large samples or known δ based on the P-value method (P-value is used to make decisions) for left-tailed, right-tailed, or two-tailed test.8

- Open a new worksheet, and in cell A1, type Hypothesis testing about a population mean (large sample or sigma known).

- In cell A3, type input Data. - In cells A4, A5, A6, A7, and A8, type Sample_mean, Hyp_mean, n,

Std_Dev, and Alpha, respectively. - Highlight cells A4: A8, and click on the Align right icon. - In cell A10, type Standard Error. - In cell A11, type test statistic, z. - In cell A13, type Testing for a right-tailed test. - In cells A14 and A15 type P-value, and Conclusion, respectively. - In cell A 17, type Testing for a left-tailed test. - In cells A18 and A19 type P-value and Conclusion, respectively. - In cell A21, type testing for a two-tailed test. - In cells A22, and A23, type P-value and Conclusion, respectively. - In cell B10, type = Std_Dev/ SQRT (n), and click the Enter key. - In cell B11, type = (Sample_mean –Hyp_mean) / (Standard Error),

and click Enter. - In cell B14, type = 1- NORMSDIST (z) and click the Enter key. - In cell B15, type = if (P-value > Alpha, “Do no reject H0”, “Reject

H0”) and click Enter. - In cell B18, type = NORMSDIST (z), and click the Enter key. - In cell B19, type = if (P-value > Alpha, “Do no reject H0”, “Reject

H0”) and click the Enter key. - In cell B22, type = if (z > 0, 2* (1-NORMSDIST (z)),

2*NORMSDIST (z)), and click the Enter key. - In cell B23, type = if (P-value > Alpha, “Do no reject H0”, “Reject

H0”) and click the Enter key.

After you finished editing, and retyping the worksheet, it should have the cell contents as shown in Figure (7.4). Formulas can be entered by replacing cell contents by their addresses. For example, the test statistic z should be replaced by B11. To display the formula view [see Figure (7.5)], instead of the output [see Figure (7.6)], that will be used in testing claims about populations means for large samples or known δ by using the P-value method, hold down key and tap the key. Note

8 Goffinet/Koehler/Merchant, Microsoft Excel Manual, McGraw Hill, 2007.

147

that the cells B10, B11, B14, B15, B18, B19, B22, and B23 in the template created display # Div /0!; but they will change when the cells B4:B8 are filled with their data values.

Figure (7.4)

Figure (7.5)

148

Figure (7.6)

The template created, based on the P-value method is saved under the name “Hypothesis Testing_Population Mean_Large Samples_Pvalue_Template.xls” [see Figure (7.6)]. This template can be used to test claims about the population means for large samples or known population standard deviation (δ) using the P-value method. Example 7.2: The average salary for public community college instructor a specific year was reported to be $41,375. A random sample of 50 public community college instructors in a particular State had a mean $43, 860 and a standard deviation of $6125. Is there enough evidence at α = 0.05 to conclude that the mean salary differs from $41,375. Solution: The null and alternative hypotheses are given below. Null Hypothesis (H0): μ= $ 41,375 Alternative Hypothesis (Ha): μ ≠ $41,375 (Claim)

149

- Open the template that was created under the name “Hypothesis Testing_Population Mean_Large Samples _Pvalue_Template.xls”, and enter the input data: Sample_mean = 43,860, Hyp_mean = 41,375, Std_Dev = 6125, Alpha = 0.05 and n = 50.

- Activate the other cells and save this worksheet as Example (7.2). - The worksheet that shows the results is shown in Figure (7.7). Thus, it

is clear from cell B23 (since the test is a two tailed-test) that the null hypothesis (H0) is rejected. That means there is enough evidence to conclude that the mean salary differs from $ 41,375.

Note that the template that was created can be used to test a claim about a population mean if δ is known or the sample size is large (n ≥ 30). If δ is unknown and the sample size is large (n ≥ 30), sample standard deviation s should be used instead of the population standard deviation δ. If a set of data is given, the sample mean (xbar), sample standard deviation (s), and standard error can be obtained from the summary statistic. P-value can be computed as explained in the template or by using z-test as it was explained in Example 7.1.

Figure (7.7)

150

Example 7.3: The data below represent the miles per gallon gasoline consumption (highway) for a random sample of 44 makes and models.

30 35 24 27 25 35 31 33 30 27 24 18 15 29 28 32 32 24 25 37 26 26 30 49 28 25 27 51 24 28 27 26 31

13 27 31 29 24 17 29 17 2

*View more*