Statistic 6

edwin.villa
Week6HypothesisTesting.pdf

Hypothesis Testing is a decision-making process called a Test of Significance.

Below are the 4 unique parts to Hypothesis Testing.

1) The Hypothesis Scenario. This includes the Null and Alternative scenarios.

a. Ho: Null Hypothesis

Ha or H1: Alternative Hypothesis 2) T- Test Statistic

𝑇𝑆 = �̅� − 𝜇 𝑠

√𝑛 ⁄

Where �̅� is the sample mean, 𝑠 is the sample standard deviation, 𝑛 is the sample size, and 𝜇 is the population mean defined in the null hypothesis of step 1

3) P-value. The p-value tells you if there is evidence to suggest that your null hypothesis is incorrect. You will either reject your null hypothesis, or you fail to reject the null hypothesis. *NOTE: we NEVER Accept null hypotheses, rather find that there was not enough evidence to reject a null hypothesis. To find the p-value we will use =T.DIST(), T.DIST.RT() or T.DIST.2T depending on the direction of the alternative hypothesis. The degrees of freedom (DF) is n – 1.

4) Conclusion:

a. State whether your p-value is greater than alpha (𝛼) or less than alpha (𝛼). *NOTE, the value of alpha (𝛼) is defined prior to conducting a hypothesis test. The most common choices for the value of alpha (𝛼) are 0.05, 0.01, 0.10 and 0.005. Alpha (𝛼) is the acceptable Type 1 error. Type 1 error occurs when a null hypothesis is rejected, though in reality the null hypothesis should not have been rejected because the null hypothesis is true. Type 1 error is also called the “false positive” rate.

b. Decide to Reject the null hypothesis (Ho) if the p-value is less than alpha (𝛼), or Fail to reject the null hypothesis (Ho) if the p-value is more than alpha (𝛼)

c. If you reject Ho, state that there is evidence for the alternative hypothesis. If you fail to reject Ho, state that there is not enough evidence to support the alternative hypothesis. *NOTE: we NEVER Accept or Reject alternative hypotheses, rather we say that our sample provide evidence to support the alternative hypothesis, or our sample does not provide enough evidence to support the alternative hypothesis. The alternative hypothesis is not directly being tested and therefore can not directly be accepted or rejected!

There are 3 different directions of the alternative hypothesis

1) A Left sided, or a Left Tailed Test. We use a left sided test to examine if the population mean is lower than the mean defined in the null hypothesis (Ho). A left sided test uses the following hypothesis scenario:

𝐻0: 𝜇 = 𝑐

𝐻𝑎: 𝜇 < 𝑐

Where 𝑐 is the number we are testing whether the population mean, 𝜇, is less than. For example if we wanted to know if the population mean, 𝜇, is less than 15, then 𝑐 would be 15 in both the null and alternative hypothesis. To find the p-value for a left sided test, we use =T.DIST() in excel.

2) A Right sided, or a Right Tailed Test. We use a right sided test to examine if the population mean is higher than the mean defined in the null hypothesis (Ho). A right sided test uses the following hypothesis scenario:

𝐻0: 𝜇 = 𝑐

𝐻𝑎: 𝜇 > 𝑐

Where 𝑐 is the number we are testing whether the population mean, 𝜇, is more than. For example if we wanted to know if the population mean, 𝜇, is more than 15, then 𝑐 would be 15 in both the null and alternative hypothesis. To find the p-value for a right sided test, we use =T.DIST.RT() in excel.

3) A Two sided, or a Two Tailed Test. We use a two sided test to examine if the population mean is different than the mean defined in the null hypothesis (Ho). A two sided test uses the following hypothesis scenario:

𝐻0: 𝜇 = 𝑐

𝐻𝑎: 𝜇 ≠ 𝑐

Where 𝑐 is the number we are testing whether the population mean, 𝜇, is different than. For example if we wanted to know if the population mean, 𝜇, is not 15, then 𝑐 would be 15 in both the null and alternative hypothesis. To find the p-value for a two sided test, we use =T.DIST.2T() in excel.

Example 1 – A Left Sided Test

Now let’s continue to look at our car price data from Week 1. We know the sample mean, �̅� =

25,650, the sample standard deviation, 𝑠 = 3,488 and n = 10. A friend claims that the average

vehicle from the type of car you chose during week 1 sells for less than $27,000. Let us test

our friend’s hypothesis using alpha = 0.05. We will write out the 4 steps to do this.

1) State the null and alternative hypotheses

𝐻0: 𝜇 = 27,000

𝐻𝑎: 𝜇 < 27,000

2) Calculate the test statistic

𝑇𝑆 = �̅� − 𝜇 𝑠

√𝑛 ⁄

You may notice that the denominator (bottom of the fraction) looks familiar. 𝑠 √𝑛

⁄ is the

standard error, SE. I start solving for my test statistic, TS, by finding the standard error, SE:

When I press enter, I find that the standard error, SE, is 1,103. Now I can simplify my equation for the test statistic:

𝑇𝑆 = �̅� − 𝜇

𝑆𝐸 =

25,650 − 27,000

1,103 = −1.2238

*Notice that I am plugging in 𝜇 = 27,000 while calculating my test statistic. I am using the population mean, 𝜇, from the null hypothesis, Ho.

3) P-value. To find the p-value for a left sided test we use =T.DIST() in Excel. The degrees of

freedom (DF) is n – 1.

When I press enter, I find that the p-value is 0.1261

4) Conclusion:

a. Recall from the problem statement that we set alpha = 0.05.

0.1261 > 0.05, therefore our p-value is greater than alpha.

b. We fail to reject the null hypothesis (Ho) because our p-value is more than alpha

c. There is not enough evidence to suggest that the average vehicle from the type of car you chose during week 1 sells for less than $27,000.

Example 2 – A Right Sided Test

Next, a friend claims that the average vehicle from the type of car you chose during week 1

sells for higher than $23,500. Let us test our friend’s hypothesis using alpha = 0.05. We will

write out the 4 steps to do this.

1) State the null and alternative hypotheses

𝐻0: 𝜇 = 23,500

𝐻𝑎: 𝜇 < 23,500

2) Calculate the test statistic

𝑇𝑆 = �̅� − 𝜇 𝑠

√𝑛 ⁄

You may notice that the denominator (bottom of the fraction) looks familiar. 𝑠 √𝑛

⁄ is the

standard error, SE. I start solving for my test statistic, TS, by finding the standard error, SE:

When I press enter, I find that the standard error, SE, is 1,103. Now I can simplify my equation for the test statistic:

𝑇𝑆 = �̅� − 𝜇

𝑆𝐸 =

25,650 − 23,500

1,103 = 1.9490

*Notice that I am plugging in 𝜇 = 23,500 while calculating my test statistic. I am using the population mean, 𝜇, from the null hypothesis, Ho.

3) P-value. To find the p-value for a right sided test we use =T.DIST.RT() in Excel. The

degrees of freedom (DF) is n – 1.

When I press enter, I find that the p-value is 0.0416

4) Conclusion:

a. Recall from the problem statement that we set alpha = 0.05.

0.0416 < 0.05, therefore our p-value is less than alpha.

b. We reject the null hypothesis (Ho) because our p-value is less than alpha

c. There is enough evidence to suggest that the average vehicle from the type of car you chose during week 1 sells for more than $23,500.

Example 3 – A Two Sided Test

Lastly, a friend claims that the average vehicle from the type of car you chose during week 1

will not sell for $23,500. Let us test our friend’s hypothesis using alpha = 0.05. We will write

out the 4 steps to do this.

1) State the null and alternative hypotheses

𝐻0: 𝜇 = 23,500

𝐻𝑎: 𝜇 ≠ 23,500

2) Calculate the test statistic

𝑇𝑆 = �̅� − 𝜇 𝑠

√𝑛 ⁄

You may notice that the denominator (bottom of the fraction) looks familiar. 𝑠 √𝑛

⁄ is the

standard error, SE. I start solving for my test statistic, TS, by finding the standard error, SE:

When I press enter, I find that the standard error, SE, is 1,103. Now I can simplify my equation for the test statistic:

𝑇𝑆 = �̅� − 𝜇

𝑆𝐸 =

25,650 − 23,500

1,103 = 1.9490

*Notice that I am plugging in 𝜇 = 23,500 while calculating my test statistic. I am using the population mean, 𝜇, from the null hypothesis, Ho.

3) P-value. To find the p-value for a two sided test we use =T.DIST.2T() in Excel. The

degrees of freedom (DF) is n – 1.

When I press enter, I find that the p-value is 0.0831

4) Conclusion:

a. Recall from the problem statement that we set alpha = 0.05.

0.0831 > 0.05, therefore our p-value is greater than alpha.

b. We fail to reject the null hypothesis (Ho) because our p-value is more than alpha

c. There is not enough evidence to suggest that the average vehicle from the type of car you chose during week 1 sells a price different than $23,500.

*Important note when using =T.DIST.2T() in Excel

When your test statistics (TS) is negative, and you have a two sided test, you need to remove

the negative sign before using T.DIST.2T(). One way to remove the negative sign is to use the

absolute value function, ABS(). For example, if I wanted to test whether the average car price

is different than 27,000, the test statistics would be -1.2238. The p-value for this test can be

calculated in Excel as follows:

When I press enter, I find that the p-value is 0.2521. If you forget to take the absolute value

Excel will give you #NUM!. It is important to use the absolute value only for the two sided

t-test.