Hypothsis Testing - One Sample

26
Testing of Hypothesis Hypothesis testing can be used to determine whether a statement about the value of a population parameter should or should not be rejected. The null hypothesis , denoted by H 0 , is a tentative assumption about a population parameter. The alternative hypothesis , denoted by H a , is the opposite of what is stated in the null hypothesis. Hypothesis testing is similar to a criminal trial. The hypotheses are: H 0 : The defendant is innocent H a : The defendant is guilty

Transcript of Hypothsis Testing - One Sample

Page 1: Hypothsis Testing - One Sample

Testing of Hypothesis• Hypothesis testing can be used to determine

whether a statement about the value of a population parameter should or should not be rejected.

• The null hypothesis, denoted by H0 , is a tentative assumption about a population parameter.

• The alternative hypothesis, denoted by Ha, is the opposite of what is stated in the null hypothesis.

• Hypothesis testing is similar to a criminal trial. The hypotheses are:

H0: The defendant is innocentHa: The defendant is guilty

Page 2: Hypothsis Testing - One Sample

• The equality part of the hypotheses always appears in the null hypothesis.

• In general, a hypothesis test about the value of a population mean must take one of the following three forms (where 0 is the hypothesized value of the population mean).

H0: > 0 H0: < 0 H0: = 0

Ha: < 0 Ha: > 0 Ha: 0

Page 3: Hypothsis Testing - One Sample

• Null and Alternative HypothesesA major west coast city provides one of the

most comprehensive emergency medical services in the world. Operating in a multiple hospital system with approximately 20 mobile medical units, the service goal is to respond to medical emergencies with a mean time of 12 minutes or less.

The director of medical services wants to formulate a hypothesis test that could use a sample of emergency response times to determine whether or not the service goal of 12 minutes or less is being achieved.

Page 4: Hypothsis Testing - One Sample

• Null and Alternative HypothesesHypotheses Conclusion and Action

H0: The emergency service is meeting

the response goal; no follow-up action is necessary.

Ha: The emergency service is not

meeting the response goal; appropriate follow-up action is necessary.

Where: = mean response time for the population

of medical emergency requests.

Page 5: Hypothsis Testing - One Sample

• Since hypothesis tests are based on sample data, we must allow for the possibility of errors.

• A Type I error is rejecting H0 when it is true.• A Type II error is accepting H0 when it is false.• The person conducting the hypothesis test

specifies the maximum allowable probability of making a Type I error, denoted by and called the level of significance.

• Generally, we cannot control for the probability of making a Type II error, denoted by .

• Statistician avoids the risk of making a Type II error by using “do not reject H0” and not “accept H0”.

Page 6: Hypothsis Testing - One Sample

• Type I and Type II Errors

Population Condition

H0 True Ha True

Conclusion ( ) ( )

Accept H0 Correct Type II

(Conclude Conclusion Error

Reject H0 Type I Correct

(Conclude error Conclusion

Page 7: Hypothsis Testing - One Sample

• The The pp-value-value is the probability of obtaining a is the probability of obtaining a sample result that is at least as unlikely as sample result that is at least as unlikely as what is observed.what is observed.

• The The pp-value can be used to make the decision -value can be used to make the decision in a hypothesis test by noting that:in a hypothesis test by noting that:– if the if the pp-value is less than the level of significance -value is less than the level of significance

αα, the value of the test statistic is in the rejection , the value of the test statistic is in the rejection region.region.

– if the if the pp-value is greater than or equal to -value is greater than or equal to αα, the , the value of the test statistic is not in the rejection value of the test statistic is not in the rejection region.region.

• Reject Reject HH0 if the 0 if the pp-value < -value < αα..

Page 8: Hypothsis Testing - One Sample

The Steps of Hypothesis TestingThe Steps of Hypothesis Testing• Determine the appropriate hypotheses.Determine the appropriate hypotheses.• Select the test statistic for deciding whether or not to Select the test statistic for deciding whether or not to

reject the null hypothesis.reject the null hypothesis.• Specify the level of significance Specify the level of significance αα for the test. for the test.• Use Use αα to develop the rule for rejecting to develop the rule for rejecting HH0.0.• Collect the sample data and compute the value of the Collect the sample data and compute the value of the

test statistic.test statistic.• a) Compare the test statistic to the critical value (s) in a) Compare the test statistic to the critical value (s) in

the rejection rule, or the rejection rule, or • b) Compute the b) Compute the pp-value based on the test -value based on the test

statistic and compare it statistic and compare it αα to determine whether or not to determine whether or not to reject to reject HH0.0.

Page 9: Hypothsis Testing - One Sample

One-Tailed Tests about a Population Mean: Large-One-Tailed Tests about a Population Mean: Large-Sample Case (Sample Case (nn >> 30) 30)

Z Zif HReject Z Zif HReject

RuleRejection

)(.

E(t)-t Z StatisticTest

:H :H

:H :H Hypotheses

00

0101

0000

tES

Page 10: Hypothsis Testing - One Sample

• One-Tailed Test about a Population Mean: Large n

Let = P (Type I Error) = .05

Sampling distribution of mean (assuming H0 is true and = 12)

1212

Reject H0

Do Not Reject H0Do Not Reject H0

xx

(Critical value)

Page 11: Hypothsis Testing - One Sample

Two -Tailed Tests about a Population Mean: Large-Two -Tailed Tests about a Population Mean: Large-Sample Case (Sample Case (nn >> 30) 30)

ZZ if HReject

RuleRejection

)(.

E(t)-t Z StatisticTest

)or ( :H

:H Hypotheses

2/0

0001

00

tES

Page 12: Hypothsis Testing - One Sample

Sampling distribution of (assuming H0 is true and = 100)

Sampling distribution of (assuming H0 is true and = 100)

00 1.96 1.96

Reject H0Reject H0Do Not Reject H0Do Not Reject H0

zz

Reject H0Reject H0

-1.96 -1.96

Page 13: Hypothsis Testing - One Sample

Tests about a Population Mean:Small-Sample Case (n < 30)

• Test Statistic Known Unknown

This test statistic has a t distribution with n - 1 degrees of freedom.

• Rejection Rule One-Tailed Two-Tailed

H0: Reject H0 if t > t H0: Reject H0 if t < -t H0: Reject H0 if |t| > t

tx

n

0

/txs n

0

/

Page 14: Hypothsis Testing - One Sample

Summary of Test Statistics to be Used in aSummary of Test Statistics to be Used in aHypothesis Test about a Population MeanHypothesis Test about a Population Mean

n n >> 30 ? 30 ?

σσ known ?known ?

Popul. Popul. approx.approx.normal normal

??σσ known ? known ?

Use Use ss to toEstimate Estimate σσ

Use Use ss to toestimate estimate σσ

Increase Increase nnto to >> 30 30/

xz

n

/

xz

n

/

xzs n

/

xzs n

/

xz

n

/

xz

n

/

xts n

/

xts n

YesYes

YesYes

YesYes

YesYes

NoNo

NoNo

NoNo

NoNo

Page 15: Hypothsis Testing - One Sample

Standard error of sampling distribution of statistic:

2

22

1

11

2

2

1

2

p proportion twoof eDifferennc

means twoof eDifferennc

Proportion Sample

n Mean Sample

)(statistic S.E Statistic

n

qp

n

q

nn

npq

yx

Page 16: Hypothsis Testing - One Sample

One Sample tests

Page 17: Hypothsis Testing - One Sample

.Hreject weother wise .Hreject not do we the Zof value)(tabulated critical the

than less is Zof valuecalculated theif

unknown is ,

nS-x

)xS.E(

)xE(-x Z

bygiven is statistic test theHunder

tailed)-two( i.emean sample theand

mean populationbetween differencet significan is There :H

i.emean sample theand

mean populationbetween differencet significan no is There :H

00

0

0

0

0

a

0

0

n

x

1)Z- test for single mean:

Page 18: Hypothsis Testing - One Sample

Critical values of Z

Critical values Level of Significance (α)

  1% 5% 10%

Two-tailed test 2.58 1.96 1.645

Right-tailed test 2.33 1.645 1.28

Left-tailed test -2.33 -1.646 -1.28

Page 19: Hypothsis Testing - One Sample

Ex: The average commission charged by full-service brokerage firms on a sale of common stock is $144, and the standard deviation is $52. Joel Freelander has taken a random sample of 121 trades by his clients and determined that paid an average commission of $151.At 0.10 significance level, can Joel conclude that his clients are higher than the industry average?

Page 20: Hypothsis Testing - One Sample

Ex: Maxwell’s Hot Chocolate is concerned about the effect of the recent year coffee advertising campaign on hot chocolate sales. The average weekly hot sales two years ago was 984.7 pounds and the standard deviation was 72.6 pounds. Maxwell’s has randomly selected 34 weeks from past year and found average sales of 912.1 pounds.

a) State appropriate hypothesis for testing whether hoe chocolate sales have decreased.

b) At the 1%, 2% significance, test these hypothesis.

Page 21: Hypothsis Testing - One Sample

2) Z- test for single proportion:

X : No.of successes

p: Sample proportion no.of successes

.Hreject weOther wise

.Hreject not do then we Zof valuecritical than theless is Zof calculated theifn

QP

P-p

S.E(p)

E(p)-p Z

bygiven is statistic test theHunder

PP i.e proportion population

and proportion samplebetween differencet significan no is There :H

PP i.e proportion population

and proportion samplebetween differencet significan no is There :H

0

0

00

0

0

0

a

0

0

Page 22: Hypothsis Testing - One Sample

Ex: A ketchup manufacturer is in the process of deciding whether to produce a new extra-spicy brand. The company’s marketing – research department used a national telephone survey of 6000 households and found that the extra-spicy ketchup would be purchased by 355 of them. A much more extensive study made 2 years ago showed that 5% of the households would purchase the brand then. At a 1% significance level, should the company conclude that there is an increased interest in the extra-spicy flavor?

Page 23: Hypothsis Testing - One Sample

Ex: From a total of 10,200 loans made by a state employee's credit union in the most recent 5-year period, 350 were sampled to determine what proportion was made to women. This sample showed that 39% of the loans were made to women employee’s. A complete census of loans 5 years ago showed that 41% of the borrowers that the proportion of loans made to women. At a significance level of 0.02, can you conclude that the proportion of loans made to women has changed significantly in the past 5 years?

Page 24: Hypothsis Testing - One Sample

3) t-test for single mean (n<30, σ is unknown):

.Hreject weother wise .Hreject not do we

then t i.e t of value)(tabulated critical the

than less ist i.e t of valuecalculated theif

variancepopulation ofestimator unbiasedan is 1

)x-(XS where

)xS.E(

)xE(-x t

bygiven is statistic test theHunder

tailed)-two( i.emean sample theand

mean populationbetween differencet significan is There :H

i.emean sample theand

mean populationbetween differencet significan no is There :H

00

.)1(,..%tab,

cal

22

2

0

0

0

a

0

0

fdnsol

n

nSx

Page 25: Hypothsis Testing - One Sample

Ex: From 1980 until 1985, the mean price/earnings (P/E) ratio of the approximately 1800 stocks listed on the New York Stock Exchange was 14.35 and the standard deviation was 9.73. In a sample of 30 randomly chosen NYSE stocks, the mean P/E ratio in 1986 was 11.77. Does this sample present sufficient evidence to conclude that in 1986 the mean P/E ratio for NYSE stocks had changed from its earlier value at 5% level?

Page 26: Hypothsis Testing - One Sample

Ex: A television documentary on overeating claimed that Americans are about 10 pounds overweight on average. To test this claim, 18 randomly selected individuals were examined; their average excess weight was found to be 12.4 pounds, and the sample standard deviation was 2.7 pounds. At a 1% level, is there any reason to doubt the validity of the claimed 10-pounds value?

(t cal,1% = 2.898)