0% found this document useful (0 votes)
41 views57 pages

Hypothesis Testing

The document discusses hypothesis testing and statistical inference. It defines key terms like the population and sample. It also explains how to develop the null and alternative hypotheses, and the types of errors that can occur in hypothesis testing.

Uploaded by

Darling Selvi
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)
41 views57 pages

Hypothesis Testing

The document discusses hypothesis testing and statistical inference. It defines key terms like the population and sample. It also explains how to develop the null and alternative hypotheses, and the types of errors that can occur in hypothesis testing.

Uploaded by

Darling Selvi
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/ 57

Formulation and Testing

of Hypotheses
Dr. V. Darling Selvi
Assistant Professor of Commerce
Rani Anna Government College for Women
Tirunelveli - 8
Hypothesis Testing - the scientists’
• To tell whether our data supports or rejects our ideas,
we use statistical hypothesis testing. Immanuel Kant

• The problem is that we often get data that seem to


support our ideas. The literature is full of papers that
accept a pet idea uncritically. Statistical testing keeps
researchers honest.

• If you read a paper that suggests some alternative


hypothesis should be accepted, but there is no statistical
test, don't believe it.
"It does not make any difference how beautiful your guess is.
It does not make any difference how smart you are, who
made the guess, or what his name is-- if it disagrees with
experiment it is wrong. That is all there is to it."
-Richard Feynman

“If you haven't measured it you don't know


what you are talking about.”
-William Thompson, Lord Kelvin
Hypothesis Testing
 Developing Null and Alternative Hypotheses
 Type I and Type II Errors
 Population Mean:  Known
 Population Mean:  Unknown
 Population Proportion
 Hypothesis Testing and Decision Making
 Calculating the Probability of Type II Errors
• Determination of Test Statistics
• Apply the formula
• Fix the level of significance
• Calculate degrees of freedom
• Find the Table value
• Compare the calculated value with the table
value
• Take decision
Terminologies in use
• Population  all possible values
• Sample  a portion of the population
• Statistical inference  generalizing from a
sample to a population with calculated degree of
certainty
• Two forms of statistical inference
– Hypothesis testing
– Estimation
• Parameter  a characteristic of population, e.g.,
population mean µ
• Statistic  calculated from data in the sample, e.g.,
sample mean ( x)
Null and Alternative Hypotheses
• Convert the research question to null and
alternative hypotheses
• The null hypothesis (H0) is a claim of “no
difference in the population”
• The alternative hypothesis (Ha) claims
“H0 is false”
• Collect data and seek evidence against H0
as a way of bolstering Ha (deduction)
Hypothesis Tests
A hypothesis test is a process that uses sample statistics to
test a claim about the value of a population parameter.
If a manufacturer of rechargeable batteries
claims that the batteries they produce are good
for an average of at least 1,000 charges, a
sample would be taken to test this claim.

A verbal statement, or claim, about a population parameter is


called a statistical hypothesis.
To test the average of 1000 hours, a pair of hypotheses are
stated – one that represents the claim and the other, its
complement. When one of these hypotheses is false, the
other must be true.
Stating a Hypothesis
“H subzero” or “H naught”

A null hypothesis H0 is a statistical hypothesis that contains


a statement of equality such as , =, or .
“H sub-a”

A alternative hypothesis Ha is the complement of the null


hypothesis. It is a statement that must be true if H0 is false
and contains a statement of inequality such as >, , or <.

To write the null and alternative hypotheses, translate the


claim made about the population parameter from a verbal
statement to a mathematical statement.
Stating a Hypothesis
Example: Write the claim as a mathematical sentence. State
the null and alternative hypotheses and identify which
represents the claim.

A manufacturer claims that its rechargeable batteries have


an average life of at least 1,000 charges.
  1000

H0:   1000 (Claim) Condition of


Ha: inequality
 < 1000

Complement of the
null hypothesis
Stating a Hypothesis
Example:
Write the claim as a mathematical sentence. State the null
and alternative hypotheses and identify which represents the
claim.
Statesville college claims that 94% of their graduates find
employment within six months of graduation.
p = 0.94

H0: p = 0.94 (Claim) Condition of


Ha: equality
p  0.94

Complement of the
null hypothesis
More than one sample

Sampling distribution of xbar


under H0: µ = 170 for n = 64 
Developing Null and Alternative
Hypotheses - Examples
 Alternative Hypothesis as a Research Hypothesis
• Example:
A new teaching method is developed that is
believed to be better than the current method.
• Alternative Hypothesis:
The new teaching method is better.
• Null Hypothesis:
The new method is no better than the old method.
 Alternative Hypothesis as a Research Hypothesis
• Example:
A new sales force bonus plan is developed in an
attempt to increase sales.
• Alternative Hypothesis:
The new bonus plan increase sales.
• Null Hypothesis:
The new bonus plan does not increase sales.
Developing Null and Alternative Hypotheses

 Alternative Hypothesis as a Research Hypothesis


• Example:
A new drug is developed with the goal of lowering
blood pressure more than the existing drug.
• Alternative Hypothesis:
The new drug lowers blood pressure more than
the existing drug.
• Null Hypothesis:
The new drug does not lower blood pressure more
than the existing drug.
Developing Null and Alternative Hypotheses

 Null Hypothesis as an Assumption to be Challenged


• Example:
The label on a soft drink bottle states that it
contains 67.6 fluid ounces.
• Null Hypothesis:
The label is correct.  > 67.6 ounces.
• Alternative Hypothesis:
The label is incorrect.  < 67.6 ounces.
Summary of Forms for Null and Alternative
Hypotheses about a Population Mean
 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).

H 0 :   0 H 0 :   0 H 0 :   0
H a :   0 H a :   0 H a :   0

One-tailed One-tailed Two-tailed


(lower-tail) (upper-tail)
Using P-values for a z-Test
Using P-values for a z-Test for a Mean μ
In Words In Symbols

1. State the claim mathematically and State H0 and Ha.


verbally. Identify the null and
alternative hypotheses.
2. Specify the level of significance. Identify .
x μ
3. Determine the standardized test z 
statistic. σ n

4. Find the area that corresponds to Use Table.


z.
The Mean
• The mean is one of the commonly used
statistics in science. It is often the "Expected
Value" i.e. the value we expect to get.
• The mean is found by totalling the values for
all observations (∑x) and dividing by the total
number of observations (n).

The formula for finding Mean = ∑x


the mean is: n
Standard Deviation
• Measures of the spread of data are the
standard deviation, and variance
Sample
variance

• For s.d. calculate the difference of each


observation and the mean, square it, add
all these up, divide by the sample size,
and take the square root.
•Refers to actual population
Sample Standard Deviation
• "It is rarely possible to obtain observations from
every item … in a population" Fowler et al. 1998 p36

• The estimate of is s

• Where N-1 is called the degrees of freedom, and is


one less than the number of observations
Types of Errors
No matter which hypothesis represents the claim, always
begin the hypothesis test assuming that the null
hypothesis is true.

At the end of the test, one of two decisions will be made:


1. reject the null hypothesis, or
2. fail to reject the null hypothesis.

A type I error occurs if the null hypothesis is


rejected when it is true.
A type II error occurs if the null hypothesis is not
rejected when it is false.
Types of Errors

Actual Truth of H0
Decision H0 is true H0 is false

Accept H0 Correct Decision Type II Error

Reject H0 Type I Error Correct Decision


Types of Errors
Example:
Statesville college claims that 94% of their graduates find
employment within six months of graduation. What will a type
I or type II error be?
H0: p = 0.94 (Claim)
Ha:
p  0.94

A type I error is rejecting the null when it is true.


The population proportion is actually 0.94, but is
rejected. (We believe it is not 0.94.)
A type II error is failing to reject the null when it is false.

The population proportion is not 0.94, but is not rejected. (We


believe it is 0.94.)
Level of Significance
In a hypothesis test, the level of significance is your
maximum allowable probability of making a type I error. It is
denoted by , the lowercase Greek letter alpha.
Hypothesis tests are based
on .

The probability of making a type II error is denoted by , the lowercase


Greek letter beta.
By setting the level of significance at a small value, you
are saying that you want the probability of rejecting a true
null hypothesis to be small.
Commonly used levels of significance:
 = 0.10  = 0.05  = 0.01
Statistical Tests
After stating the null and alternative hypotheses and specifying the level of
significance, a random sample is taken from the population and sample statistics
are calculated.

The statistic that is compared with the parameter in the null hypothesis is
called the test statistic.

Population Test statistic Standardized test statistic


parameter
μ
x z (n  30)
t (n < 30)
p p̂ z
2 s2 X2
P-values
If the null hypothesis is true, a P-value (or
probability value) of a hypothesis test is the
probability of obtaining a sample statistic with a
value as extreme or more extreme than the one
determined from the sample data.
The P-value of a hypothesis test depends on the
nature of the test.
There are three types of hypothesis tests – a left-, right-, or
two-tailed test. The type of test depends on the region of the
sampling distribution that favors a rejection of H0. This
region is indicated by the alternative hypothesis.
Left-tailed Test
1. If the alternative hypothesis contains the less-than inequality symbol (<), the
hypothesis test is a left-tailed test.

H0: μ  k
H a: μ < k

P is the area to
the left of the test
statistic.

z
-3 -2 -1 0 1 2 3
Test
statistic
Right-tailed Test
2. If the alternative hypothesis contains the greater-than symbol (>), the
hypothesis test is a right-tailed test.

H0: μ  k
H a: μ > k

P is the area to
the right of the
test statistic.

z
-3 -2 -1 0 1 2 3
Test
statistic
Two-tailed Test
3. If the alternative hypothesis contains the not-equal-to
symbol (), the hypothesis test is a two-tailed test. In a
1
two-tailed test, each tail has an area of P. 2
H0: μ = k
H a: μ  k
P is twice the
P is twice the area to the right
area to the left of of the positive
the negative test test statistic.
statistic.

z
-3 -2 -1 0 1 2 3
Test Test
statistic statistic
Identifying Types of Tests
Example:
For each claim, state H0 and Ha. Then determine whether the
hypothesis test is a left-tailed, right-tailed, or two-tailed test.
a.) A cigarette manufacturer claims that less than one-eighth of
the Indian adult population smokes cigarettes.
H0: p  0.125
Ha: p < 0.125 (Claim) Left-tailed test

b.) A local telephone company claims that the average length of a


phone call is 8 minutes.
H0: μ = 8 (Claim)
Ha: μ  8 Two-tailed test
Making a Decision
Decision Rule Based on P-value
To use a P-value to make a conclusion in a hypothesis test, compare the
P-value with .

1. If P  , then reject H0.


2. If P > , then fail to reject H0.

Claim
Decision Claim is H0 Claim is Ha
There is enough evidence to There is enough evidence to
Reject H0 reject the claim. support the claim.

There is not enough evidence There is not enough evidence


Do not reject H0 to reject the claim. to support the claim.
Interpreting a Decision
Example:
You perform a hypothesis test for the following claim. How
should you interpret your decision if you reject H0? If you fail to
reject H0?
H0: (Claim) A cigarette manufacturer claims that less than
one-eighth of the Indian adult population smokes
cigarettes.
If H0 is rejected, you should conclude “there is sufficient
evidence to indicate that the manufacturer’s claim is false.”
If you fail to reject H0, you should conclude “there is not
sufficient evidence to indicate that the manufacturer’s claim is
false.”
Steps for Hypothesis Testing
1. State the claim mathematically and verbally. Identify the null
and alternative hypotheses.
H0: ? Ha: ? This sampling distribution is
2. Specify the level of significance. based on the assumption
that H0 is true.

=?
3. Determine the standardized sampling
distribution and draw its graph. z
0

4. Calculate the test statistic and its


standardized value. Add it to your sketch. z
0
Test statistic

Continued.
Steps for Hypothesis Testing
5. Find the P-value.
6. Use the following decision rule.

Is the P-value less than or


equal to the level of No Fail to reject H0.
significance?

Yes

7. Write a statement to interpret the decision in the context of the


original claim.
Reject H0.

These steps apply to left-tailed, right-tailed, and two-tailed tests.


p-Value Approach to
One-Tailed Hypothesis Testing
 The p-value is the probability, computed using the
test statistic, that measures the support (or lack of
support) provided by the sample for the null
hypothesis.
 If the p-value is less than or equal to the level of
significance , the value of the test statistic is in the
rejection region.
 Reject H0 if the p-value <  .
Suggested Guidelines for Interpreting p-Values

 Less than .01


Overwhelming evidence to conclude Ha is true.
 Between .01 and .05
Strong evidence to conclude Ha is true.
 Between .05 and .10
Weak evidence to conclude Ha is true.
 Greater than .10
Insufficient evidence to conclude Ha is true.
Interpretation
• P-value answer the question: What is the
probability of the observed test statistic …
when H0 is true?
• Thus, smaller and smaller P-values
provide stronger and stronger evidence
against H0
• Small P-value  strong evidence
Interpretation
Conventions*
P > 0.10  non-significant evidence against H0
0.05 < P  0.10  marginally significant evidence
0.01 < P  0.05  significant evidence against H0
P  0.01  highly significant evidence against H0

Examples
P =.27  non-significant evidence against H0
P =.01  highly significant evidence against H0
* It is unwise to draw firm borders for “significance”
Normal Distribution
• So if we make many observations and use
averages as our data, we can draw valid
conclusions because we know their distribution

• Many test statistics


are available for this.
• In a few moments we will
learn Chi-Square (X2)
Avoiding Decision Errors
• We always run the risk that we will observe a rare
event, and we will draw the wrong conclusion.

• Usually we want to avoid a Type I error, where we


reject H0 even though it is true.

• Many trials, and the use of a higher significance


level (P=.01 not P=.05) , make this less likely

• In a Type II error, we accept the null hypothesis even


though it is false.
Decision

• If the value of the test statistic you have


calculated is greater than the value in the
table (the critical value) you decided to
use, you can reject the null hypothesis
and accept the alternative hypothesis.

H0: There is no relation between the number of


peaks along a ridge and the time since exposure
df P = 0.05 P = 0.01 P = 0.001
1 3.84 6.64 10.83

2 5.99 9.21 13.82

3 7.82 11.35 16.27

Chi-Square (X2) 4 9.49 13.28 18.47

5 11.07 15.09 20.52


Critical Values 6 12.59 16.81 22.46

7 14.07 18.48 24.32

8 15.51 20.09 26.13


Significance table of X values.
2

This is the critical value table we 9 16.92 21.67 27.88


will use in the examples below. 10 18.31 23.21 29.59

11 19.68 24.73 31.26

12 21.03 26.22 32.91

13 22.36 27.69 34.53

14 23.69 29.14 36.12

15 25.00 30.58 37.70


It is prudent to use
Important means, not raw data,
to insure a normal
distribution
• The chi square test can only be used on
observations that have the following
characteristics: Objects being counted are independent**
The frequency data must have a
The data must be in the form precise numerical value and must be
of frequencies organised into categories or groups.

The expected frequency in any one cell


of the table must be greater than 5. *

The total number of observations must be


greater than 20.

* See the exception next slide **There are statistics designed to test this assumption
The x 2 formula

means take the sum


Worked Example 1:
• Step 1. Write down the NULL HYPOTHESIS
(H0) and ALTERNATIVE HYPOTHESES (Ha) and
set the LEVEL OF SIGNIFICANCE.
• H0 'A basaltic sand pile will not spread further than
a quartz sand pile in the same time'

• Ha ' A basaltic sand pile will spread further than a


quartz sand pile in the same time '

• We will set the level of significance at 0.05.


Step 2: Construct a table with the information you have
observed. Use averages as data
Method: 220 Hawaiian sand and 250 New Jersey sand
piles of 50 cc each are left out in the weather for 1 week
After 1 week, the distance of the furthest grain beyond the initial
perimeter is measured. Every 5 piles are averaged.

Furthest 1-5 6-10 11-15 16-20 21-25 Row


grain Total
(mm)
Quartz 9 13 10 10 8 50
Basaltic 4 3 5 9 21 42
Column 13 16 15 19 29 92
Total

Note that although there are 3 cells in the table that are not greater than 5, these
are observed frequencies. It is only the expected frequencies that have to be
greater than 5.
Work out the expected frequency.

Expected frequency = row total x column total


Grand total

Eg: expected frequency for oaks in PL1 = (50 x 13) / 92 = 7.07

Furthest 1-5 6-10 11-15 16-20 21-25 Row


grain Total
(mm)
Quartz 7.07
Basaltic
Column
Total
You do the rest
The Expected Frequencies

Furthest 1-5 6-10 11-15 16-20 21-25 Row


grain Total
(mm)
Quartz 7.07 8.70 8.15 10.33 15.76 50
Basaltic 5.93 7.30 6.85 8.67 13.24 42
Column 13 16 15 19 29 92
Total
For each of the cells calculate: (O – E)2
E

Eg: Basaltic in 1-5 mm is (9 – 7.07)2 / 7.07 = 0.53

Furthest 1-5 6-10 11-15 16-20 21-25 Row


grain Total
(mm)
Quartz 0.53
Basaltic
Column
Total

You do the rest


(O – E)2
These are the
E

Furthest 1-5 6-10 11-15 16-20 21-25


grain
(mm)
Quartz 0.53 2.13 0.42 0.01 3.82
Basaltic 0.63 2.54 0.50 0.01 4.55

But x 2
=  (O – E) 2

So: Add up all of the above numbers to obtain


the value for chi square: x2
= 15.14.
Now:

• Look up the X2 value on the table in the


slide above. This will tell you whether to
accept the null hypothesis or reject it.
The number of degrees of freedom to use is: the number
of rows in the table minus 1, multiplied by the number of
columns minus 1. This is (2-1) x (5-1) = 1 x 4 = 4 degrees
of freedom.

We find that our answer of 15.14 is greater than the


critical value of 9.49 (for 4 degrees of freedom and a
significance level of 0.05) and so we reject the null
hypothesis.
We conclude:

‘The distribution of grains spreading from sand


piles made of basaltic minerals versus quartz is
significantly different.’
Now you have to look for physical factors to
explain your findings
Tests About a Population Mean:  Unknown
• Test Statistic
x  0
t
s/ n

This test statistic has a t distribution


with n - 1 degrees of freedom.
Tests About a Population Proportion

 Test Statistic
p  p0
z
p

where:

p0 (1  p0 )
p 
n

assuming np > 5 and n(1 – p) > 5

You might also like