Hypothesis Testing

78
HYPOTHESIS HYPOTHESIS & & Its Testing Its Testing Gaurav Singh Gaurav Singh R.B.T.T.I., Bareilly R.B.T.T.I., Bareilly

Transcript of Hypothesis Testing

Page 1: Hypothesis Testing

HYPOTHESISHYPOTHESIS&&Its TestingIts Testing

Gaurav SinghGaurav Singh

R.B.T.T.I., BareillyR.B.T.T.I., Bareilly

Page 2: Hypothesis Testing

HypothesisHypothesis

HypoHypo- Less Then - Less Then ThesisThesis- view or theory- view or theory

It is a tentative explanation or solution.It is a tentative explanation or solution. It is declarative testable relationship between It is declarative testable relationship between

two or more variables.two or more variables. A hypothesis is the assumption that we make A hypothesis is the assumption that we make

about the population parameter. This can be about the population parameter. This can be any assumption about a population parameter any assumption about a population parameter not necessarily based on statistical data.not necessarily based on statistical data.

Page 3: Hypothesis Testing

Hypothesis: Hypothesis: Not Necessary in-Not Necessary in-

Fact finding studiesFact finding studies Exploratory researchesExploratory researches In historical researches (theoretical)In historical researches (theoretical) But in all Analytical and experimental But in all Analytical and experimental

researches, hypothesis should be researches, hypothesis should be formulated.formulated.

Page 4: Hypothesis Testing

Characteristics Characteristics

Conceptually clearConceptually clear TestableTestable Economic and parsimoniousEconomic and parsimonious Related to existing body of theory and Related to existing body of theory and

facts.facts. Logical unity and comprehensivenessLogical unity and comprehensiveness

Page 5: Hypothesis Testing

General in scopeGeneral in scope Related to available scientific tools and Related to available scientific tools and

techniquestechniques Tentative answer to the proposed Tentative answer to the proposed

problemproblem OperationalOperational Specific but not trivial or inconsequentialSpecific but not trivial or inconsequential

Page 6: Hypothesis Testing

Types of hypothesisTypes of hypothesis

Based on function:Based on function: DescriptiveDescriptive RelationalRelational

Based on approach:Based on approach: WorkingWorking nullnull StatisticalStatistical

Based on level of abstractionBased on level of abstraction Common senseCommon sense ComplexComplex AnalyticalAnalytical

Page 7: Hypothesis Testing

DescriptiveDescriptive

It describes the characteristics of a It describes the characteristics of a variable.variable. The customer satisfaction level is The customer satisfaction level is

significantly good among the Hero Honda significantly good among the Hero Honda owners.owners.

Public enterprises are more amendable for Public enterprises are more amendable for centralized planning.centralized planning.

Page 8: Hypothesis Testing

RelationalRelational

It describe the relationship between two It describe the relationship between two variables.variables. The Families with higher income spend more The Families with higher income spend more

for recreation.for recreation. The lower the rate of job turnover in a work The lower the rate of job turnover in a work

group, the higher the work productivity. group, the higher the work productivity.

Page 9: Hypothesis Testing

Working hypothesisWorking hypothesis

Initial hypothesisInitial hypothesis Not very specificNot very specific These are subject to modification as the These are subject to modification as the

investigation proceeds. investigation proceeds.

Page 10: Hypothesis Testing

Null HypothesisNull Hypothesis

Null means Null means no differenceno difference It is a non directional hypothesis.It is a non directional hypothesis. It is also known as Statistical HypothesisIt is also known as Statistical Hypothesis It confirms the qualities of detachment and It confirms the qualities of detachment and

objectivity.objectivity. Null hypothesis are more exect.Null hypothesis are more exect. either it is accepted or rejected.either it is accepted or rejected.

If rejected-If rejected- Alternative hypothesis formulated.Alternative hypothesis formulated.

One tailed & Two tailedOne tailed & Two tailed

Page 11: Hypothesis Testing

Statistical hypothesisStatistical hypothesis

Statements about statistical population.Statements about statistical population. These are derived from a sample.These are derived from a sample. It may be hypothesis of difference or It may be hypothesis of difference or

hypothesis of association.hypothesis of association. In broad sense, all hypothesis might be In broad sense, all hypothesis might be

said statistical hypothesis in broad sense.said statistical hypothesis in broad sense.

Page 12: Hypothesis Testing

Common sense Common sense hypothesishypothesis

These are common sense ideas.These are common sense ideas. These are simple level hypothesis.These are simple level hypothesis.

Shop assistants in small shops lacks motivation.Shop assistants in small shops lacks motivation. Shoulders from upper class are less adjusted in the Shoulders from upper class are less adjusted in the

army then lower class men.army then lower class men.

it requires three tasks:it requires three tasks: Removal of value judgmentRemoval of value judgment Clarification of termsClarification of terms Application of validity testsApplication of validity tests

Page 13: Hypothesis Testing

Complex hypothesisComplex hypothesis

It aims at testing the existence of logically It aims at testing the existence of logically derived relationships between empirical derived relationships between empirical uniformities.uniformities.

These are purposeful distortions of empirical These are purposeful distortions of empirical exactness.exactness.

The function of such hypothesis is to create The function of such hypothesis is to create tools and problems for further research in tools and problems for further research in otherwise very complex areas of investigation.otherwise very complex areas of investigation.

Page 14: Hypothesis Testing

Analytical hypothesisAnalytical hypothesis

These are concerns with the relationship These are concerns with the relationship of analytical variables.of analytical variables.

These occur at highest level of These occur at highest level of abstraction.abstraction. e.g. there are two high fertility population e.g. there are two high fertility population

segments in India, viz. low income urban segments in India, viz. low income urban Muslims and low income rural low caste Muslims and low income rural low caste Hindus.Hindus.

Page 15: Hypothesis Testing

Sources of hypothesisSources of hypothesis

TheoryTheory ObservationObservation AnalogiesAnalogies Intuition AND personal experiencesIntuition AND personal experiences Findings of studiesFindings of studies State of knowledgeState of knowledge CultureCulture Continuity of reserchContinuity of reserch

Page 16: Hypothesis Testing

Functions of hypothesisFunctions of hypothesis

It gives a definite point too the investigation.It gives a definite point too the investigation. It guides the direction of study.It guides the direction of study. It specified the source of data.It specified the source of data. It determines the data needs.It determines the data needs. It defines which fact is relevant.It defines which fact is relevant. It determines most appropriate technique of It determines most appropriate technique of

data analysis.data analysis. It contributes to the development of theory.It contributes to the development of theory.

Page 17: Hypothesis Testing

Characteristics of a Good Characteristics of a Good HypothesisHypothesis

Conceptual clarityConceptual clarity SpecificitySpecificity TestabilityTestability Availability of techniqueAvailability of technique Theoretical relevanceTheoretical relevance ConsistencyConsistency ObjectivityObjectivity SimplicitySimplicity

Page 18: Hypothesis Testing

Evaluating hypothesisEvaluating hypothesis

Have the all aspects of the problem been considered in Have the all aspects of the problem been considered in the process of hypotheses formation?the process of hypotheses formation?

Do the hypotheses include all the pertinent possibilities Do the hypotheses include all the pertinent possibilities to answer the research question? to answer the research question?

Have the hypotheses been selected on the basis of Have the hypotheses been selected on the basis of such possibilities?such possibilities?

Have the hypotheses selected without fearing the Have the hypotheses selected without fearing the possibilities of tits sustainability?possibilities of tits sustainability?

Have conditions at hypotheses selection, allowed the Have conditions at hypotheses selection, allowed the researcher to reach the real solutions of problem? researcher to reach the real solutions of problem?

Page 19: Hypothesis Testing

Are the concepts used in hypotheses specific?Are the concepts used in hypotheses specific? Is the posited relationship between the Is the posited relationship between the

variables verified?variables verified? Is there any prior evidence as to truth or Is there any prior evidence as to truth or

falseness of posited relationship?falseness of posited relationship? Can an appropriate research design be Can an appropriate research design be

devised?devised? Are the generalizations a part of a theoretical Are the generalizations a part of a theoretical

system?system?

Page 20: Hypothesis Testing

Process of hypothesis settingProcess of hypothesis setting

For each objective, search the possible For each objective, search the possible answers. answers.

It requires searching, delving, trying, It requires searching, delving, trying, failing, and trying again and coming to a failing, and trying again and coming to a conclusion.conclusion.

Then write it in appropriate style.Then write it in appropriate style. Evaluate these tentative hypothesis and Evaluate these tentative hypothesis and

refine them in logical and testable way.refine them in logical and testable way.

Page 21: Hypothesis Testing

Rules of hypothesis Rules of hypothesis testingtesting

Search the variable measurement with most Search the variable measurement with most quantitative characteristics.quantitative characteristics.

Make variable scales in mutually exclusive and Make variable scales in mutually exclusive and totally inclusive categories.totally inclusive categories.

Describe the meaning of terms operationally in Describe the meaning of terms operationally in testable form.testable form.

Always consider alternative operations.Always consider alternative operations. Analyze variables through relationship.Analyze variables through relationship. Link two or more formal propositions through a Link two or more formal propositions through a

shared independent or independent varaibles.shared independent or independent varaibles.

Page 22: Hypothesis Testing

Testing the hypothesisTesting the hypothesis

Page 23: Hypothesis Testing

Procedure of Hypothesis Procedure of Hypothesis TestingTesting

FirstFirst, state 2 hypotheses, , state 2 hypotheses, the the null hypothesisnull hypothesis (“H (“H00”) and ”) and the the alternative hypothesisalternative hypothesis (“H (“HAA”)”)

Select an appropriate statistical testSelect an appropriate statistical test Select the desirable level of significanceSelect the desirable level of significance Compute the appropriate statistic from the Compute the appropriate statistic from the

sample datasample data Compute the significant test valueCompute the significant test value Obtain the critical test valueObtain the critical test value Make the decisionMake the decision

Page 24: Hypothesis Testing

Identification of hypothesesIdentification of hypotheses

The The null hypothesisnull hypothesis always represents always represents the status quo, the status quo, i.e.i.e. the hypothesis that the hypothesis that requires no change in current behavior.requires no change in current behavior.

The The alternative hypothesisalternative hypothesis is the is the conclusion that the researcher is trying to conclusion that the researcher is trying to make.make.

In statistics, we always In statistics, we always assume the null assume the null hypothesis is truehypothesis is true..

Page 25: Hypothesis Testing

ThenThen, make a decision based on the , make a decision based on the available evidence.available evidence. If there is sufficient evidence (“beyond a If there is sufficient evidence (“beyond a

reasonable doubt”),reasonable doubt”), reject the null reject the null hypothesishypothesis. .

If there is not enough evidence, If there is not enough evidence, do not do not reject the null hypothesisreject the null hypothesis. .

Page 26: Hypothesis Testing

Hypothesis TestingHypothesis Testing

We generally designate values of the We generally designate values of the

parameter, say parameter, say , under the null , under the null

hypothesis as hypothesis as 00..

Page 27: Hypothesis Testing

Hypothesis TestingHypothesis Testing

Example 1Example 1. An ambulance service is . An ambulance service is

considering replacing its ambulances with considering replacing its ambulances with

new equipment. If new equipment. If 00 is the average is the average

weekly maintenance cost of one of the old weekly maintenance cost of one of the old

ambulances and ambulances and is the average weekly is the average weekly

maintenance cost it can expect for one of maintenance cost it can expect for one of

the new ones, it wants to test the null the new ones, it wants to test the null

hypothesis hypothesis = = 00..

Page 28: Hypothesis Testing

Hypothesis TestingHypothesis Testing

(a)(a) What alternative hypothesis should it What alternative hypothesis should it

use if it wants to buy the new ambulances use if it wants to buy the new ambulances

only if it can be shown that this will reduce only if it can be shown that this will reduce

the average weekly maintenance cost?the average weekly maintenance cost?

Answer: Answer: < < 00. This is called a one-sided . This is called a one-sided

alternative.alternative.

Page 29: Hypothesis Testing

Hypothesis TestingHypothesis Testing

(b) What alternative hypothesis should it (b) What alternative hypothesis should it

use if it is anxious to buy the new use if it is anxious to buy the new

ambulances (which have some other nice ambulances (which have some other nice

features) even if they are more costly but features) even if they are more costly but

has no idea if they are or not.has no idea if they are or not.

Answer: Answer: 00. This is called a two-sided . This is called a two-sided

alternative.alternative.

Page 30: Hypothesis Testing

Hypothesis TestingHypothesis Testing

Nulls and alternatives can take the Nulls and alternatives can take the

following formsfollowing forms

NullNull Possible AlternativesPossible Alternatives

= = 00 00 < < 00 > > 00

00 < < 00

00 > > 00

Page 31: Hypothesis Testing

Hypothesis TestingHypothesis Testing

Now we are going to either reject the null Now we are going to either reject the null

hypothesis or not. In doing so it is hypothesis or not. In doing so it is

important to realize that we can make two important to realize that we can make two

types of errors in rejecting the null types of errors in rejecting the null

hypothesis.hypothesis.

Page 32: Hypothesis Testing

Hypothesis TestingHypothesis Testing

Type I error is rejecting the null Type I error is rejecting the null

hypothesis when it is true.hypothesis when it is true.

Type II error is not rejecting the null Type II error is not rejecting the null

hypothesis when it is false. hypothesis when it is false.

Page 33: Hypothesis Testing

Hypothesis TestingHypothesis Testing

Accept HAccept H00 Reject HReject H00

HH00 is true is true Correct Correct Type I Type I

Decision ErrorDecision Error

HH00 is false Type II Correct is false Type II Correct

Error DecisionError Decision

Page 34: Hypothesis Testing

Hypothesis TestingHypothesis Testing

We would commit a Type I error We would commit a Type I error

if we rejected the device when it was if we rejected the device when it was

indeed effective. We would commit a indeed effective. We would commit a

Type II error if we failed to reject the Type II error if we failed to reject the

device when it was ineffective. device when it was ineffective.

Page 35: Hypothesis Testing

Hypothesis TestingHypothesis Testing

We call the probability of type I error, or We call the probability of type I error, or

the probability of rejecting the null the probability of rejecting the null

hypothesis when it is true, hypothesis when it is true, . We call the . We call the

probability of type II error, or the probability of type II error, or the

probability of not rejecting the null probability of not rejecting the null

hypothesis when it is false, hypothesis when it is false, . .

Page 36: Hypothesis Testing

Hypothesis TestingHypothesis Testing

, the probability of type II error, is a , the probability of type II error, is a

difficult concept in the theory. So for this difficult concept in the theory. So for this

elementary presentation we concentrate elementary presentation we concentrate

on on , the probability of type I error – the , the probability of type I error – the

probability of rejecting the null hypothesis probability of rejecting the null hypothesis

when it is true.when it is true.

Page 37: Hypothesis Testing

Hypothesis TestingHypothesis Testing

The first approach to hypothesis testing is The first approach to hypothesis testing is

traditional.traditional.

1. We formulate a null hypothesis 1. We formulate a null hypothesis

and an appropriate alternative hypothesis and an appropriate alternative hypothesis

from the language of the problem.from the language of the problem.

Page 38: Hypothesis Testing

Hypothesis TestingHypothesis Testing

2. We specify a probability of type I error by 2. We specify a probability of type I error by

convention. Generally people choose convention. Generally people choose = .01 = .01

or .05. That is to say, we decide that we are or .05. That is to say, we decide that we are

willing to tolerate a probability of .01 or .05 of willing to tolerate a probability of .01 or .05 of

making a type I error, i.e., of rejecting the making a type I error, i.e., of rejecting the

null hypothesis when it is true. null hypothesis when it is true. is called the is called the

significance level of the test. significance level of the test.

Page 39: Hypothesis Testing

Hypothesis TestingHypothesis Testing

3. Based on the sampling distribution of 3. Based on the sampling distribution of

an appropriate statistic, we construct a an appropriate statistic, we construct a

criterion for testing the null hypothesis against criterion for testing the null hypothesis against

the chosen alternative hypothesis at the the chosen alternative hypothesis at the

specified level of significance. We use a two- specified level of significance. We use a two-

sided criterion for a two-sided alternative and a sided criterion for a two-sided alternative and a

one-sided criterion for a one-sided alternative.one-sided criterion for a one-sided alternative.

Page 40: Hypothesis Testing

Hypothesis TestingHypothesis Testing

4. We calculate the value of the statistic 4. We calculate the value of the statistic

on which the decision is to be made.on which the decision is to be made.

5. We decide whether or not to reject the 5. We decide whether or not to reject the

null hypothesis. Essentially we reject the null hypothesis. Essentially we reject the

null hypothesis if what we observe is too null hypothesis if what we observe is too

far from it. far from it.

Page 41: Hypothesis Testing

Hypothesis TestingHypothesis Testing

We call the test one- or two- tailed We call the test one- or two- tailed

depending on whether the criterion (or depending on whether the criterion (or

alternative) is one-sided or two- sided.alternative) is one-sided or two- sided.

Page 42: Hypothesis Testing

Hypothesis TestingHypothesis Testing

Example 2Example 2. It has been claimed that on . It has been claimed that on

the average 2.6 workers are absent from the average 2.6 workers are absent from

an assembly line. If an efficiency expert an assembly line. If an efficiency expert

is asked to put this to a test, is asked to put this to a test,

Page 43: Hypothesis Testing

Hypothesis TestingHypothesis Testing

(a) What null hypothesis and what (a) What null hypothesis and what

alternative hypothesis should she use?alternative hypothesis should she use?

(b) Should she use a one-tailed test or a (b) Should she use a one-tailed test or a

two-tailed test if she is going to base her two-tailed test if she is going to base her

decision on the mean of a random decision on the mean of a random

sample?sample?

Page 44: Hypothesis Testing

Hypothesis TestingHypothesis Testing

SolutionSolution. .

(a)(a) The null hypothesis is The null hypothesis is 00 = 2.6. If = 2.6. If

management worries only that more workers management worries only that more workers

are absent then she should use the alternative are absent then she should use the alternative

> 2.6.> 2.6.

(b) If her alternative is (b) If her alternative is > 2.6 then she should > 2.6 then she should

use a one-tailed test because the alternative use a one-tailed test because the alternative

hypothesis is one-sided.hypothesis is one-sided.

Page 45: Hypothesis Testing

Hypothesis TestingHypothesis Testing

We illustrate the traditional procedure with We illustrate the traditional procedure with

an example. In the example, we are an example. In the example, we are

dealing with one sample, dealing with one sample, is known, and is known, and

n is > 30.n is > 30.

Page 46: Hypothesis Testing

Hypothesis TestingHypothesis Testing

Example 3Example 3. In a study of new sources of food, . In a study of new sources of food,

it is reported that a pound of a certain kind of it is reported that a pound of a certain kind of

fish yields on the average 3.52 ounces of FPC fish yields on the average 3.52 ounces of FPC

(fish-protein concentrate) used to enrich various (fish-protein concentrate) used to enrich various

food products, with standard deviation food products, with standard deviation

= 0.07 ounces. = 0.07 ounces.

Page 47: Hypothesis Testing

Hypothesis TestingHypothesis Testing

To check whether To check whether = 3.52 is correct, = 3.52 is correct,

a dietician decides to use the alternative a dietician decides to use the alternative

hypothesis hypothesis 3.52 ounces, a random 3.52 ounces, a random

sample of size n = 32, and the .05 level sample of size n = 32, and the .05 level

of significance. What will she conclude if of significance. What will she conclude if

she gets a sample mean of 3.55 ounces she gets a sample mean of 3.55 ounces

of FPC (per pound of fish)?of FPC (per pound of fish)?

Page 48: Hypothesis Testing

Hypothesis TestingHypothesis Testing

SolutionSolution. The null hypothesis is . The null hypothesis is 00 = 3.52 = 3.52

ounces, ounces, = .07, n = 32 and = .07, n = 32 and __ X = 3.55. _X = 3.55. _

If the null hypothesis is true then E(X) = If the null hypothesis is true then E(X) = = =

00 = 3.52. Also from the CLT we know that = 3.52. Also from the CLT we know that

__

Z = (X - Z = (X - 00)/()/(/sqrt(n)) has approximately a /sqrt(n)) has approximately a

standard normal distribution.standard normal distribution.

Page 49: Hypothesis Testing

Hypothesis TestingHypothesis Testing

Also, the dietician chose Also, the dietician chose = .05 and a = .05 and a

two-sided alternative. That means that in two-sided alternative. That means that in

this case “far away” is defined as a total of this case “far away” is defined as a total of

.05 probability in the two tails. From the .05 probability in the two tails. From the

board drawing you can see that zboard drawing you can see that z .025.025 = =

1.96 and - z1.96 and - z.025.025 = -1.96 leave .025 in each = -1.96 leave .025 in each

tail respectively so a total of .05 in the two tails. tail respectively so a total of .05 in the two tails.

Page 50: Hypothesis Testing

Hypothesis TestingHypothesis Testing

So the statistician rejects the null So the statistician rejects the null

hypothesis if the observed value of Z hypothesis if the observed value of Z

under the null hypothesis is in either tail, under the null hypothesis is in either tail,

i.e., > 1.96 or < -1.96. But the observed value i.e., > 1.96 or < -1.96. But the observed value

of Z under the null hypothesis isof Z under the null hypothesis is

__

(X - (X - 00)/()/(/sqrt(n)) = /sqrt(n)) =

(3.55 – 3.52)/(.07/sqrt(32)) (3.55 – 3.52)/(.07/sqrt(32)) 2.42. 2.42.

Page 51: Hypothesis Testing

Hypothesis TestingHypothesis Testing

Since 2.42 is in the right tail, i.e., > 1.96 Since 2.42 is in the right tail, i.e., > 1.96

the observed mean 3.55 is too far away the observed mean 3.55 is too far away

from the null hypothesized mean 3.52 and from the null hypothesized mean 3.52 and

so the dietician must reject the null so the dietician must reject the null

hypothesis.hypothesis.

Page 52: Hypothesis Testing

Hypothesis TestingHypothesis Testing

In the previous example the dietician In the previous example the dietician

chose chose = .05 for her level of significance = .05 for her level of significance

for her two-tailed test so that the rejection for her two-tailed test so that the rejection

region was the right tail > 1.96 and the left region was the right tail > 1.96 and the left

tail < -1.96. tail < -1.96.

Page 53: Hypothesis Testing

Hypothesis TestingHypothesis Testing

Had she chosen Had she chosen = .01 then the rejection = .01 then the rejection

region would have been the right tail region would have been the right tail

beyond Zbeyond Z.005.005 = 2.575 and the left tail = 2.575 and the left tail

below - Zbelow - Z.005.005 = -2.575. Since the value of = -2.575. Since the value of

her observed statistic was Z her observed statistic was Z 2.42 for 2.42 for

this choice of this choice of she would have failed to she would have failed to

reject the null hypothesis while for reject the null hypothesis while for = .05 she = .05 she

rejected it. rejected it.

Page 54: Hypothesis Testing

Hypothesis TestingHypothesis Testing

So rejection or not of the null hypothesis So rejection or not of the null hypothesis

depends crucially on choice of depends crucially on choice of , the , the

probability of rejection given that the probability of rejection given that the

hypothesis is true that one is willing to hypothesis is true that one is willing to

tolerate. And the choice of tolerate. And the choice of is is

essentially by convention.essentially by convention.

Page 55: Hypothesis Testing

Hypothesis TestingHypothesis Testing

The conventional (some would say The conventional (some would say

arbitrary) nature of arbitrary) nature of choice and the choice and the

dependency of rejection or not on that dependency of rejection or not on that

choice have led to a slightly different choice have led to a slightly different

approach to hypothesis testing. The first approach to hypothesis testing. The first

two of the five steps are the same as two of the five steps are the same as

before.before.

Page 56: Hypothesis Testing

Hypothesis TestingHypothesis Testing

The second approach to hypothesis The second approach to hypothesis

testing is called the p-value approach. testing is called the p-value approach.

The first two of the five steps are the same as The first two of the five steps are the same as

before.before.

1. We formulate a null hypothesis 1. We formulate a null hypothesis

and an appropriate alternative hypothesis and an appropriate alternative hypothesis

from the language of the problem.from the language of the problem.

Page 57: Hypothesis Testing

Hypothesis TestingHypothesis Testing

2. We specify a probability of type I error by 2. We specify a probability of type I error by

convention. Generally people choose convention. Generally people choose = .01 = .01

or .05. That is to say, we decide that we are or .05. That is to say, we decide that we are

willing to tolerate a probability of .01 or .05 of willing to tolerate a probability of .01 or .05 of

making a type I error, i.e., of rejecting the making a type I error, i.e., of rejecting the

null hypothesis when it is true. null hypothesis when it is true. is called the is called the

significance level of the test. significance level of the test.

Page 58: Hypothesis Testing

Hypothesis TestingHypothesis Testing

Now we have steps that differ from those in the Now we have steps that differ from those in the traditional approach.traditional approach.

3’. We specify the test statistic.3’. We specify the test statistic.

4’. We calculate the value of the specified 4’. We calculate the value of the specified test statistic from the data and then find test statistic from the data and then find the tail probability value in the table that the tail probability value in the table that corresponds to that value of the test corresponds to that value of the test statistic. We call that value the p-value.statistic. We call that value the p-value.

Page 59: Hypothesis Testing

Hypothesis TestingHypothesis Testing

5’. We compare the p-value obtained in 5’. We compare the p-value obtained in

step 4’ with the level of significance step 4’ with the level of significance

specified in step 2. If the p-value is less specified in step 2. If the p-value is less

than or equal to the level of significance, than or equal to the level of significance,

the null hypothesis must be rejected.the null hypothesis must be rejected.

Page 60: Hypothesis Testing

Hypothesis TestingHypothesis Testing

Example 4. Example 4. Use the p-value approach to redo Use the p-value approach to redo

example 3. example 3.

SolutionSolution. The first two steps are the same. . The first two steps are the same.

3’. Again, the test statistic is_3’. Again, the test statistic is_

Z = (X - Z = (X - 00)/()/(/sq rt(n))./sq rt(n)).

4’. Calculating the value of that statistic gives 4’. Calculating the value of that statistic gives

Z = (3.55 – 3.52)/(.07/sqrt(32)) Z = (3.55 – 3.52)/(.07/sqrt(32)) 2.42. 2.42.

Page 61: Hypothesis Testing

Hypothesis TestingHypothesis Testing

Now we go to the Z table and see what Now we go to the Z table and see what

probability values are left in the two tails probability values are left in the two tails

by the points Z = -2.42 and Z = 2.42. We by the points Z = -2.42 and Z = 2.42. We

find that .5 - .4922 = .0078 is left in the find that .5 - .4922 = .0078 is left in the

right tail by Z = 2.42 and the same right tail by Z = 2.42 and the same

amount is left in the left tail by Z = -2.42. amount is left in the left tail by Z = -2.42.

So the p-value of the result is .0078 + .0078 = So the p-value of the result is .0078 + .0078 =

.0156. .0156.

Page 62: Hypothesis Testing

Hypothesis TestingHypothesis Testing

Since .0156 is < .05 the null hypothesis is Since .0156 is < .05 the null hypothesis is

rejected at the .05 level but since .0156 is rejected at the .05 level but since .0156 is

> .01 the null hypothesis is not rejected at > .01 the null hypothesis is not rejected at

the .01 level. the .01 level.

Thus the p-value is actually the lowest Thus the p-value is actually the lowest

level of significance at which the null level of significance at which the null

hypothesis would be rejected.hypothesis would be rejected.

Page 63: Hypothesis Testing

Hypothesis TestingHypothesis Testing

Researchers nowadays prefer the p-value Researchers nowadays prefer the p-value

approach because they can publish the p-value approach because they can publish the p-value

and let individual readers decide what and let individual readers decide what

significance level they feel comfortable with and significance level they feel comfortable with and

so whether they want to reject the null so whether they want to reject the null

hypothesis or not. The p-value approach allows hypothesis or not. The p-value approach allows

researchers to avoid choosing a conventional researchers to avoid choosing a conventional

significance level for others.significance level for others.

Page 64: Hypothesis Testing

Hypothesis TestingHypothesis Testing

Example 5Example 5. A horticulturist knows from . A horticulturist knows from

experience that the honeybees visiting her experience that the honeybees visiting her

orchard weigh .87 gram on the average. orchard weigh .87 gram on the average.

Feeling that this year’s honeybees look bigger, Feeling that this year’s honeybees look bigger,

she decides to weigh a random sample of n = she decides to weigh a random sample of n =

50 of the bees all together and she gets an 50 of the bees all together and she gets an

average weight of .91 grams per bee with s = average weight of .91 grams per bee with s =

.15 gram. .15 gram.

Page 65: Hypothesis Testing

Hypothesis TestingHypothesis Testing

Using the .01 level of significance, what Using the .01 level of significance, what

can she conclude about her impressions can she conclude about her impressions

that this year’s bees are larger?that this year’s bees are larger?

Page 66: Hypothesis Testing

Hypothesis TestingHypothesis Testing

SolutionSolution. We use the p-value approach.. We use the p-value approach.

1.1. HH00: : = .87 = .87

HHAA: : > .87 > .87

2. 2. = .01 _ = .01 _

3.3. Z = (X - Z = (X - 00)/(s/sqrt(n)) )/(s/sqrt(n))

4.4. Z = (.91 - .87)/(.15/sqrt(50)) = 1.89. Z = (.91 - .87)/(.15/sqrt(50)) = 1.89.

Page 67: Hypothesis Testing

Hypothesis TestingHypothesis Testing

Since we use a one-sided alternative we Since we use a one-sided alternative we

use a one-tailed test. From the Z table use a one-tailed test. From the Z table

when Z = 1.89, there is .0294 in the right when Z = 1.89, there is .0294 in the right

tail so that is the p-value.tail so that is the p-value.

5.5. Since p = .0294 > .01 we cannot reject Since p = .0294 > .01 we cannot reject

the null hypothesis. the null hypothesis.

Page 68: Hypothesis Testing

Hypothesis TestingHypothesis Testing

Example 6Example 6. A random sample of n = 12 . A random sample of n = 12

graduates of a secretarial school typed on graduates of a secretarial school typed on

the average _the average _

X = 78.2 words per X = 78.2 words per

minute with a standard deviation of s = minute with a standard deviation of s =

7.9 words per minute. 7.9 words per minute.

Page 69: Hypothesis Testing

Hypothesis TestingHypothesis Testing

Assuming that such data can be looked Assuming that such data can be looked

upon as a random sample from a normal upon as a random sample from a normal

population, use the one-sample t test to population, use the one-sample t test to

test the null hypothesis test the null hypothesis = 80 words per = 80 words per

minute against the alternative hypothesis minute against the alternative hypothesis

< 80 words per minute of this secretarial < 80 words per minute of this secretarial

school. Use the .05 level of significance.school. Use the .05 level of significance.

Page 70: Hypothesis Testing

Hypothesis TestingHypothesis Testing

SolutionSolution. We use the p-value approach. . We use the p-value approach.

1. H1. H00: : = 80 = 80

HHAA: : < 80 < 80

2. 2. = .05 _ = .05 _

3.3. t = (X - t = (X - 00)/(s/sqrt(n)) )/(s/sqrt(n))

4. t =(78.2 - 80)/(7.9/sqrt(12)) = -.79. 4. t =(78.2 - 80)/(7.9/sqrt(12)) = -.79.

Page 71: Hypothesis Testing

Hypothesis TestingHypothesis Testing

Degrees of freedom are 12 – 1 = 11. So Degrees of freedom are 12 – 1 = 11. So

from the t table we see that for t = -.79 from the t table we see that for t = -.79

with degrees of freedom 11 there is with degrees of freedom 11 there is

probability > .10 in the left tail (see probability > .10 in the left tail (see

drawing on board). So the p-value is > .10.drawing on board). So the p-value is > .10.

5. So since p >.10 > .05 we 5. So since p >.10 > .05 we

can’t reject the null hypothesis. can’t reject the null hypothesis.

Page 72: Hypothesis Testing

Hypothesis TestingHypothesis Testing

So far we have tested hypotheses about So far we have tested hypotheses about

population means using either the Z or t population means using either the Z or t

tables, depending on what information we tables, depending on what information we

had. If n is large, it is also possible to test had. If n is large, it is also possible to test

hypotheses about population proportions hypotheses about population proportions

using the Z table. using the Z table.

Page 73: Hypothesis Testing

Hypothesis TestingHypothesis Testing

Example 7Example 7. In a random sample of 600 . In a random sample of 600

cars making right turns at a certain cars making right turns at a certain

intersection, 157 pulled into the wrong intersection, 157 pulled into the wrong

lane. Test the claim that 30% of all lane. Test the claim that 30% of all

drivers make this mistake, usingdrivers make this mistake, using

(a)(a) .05 level of significance.05 level of significance

(b)(b) .01 level of significance.01 level of significance

Page 74: Hypothesis Testing

Hypothesis TestingHypothesis Testing

SolutionSolution. (a) We use the traditional approach. (a) We use the traditional approach

1.1. HH00: p = .3 H: p = .3 HAA: p : p .3 .3

2.2. = .05 = .05

3.3. Z = (p - pZ = (p - p00)/sqrt[p)/sqrt[p0 0 (1 – p(1 – p00)/n]. Reject H)/n]. Reject H00 if if

z < -1.96 or z > 1.96z < -1.96 or z > 1.96

4. Z = [(157/600 - .3)]/sqrt[(.3)(.7)/600] 4. Z = [(157/600 - .3)]/sqrt[(.3)(.7)/600] -2.05 -2.05

5. Since –2.05 < -1.96 reject null hypothesis5. Since –2.05 < -1.96 reject null hypothesis

Page 75: Hypothesis Testing

Hypothesis TestingHypothesis Testing

SolutionSolution. (b) We use the traditional approach.. (b) We use the traditional approach.

1.1. HH00: p = .3 H: p = .3 HAA: p : p .3 .3

2.2. = .01 = .01

3.3. Z = (p - pZ = (p - p00)/sqrt[p)/sqrt[p0 0 (1 – p(1 – p00)/n]. Reject H)/n]. Reject H00 if if

z < -2.575 or z > 2.575z < -2.575 or z > 2.5754. Z = [(157/600 - .3)]/sqrt[(.3)(.7)/600] 4. Z = [(157/600 - .3)]/sqrt[(.3)(.7)/600] -2.05 -2.05 5. Since –2.05 > -2.575 can’t reject null 5. Since –2.05 > -2.575 can’t reject null

hypothesishypothesis

Page 76: Hypothesis Testing

Hypothesis TestingHypothesis Testing

NoteNote. The standard normal distribution used in . The standard normal distribution used in the previous example, and in others of its type, the previous example, and in others of its type, will give an accurate result only ifwill give an accurate result only if

pp00 3sqrt[p 3sqrt[p00(1 - p(1 - p00)/n] does not include 0 or 1. )/n] does not include 0 or 1.

In that example n was 600 and pIn that example n was 600 and p00 was .3 so was .3 so

pp00 3sqrt[p 3sqrt[p00(1 - p(1 - p00)/n] = .3 )/n] = .3 3sqrt[(.3)(.7)/600] = 3sqrt[(.3)(.7)/600] =

.3 .3 .017 which does not include 0 or 1 so the .017 which does not include 0 or 1 so the result reported in the example should be result reported in the example should be accurate.accurate.

Page 77: Hypothesis Testing

General Idea of General Idea of Hypothesis TestingHypothesis Testing

Make an initial assumption.Make an initial assumption. Collect evidence (data).Collect evidence (data). Based on the available evidence, decide Based on the available evidence, decide

whether or not the initial assumption is whether or not the initial assumption is reasonable.reasonable.

Page 78: Hypothesis Testing

Generally used tests for Generally used tests for hypotheses testinghypotheses testing

Parametric tests:Parametric tests: Z scoresZ scores t- testt- test F testF test ANOVAANOVA

Non parametric testNon parametric test Chi-square testChi-square test Yate’s correctionYate’s correction The median testThe median test The Mann Whitney testThe Mann Whitney test The Sign testThe Sign test