Class 1 Review Hypothesis Testing for One and Two Tailed Tests p-values.

19
Class 1 Review Hypothesis Testing for One and Two Tailed Tests p-values

Transcript of Class 1 Review Hypothesis Testing for One and Two Tailed Tests p-values.

Page 1: Class 1 Review Hypothesis Testing for  One and Two Tailed Tests p-values.

Class 1

Review

Hypothesis Testing for

One and Two Tailed Tests

p-values

Page 2: Class 1 Review Hypothesis Testing for  One and Two Tailed Tests p-values.

Hypothesis Testing

• A formalism of probability theory and sampling distributions

• Example:• You are told that the incomes in a community have

a normal distribution with = $5,000.

• Suppose you conjecture that the average income is $25,000.

• If in a sample of 100 households, the average is $26,500 should you still believe your conjecture?

Page 3: Class 1 Review Hypothesis Testing for  One and Two Tailed Tests p-values.

The Steps in a Hypothesis Test(1) State the hypotheses.

(2) Identify the test statistic and its distribution.

(3) Specify the significance level.

(4) State the decision rule.

(5) Collect the data and perform the analysis.

(6) Make a statistical decision.

(7) Make the real decision.

Page 4: Class 1 Review Hypothesis Testing for  One and Two Tailed Tests p-values.

Establishing the Hypotheses

• State a null hypothesis, H0, which is what we will assume (temporarily) to be true.

• Example: H0: = 25,000

• State an alternative hypothesis, H1, which is mutually exclusive of H0.

• Example: H1: 25,000

Page 5: Class 1 Review Hypothesis Testing for  One and Two Tailed Tests p-values.

Establishing the Hypotheses (cont.)

Note: In many cases, the null hypothesis will be whatever it is that you are trying to disprove.

Page 6: Class 1 Review Hypothesis Testing for  One and Two Tailed Tests p-values.

• In order to test a hypothesis about , where will we get our information?

• What is its distribution?

• This fact allow us to use

as our test statistic.

Identify the Test Statistic and its Distribution

Page 7: Class 1 Review Hypothesis Testing for  One and Two Tailed Tests p-values.

Specify the Significance Level ()

• This is just a declaration of what it is we will call rare. For example, we might be interested in the rarest 5% of the or z values under H0.

• What should we do if we get one of these rare values?

• However, if we still conclude H0 is true when we get rare results assuming H0, when would we ever disbelieve it?

X

Page 8: Class 1 Review Hypothesis Testing for  One and Two Tailed Tests p-values.

State the Decision Rule

• We wish to say that we will reject H0 if we get one of the smallest 2.5% of the z-values, or one of the largest 2.5% of the z-values.

• What value cuts off 2.5% in the tail of the z-distribution?

Page 9: Class 1 Review Hypothesis Testing for  One and Two Tailed Tests p-values.

Collect the Data and Perform the Analysis

• We have already computed

• Then

.500,26x

Page 10: Class 1 Review Hypothesis Testing for  One and Two Tailed Tests p-values.

Make a Statistical Decision

• Since 3 > 1.96, we reject H0 and conclude that

Page 11: Class 1 Review Hypothesis Testing for  One and Two Tailed Tests p-values.

Make the Real Decision

• The decision is problem specific. The statistical test has potentially provided us with new information. Now we might:

• Take a larger sample and redo the analysis,• Publish our results in an academic or practitioner journal,• Settle the lawsuit,• Order more medical tests,• Shut down our production facility,• Etc.

Page 12: Class 1 Review Hypothesis Testing for  One and Two Tailed Tests p-values.

One-tailed and Two-tailed Tests

• Our income problem is referred to as a two-tailed test. Can you see why?

• This example introduces a one-tailed test:• A consumer activist would like to prove that a major

fast-food company is cheating the public by not putting a quarter pound of hamburger on average into their quarter pound sandwiches. A sample of 100 sandwiches is taken and weighed resulting in an average of .24 pounds. If it is known that = .05, should legal action be taken? Assume that = .01.

Page 13: Class 1 Review Hypothesis Testing for  One and Two Tailed Tests p-values.

Example (cont.)

• What are the hypotheses?

• What does the distribution of look like under H0? Would you reject H0 for large values of ?

• As a result, our rejection region is only in one tail.

X

X

Page 14: Class 1 Review Hypothesis Testing for  One and Two Tailed Tests p-values.

Example (cont.)

• What is the critical value that cuts off the smallest 1% of the ?

• What is the decision rule?

• How do you compute z?

sX '

Page 15: Class 1 Review Hypothesis Testing for  One and Two Tailed Tests p-values.

Example (cont.)

• What should we conclude?

• In summary, how will you know when you have a two-tailed test? A one-tailed test?

Page 16: Class 1 Review Hypothesis Testing for  One and Two Tailed Tests p-values.

P-values

• In our last example, what would our decision rule have been if we had used =.025?

• What would our decision have been?

• It is very common to cite a p-value when reporting results. This allows a reader or listener to choose what they believe is rare.

Page 17: Class 1 Review Hypothesis Testing for  One and Two Tailed Tests p-values.

P-values (cont.)

• A p-value can be interpreted as:• The probability of seeing a test statistic as rare as

the one encountered in the sample (where rareness is defined by the alternative hypothesis).

• The smallest at which we could reject H0.

0228.

}2{

10005.

25.24.

}24.{

ZP

n

XP

XPvaluep

Page 18: Class 1 Review Hypothesis Testing for  One and Two Tailed Tests p-values.

P-values (cont.)

• Do you think that this was a rare sample?

• Remarks:• (1) For a two-tailed test, compute the p-value by

computing the area in the tail and multiply by 2.

• (2) Essentially all statistical software packages cite p-values when doing various tests.

• (3) Practice computing a p-value in the homework problems.

Page 19: Class 1 Review Hypothesis Testing for  One and Two Tailed Tests p-values.

Using EXCEL

• Where does the computational work come from in computing z?

• EXCEL assumes that you will give it the raw data (array), the hypothesized mean (it calls it X), and sigma using the ztest function.

• Note that this returns a upper-tailed p-value, even though it says it is two-tailed. What should we do if we want a two-tailed test?