0% found this document useful (0 votes)
52 views42 pages

Hypothesis Testing

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views42 pages

Hypothesis Testing

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 42

HYPOTHESIS TESTING

METCHE ANNE C. LOGRONIO


Dept. of Agricultural Economics
Learning Outcomes”
At the end of the session, students are
expected to:
•Formulate null and alternative
hypothesis
Statistical Hypothesis

A conjecture about.....
1.The value of the parameter of the population
2.The distribution of the population

Types of Hypotheses
•Null hypothesis (Ho)- is usually a statement of
equality or no difference.
•Alternative Hypothesis (Ha)- is the
complementary statement that will be accepted in
the event that the Ho is rejected.
Example:

Ho: The mean weekly allowance of UPMin


students is 500 pesos.

In symbols,
Ho: μ = 500 pesos

i. Ha: μ ≠ 500 pesos


ii. Ha: μ > 500 pesos
iii. Ha: μ < 500 pesos

Note: Only one of these three alternatives has to


be specified.
Test of Statistical hypothesis
-Procedure or rule for deciding whether to
reject Ho on the basis of a sample drawn from
a population

Courses of action or decision in


hypothesis testing:

• Reject Ho
•“Fail to reject Ho
Consequences of Decisions Made in
Hypothesis Testing

Decision Ho is actually
Made True False

Reject Ho Type I error Correct


Decision
Accept Ho Correct Type II error
Decision
P(Type I error) = P(Rejecting Ho|Ho is True) = α.
-It is often called the level of significance
-It measures the risk of rejecting a true null
hypothesis

P(Type II error) = P(Accepting Ho|Ho is False) = β


For each of the problems below, formulate the
appropriate null and alternative hypotheses both in
words and in symbols.
1. A clinical laboratory carries out regular antibiotic
susceptibility testing of 15mg discs of ampicillin
purchased from a biotechnology company. The
tests are carried out by means of agar diffusion
using Escherichia coli to produce the data on the
inhibition zone, in mm, across the transverse
aspects of the zone. The mean inhibition zone for
such discs is set at 17.5 mm with standard
deviation 0.5 mm. The objective of the experiment
is to compare the zone data with the specified
targets.
2. The disintegration time of a medical tablet
should be 20 seconds on average with variability
0.75 seconds. Times in excess of these targets
suggest contamination of the tablet and tablet
reformulation may be necessary. The
disintegration times of a random sample of
tablets from a particular batch are to be
measured. It is suspected that disintegration time
has increased and variability has also increased.
Steps to be followed in hypothesis testing:
1.State the null (Ho) and alternative (Ha) hypotheses.
2.Select the appropriate test statistic and its distribution
under Ho.
3.Choose the level of significance (α) and determine the
critical or rejection region of the test.
4.Formulate the decision rule for rejecting or failing to
reject Ho based on the test statistic.
5.Compute the value of the test statistic using the sample
data.
6.Make decision based on the decision rule in Step 4 and
the results in Step 5.
7.State the conclusion corresponding to the decision
made in Step 6.
Definitions:

Test Statistic = Statistic which provides a basis for


determining whether to reject H0 in favor of Ha.

Decision Rule = the set of values of the test statistic for


which the null hypothesis will be rejected.

Critical Region = the set of values of the test statistic for


which the null hypothesis will not be rejected.
- separated by a critical value of the test statistic.

One-Tailed Test of Hypothesis - a test where the


alternative hypothesis specifies a one-directional difference
for the parameter of interest.
Example: H0:  = 14 vs. Ha:  > 14
H0:  = 14 vs. Ha:  < 14
H0: 1 - 2 = 0 vs. Ha: 1 - 2 < (>) 0

Two-Tailed Test of Hypothesis - a test where the


alternative hypothesis does not specify a directional
difference for the parameter of interest.

Example: H0:  = 14 vs. Ha:   14


H0: 1 - 2 = 0 vs. Ha: 1 - 2  0
TESTS CONCERNING MEANS (ONE POP’N)

H0 Test Statistic Ha Critical Region

a.  known; n <> 30
 = 0  < 0 Z < - Z
X  0  > 0 Z > Z
Z
/ n Z > Z/2
  0
b.  unknown; n < 30
 = 0  < 0 t < - t
X  0 t > t
t  > 0
s/ n
  0 t > t/2
  n 1
c. If  unknown and n > 30, use (a) replacing the test stat by
X  0
Z
s/ n
Examples:

A random sample of 100 recorded deaths in the


Philippines during the past year showed an
average lifespan of 74.8 years. Assuming a
population standard deviation of 7.5 years, does
this seem to indicate that the average lifespan
today is greater than 73 years? Use  = 0.05.
Solution:

Let μ be the average lifespan of the people in the Philippines

Given: x  74.8 , n = 100, σ = 7.5, μ = 73

Ho: μ = 73 vs. Ha: μ > 73


α = 0.05
Test stat: Z since σ is known
Decision Rule: Reject Ho if Zc > Z0.05 = 1.645.
Else, fail to reject Ho
Computation:
x   74.8  73
Zc    2.4
 / n 7.5 / 100
Decision: Reject Ho
Conclusion: The average lifespan today is greater than 73 years
at 5% level of significance.
Jeffrey, as an eight-year old, established a mean time of
16.43 seconds for swimming the 25-yard freestyle, with a
standard deviation of 0.8 seconds. His dad, Frank, thought
that Jeffrey could swim the 25-yard freestyle faster using
goggles. Frank bought Jeffrey a new pair of expensive
goggles and timed Jeffrey for 15 25-yard freestyle swims.
For the 15 swims, Jeffrey's mean time was 16 seconds.
Frank thought that the goggles helped Jeffrey to swim faster
than the 16.43 seconds. Conduct a hypothesis test using a
preset α = 0.05.
A manufacturer of sports equipment has developed a
new synthetic fishing line that he claims has a mean
breaking strength of 8 kg. with a standard deviation of
0.5 kg. Test the hypothesis that  = 8 kg. against the
alternative that   8 kg. if a random sample of 50 lines is
tested and found to have a mean breaking strength of
7.8 kg. Use a 0.01 level of significance.

Test the null hypothesis that the average content of


containers of a particular lubricant is 10 liters if the
contents of a random sample of 10 containers are 10.2,
9.7, 10.1, 10.3, 10.1, 9.8, 9.9, 10.4, 10.3 and 9.8 liters.
Use  = 0.05 and assume that the distribution of contents
is normal.
A soft drink vending machine is set to dispense 6
ounces per cup. If the machine is tested eight times,
yielding a mean cup fill of 5.6 ounces with a standard
deviation of 0.16 oz., is this evidence at the 5 % level of
significance that the machine is underfilling cups?
Assume that the amount of softdrink dispensed by the
machine is normally distributed.
Test of Hypothesis on Two Population
Means

Two Cases:

Case 1: Paired or Related Samples


- samples can be obtained by the pairing of
similar individuals or units of the experiment or by
self-pairing.
- these samples arise when units in the
samples are carefully matched in pairs so that the
units in each pair are as similar as possible
Examples: (ways to obtain related or paired
samples)

1.Measurements taken on a sample of twins.


(pairing of similar individuals or units of
experiments)
2.Measurements taken on a sample of individuals
before and after treatment (self-pairing)

Case 2: Independent Samples


- involve the selection of a sample from one
population that will not affect the selection of
another sample from the second population.
Paired Observations
Assumptions:
1. Samples are not independent
2. Variances of the samples are not necessarily
equal.
Confidence Interval for D = 1 – 2

If d and Sd are the mean and standard deviation of


the differences of n random pairs of measurements,
a (1-)100% CI for D = 1 – 2 is
Sd Sd
d  t / 2   D  d  t / 2
n n
 = n – 1 degrees of freedom
Example:
Twenty college freshmen were divided into 10 pairs, each member of
the pair having approximately the same IQ. One of each pair was
selected at random and assigned to a math section using programmed
materials only. The other member of each pair was assigned to a section
in which the professor lectured. At the end of the semester each group
was given the same examination and the following results were recorded.
Pair Programmed Lecture d
Materials
1 76 81 -5
2 60 52 8
3 85 87 -2
4 58 70 -12
5 91 96 -5
6 75 77 -2
7 82 90 -8
8 64 63 1
9 79 85 -6
10 88 83 5

Find a 98% CI for the true difference between the two learning procedures.
Parameter of Interest
Difference between the means of two
populations denoted by 1   2
Hypotheses
H0: D = d0 where D0 is the hypothesized
value of D against one of the
three alternatives below.

Ha: D  d0 (two-sided test)


Ha: D > 0
d
Ha: D < d0 (one-sided test)
H0 Test Statistic Ha Critical Region
D = d0 d  d0
D < d0­ t < - t
t D > d0 t > t
s / n
d D  d0 t > t/2

where:
n n 2
2
 di  di  nd
i 1
d  i 1 Sd 
n n 1

di = Xi – Y i =n–1 n = no. of pairs


Example:

A large taxi fleet owner wants to compare the gas


mileage using Petron and Shell gasoline. Different
gases were assigned to the same cab in different
days using 10 cabs to save time and money…
Cab 1 2 3 4 5 6 7 8 9 10
Petron 16 18 24 23 23 22 26 27 19 27
Shell 17 18 22 25 24 21 28 28 22 27

Is Shell really better than Petron? Test at 5% level of


significance.
Sol’n:
Let 1 and 2 be the average gas mileage of Petron
and Shell, respectively.
Ho: D = d0 vs. Ha: D < d0
α = 0.05
Test stat: t, related samples
Decision Rule: Reject Ho if tc <t0.05,9 = -1.833.
Computation:
Cab 1 2 3 4 5 6 7 8 9 10
Petron 16 18 24 23 23 22 26 27 19 27
Shell 17 18 22 25 24 21 28 28 22 27
di -1 0 2 -2 -1 1 -2 -1 -3 0
d  0.7 sd  1.4944

d  D  0.7
tc    1.48
sd / n 1.4944 / 10

Decision: Fail to reject Ho


Conclusion: Both types of gasoline have the
same gas mileage performance.
Two Independent Populations:

H0 Test Statistic Ha Critical Region


a. 12 and 22 known
( X1  X 2 )  d0 1 - 2 < d0 Z < - Z
Z
1 - 2 = d0 12  22 1 - 2 > d0 Z > Z
 1 - 2  d0 Z > Z/2
n1 n2
b. 12 = 22 but unknown (n1 and n2 <30)

1 - 2 = d0 ( X1  X 2 )  d0 t < - t
t
1 1 t > t
Sp 
n1 n2 -same- t > t/2
  n1  n2  2

Sp2 = s 1  n1 1  s 2  n2 1


2  2 

n1  n2  2
Two Independent Populations:

(X  X )  d
z 1 2 0
1 1
S 
p n n
1 2
Example:
An experiment was performed to compare the abrasive
wear of 2 different laminated materials. Twelve pieces of
material 1 were tested by exposing each piece to a
machine measuring wear. Ten pieces of material 2 were
similarly tested. In each case, the depth wear was
observed. The samples of Material 1 gave an average
(coded) wear of 85 units with a sample standard
deviation of 4, while the samples of Material 2 gave an
average of 81 and a standard deviation of 5. Can we
conclude at the 0.05 level of significance that the
abrasive wear of Material 1 exceeds that of material 2
by more than 2 units? Assume the populations to be
approximately normal with equal variances.
In a study of the effectiveness of physical exercise
on weight reduction, a simple random sample of
eight persons engaged in a prescribed program of
physical exercise for one month gave the following
data on their weight (lbs.) before and after the
program.

Before 209 178 169 212 180 192 158 180


After 196 171 170 207 177 190 159 180

At the 1% level of significance, do the data provide


evidence that the prescribed program of exercise is
effective? Assume that the difference in weight is
normally distributed.
Statistics students complain that the use of pocket calculators
give other students an advantage during statistics
examination. To check this contention, 45 students were
randomly assigned to two groups, 23 to use calculators and
22 to perform calculations by hand. The students then took a
statistics examination that required a modest amount of
arithmetic. The results are shown below:

Group Sample size Sample Sample


Mean Variance
With calculator 23 80.7 49.5
No calculator 22 78.9 60.4

Do the date provide sufficient evidence to indicate that the


students taking this particular examination obtain higher
scores when using a calculator? Assume normality and
homogeneity of variance. Test at α = 10%.
Test of Hypothesis on More Than Two
Population Means

Technique: One-way Analysis of Variance

Sample Problems:

• A school district may want to determine the effect


of 4 teachers on the grades of students in a
required course taught in the district.

• A weatherman may want to compare the average


amount of rainfall in 6 towns.
Objective: To compare the means of p
populations

Possibilities: The populations have equal means


OR at least one population has a different mean.

Basic Idea: Partition variability of data into:


1.Between populations
2.Within populations (inherent variability)
Hypothesis Testing
Ho: The p populations have equal means.
Ha: At least one population has a different mean.
Test Statistic: Fc
Decision Rule: Reject Ho if Fc > F [ p – 1 , n – p ].
Else, accept Ho.

Analysis of Variance Table:


Sources of degrees Sum of Mean
Variation of Squares Square Fc
freedom
Treatment p–1 TrSS MSTr MSTr/MSE
Error n–p ESS MSE
TOTAL n–1 TSS
Computational formula:
GT 2
CF 
n where GT = grand total of all observations
p ni
TSS   Yij2  CF Total Sum of Squares
i 1 j 1
p

 i.
Y 2

TrSS  i 1
 CF Treatment Sum of Squares
ni
ESS  TSS  TrSS Total Sum of Squares
Assumptions to the ANOVA

• The measurements taken from each population


are normally distributed.
• The p populations have equal variances.
• The p random samples are taken independently
from one another
EXAMPLE:

A 84 90 76 62 72 81 70
B 75 85 91 98 82 75 74
C 72 60 74 85 77 60 62
D 88 98 70 95 86 80 75

Test at 5% level of significance that the


average grade of students differ for the four
teachers.
ANOVA Table:

Sources of df Sum of Mean Sum Fc F0.05


Variation Squares of Squares
Between Groups 3 926.679 308.893 3.339 3.01
Within Groups 24 2220.286 92.512
Total 27 3146.964
Example 2:
In a biological experiment, 4 concentrations of a certain
chemical are used to enhance the growth of a certain type
of plant over a specified period of time. The following growth
data, in centimeters, were recorded for the plants that
survived:
Concentration 1 8.2 8.7 9.4 9.2
Concentration 2 7.7 8.4 8.6 8.1 8.0
Concentration 3 6.9 5.8 7.2 6.8 7.4 6.1
Concentration 4 6.8 7.3 6.3 6.9 7.1

Is there a significant difference in the average growth of


these plants for the different concentrations of the
chemicals? Test at 1% level of significance.
PAIR-WISE COMPARISON OF MEANS

THE LEAST SIGNIFICANT DIFFERENCE TEST


(LSD)
• the simplest and most commonly used procedure
for making a pair comparison
• most appropriate for making “planned” pair
comparison
• not valid for comparing all possible pairs of
means
• effective for a few number of treatments (less
than 6)
• applicable only when the F test for treatment
effect is significant
Ho: μA = μB vs Ha: μA ≠ μB
Test Stat: d  x  x
AB A B

Decision Rule: Reject Ho if d AB  LSD . Else,


fail to reject Ho.
Computations:

LSD  (t ,errordf )( sd )


2 MSE 1 1
sd  SE  MSE   
ni  n A nB 
or

You might also like