Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Hypothesis Test

Download as pdf or txt
Download as pdf or txt
You are on page 1of 57

Estimation &

Hypothesis Testing

BY UNSA SHAKIR
Sample data is used to estimate parameters of a
population
Statistics are calculated using sample data.
Parameters are the characteristics of population data

sample mean Population mean


estimates

Sample SD Population SD

How can exam score data be summarised?

Exam marks for 60 students (marked out of 65)

mean = 30.3 sd = 14.46


Summary statistics
n

• Mean = x
i 1
x
n

Standard deviation (SD) is a measure of how much the


individuals differ from the mean
n

 ix  x 2

s  i 1
n 1

For exam scores, mean = 30.5, SD = 14.46


Inferential Statistics
• Inferential statistics to make judgments of the
probability that an observed difference
between groups is a dependable one

• Inferential statistics includes making inferences,


hypothesis testing, and determining
relationships
There are two main methods
used in inferential statistics:

• Estimation
• Hypothesis testing

NOTE: The first one is to use the data to estimate the


parameters, the second is to guess a value for the
parameters and ask the data whether this value is true.
What is Hypothesis

• A Hypothesis is the statement or an


assumption about relationships between
variables.

• The procedure by which either accept or reject


the hypothesis is called testing hypothesis
Examples:
Interesting Hypothesis
• Bankers assumed high-income earners are
more profitable than low-income earners.

• Old clients were more likely to diminish CD


balances by large amounts compared to
younger clients.

This was nonintrusive because conventional


wisdom suggested that older clients have a larger
portfolio of assets and seek less risky investments
Hypothesis Testing
• Is also called significance testing
• Tests a claim about a parameter using evidence
(data in a sample)
• The technique is introduced by considering a
one-sample z test
• The procedure is broken into four steps
• Each element of the procedure must be
understood
Steps to undertaking a Hypothesis test
Define study question

Set null and alternative hypothesis

Calculate a test statistic

Calculate a p-value

Make a decision and interpret


your conclusions
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 supporting Ha (deduction)
HA: Research (Alternative) Hypothesis
• the hypothesis which we want to prove
• the complement of the null hypothesis.
• contains a statement of inequality such as
>, , or <.

H0: Null Hypothesis


• the hypothesis which we want to reject
• contains a statement of equality such as
, =, or .
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: equality
 < 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
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. Accept the null hypothesis.

A type I error occurs if the null hypothesis is rejected when it


is true. (α error)
A type II error occurs if the null hypothesis is accepted when
it is false. (β error)
Types of Errors

• As we all (hopefully) remember, results of


hypothesis tests fall into one of four
scenarios:
Explaination with example:

• The jury is instructed to assume the person is innocent,


and only decide that the person is guilty if the evidence
convinces them of such.

• When there is a favored assumption, the presumed


innocence of the person in this case, and the assumption
is true, but the jury decides it is false and declares that the
person is guilty, we have a so-called Type I error.

• Conversely, if the favored assumption is false, i.e., the


person is really guilty, but the jury declares that it is true,
that is that the person is innocent, then we have a so-
called Type II error.
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 accepting the null when it is false.


The population proportion is not 0.94, but is accepted.
(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
μ z (n  30)
x t (n < 30)
p p̂ z
2 s2 X2
Test Statistic
This is an example of a one-sample test of a mean
when σ is known. Use this statistic to test the
problem:
Illustrative Example: “Body Weight”
• The problem: In the 1970s, 20–29 year old men in the
U.S. had a mean μ body weight of 170 pounds. Standard
deviation σ was 40 pounds. We test whether mean body
weight in the population now differs.

• Null hypothesis H0: μ = 170 (“no difference”)

• The alternative hypothesis can be either

Ha: μ > 170 (one-sided test) or


Ha: μ ≠ 170 (two-sided test)
Illustrative Example: z statistic
• For the illustrative example, μ0 = 170
• We know σ = 40
• Take an SRS of n = 64. Therefore
 40
SEx   5
n 64
• If we found a sample mean of 173, then
x   0 173  170
zstat    0.60
SEx 5
Illustrative Example: z statistic
If we found a sample mean of 185, then

x   0 185  170
zstat    3.00
SEx 5
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
Ha : μ < 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
Ha : μ > 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 2 P.
H0 : μ = k
Ha : μ  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
Accept the null hypothesis if the sample
statistic falls in this region

Acceptance
Region Rejection
/Critical Region

Reject the null hypothesis if the sample


statistic falls in these two regions.
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 US adult population smokes cigarettes.

H0: p  0.125

Ha: p < 0.125 (Claim)

Left-tailed test
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.

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 accept H0.

Claim
Decision Claim is H0 Claim is Ha
There is enough evidence to r There is enough evidence to s
Reject H0 eject the claim. upport the claim.
There is not enough evidence There is not enough evidence
Accept 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 US 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
based on the assumption
2. Specify the level of significance. 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
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

Reject H0.
7. Write a statement to interpret the decision in the context of
the original claim.

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


Examples
An insurance company is reviewing its current policy rates.
When originally setting the rates they believed that the
average claim amount will be maximum Rs180000. They
are concerned that the true mean is actually higher than
this, because they could potentially lose a lot of money.
They randomly select 40 claims, and calculate a sample
mean of Rs195000. Assuming that the standard deviation of
claims is Rs50000 and set α= .05, test to see if the
insurance company should be concerned or not.
SOLUTION

Step 1: Set the null and alternative


hypotheses
H0 : μ≤ 180000
H1 : μ > 180000 (right-tailed test)

Step 2: Calculate the test statistic

z= = x– μ
σ/√n
= 1.897
Step 3: Set Rejection Region
1.65
Step 4: Conclude

We can see that 1.897 > 1.65, thus our test statistic is in
the rejection region. Therefore we accept the null
hypothesis.
ILLUSTRATION
ONE TAILED (RIGHT TAILED)

Trying to encourage people to stop driving to campus, the


university claims that on average it takes at least 30
minutes to find a parking space on campus. I don’t think it
takes so long to find a spot. In fact I have a sample of the
last five times I drove to campus, and I calculated x = 20.
Assuming that the time it takes to find a parking spot is
normal, and that σ = 6 minutes, then perform a hypothesis
test with level α= 0.10 to see if my claim is correct.
SOLUTION

Step 1: Set the null and alternative hypotheses

H0 : μ ≥ 30
H1 : μ < 30 (RIGHT TAILED)

Step 2: Calculate the test statistic

Z= x– μ
σ/√n
= -3.727
STEP 3: SET REJECTION REGION
STEP 4: CONCLUDE

We can see that -3.727 <-1.28 ( or absolute value is higher


than the critical value) , thus our test statistic is in
the rejection region. Therefore we Reject the null
hypothesis. We can conclude that the mean is significantly
less than 30, thus I have proven that the mean time to find
a parking space is less than 30.
Example:
A company manufacturing automobile tyres finds
that tyre life is normally distributed with a mean
of 40,000 km and standard deviation of 3000 km.
It is believed that a change in the production
process will result in a better product and the
company has developed a new tyre. A sample of
100 new tyres has been selected.The company
has found that the mean life of these new tyres
is 40,900 km.Can it be concluded that the new
tyre is significantly better than the old one,
using the significance level of 0.01?
Solution-
1. Null hypothesis: H0 :  = 40,000

 Alternate Hypo: Ha :  > 40,000

 Level of significance () = 0.01

z = 40,900-40,000 = 3
300
 At 0.01 level, the critical value of z is
2.33. Z tab > Z cal
Accept
Zcal=3

As computed
value falls in
rejection region,
.01
we reject the
null hypothesis.
Example:
A manufacturer claims that at least 95% of the
equipment that he supplied to a factory conformed
to specifications. An examination of 700 pieces of
equipment reveals that 53 are faulty. Do these
results provide sufficient evidence to reject the
manufacturer's claim? Use α= 0.01 to perform the
test.
1. Ho: p = 0.95 , H1: p <0.95

2. α= 0.01

3. z= -3.1341

4. Reject Ho

There is is sufficient evidence to reject the


manufacturer's claim because less than 95% of the
equipment he supplied conformed to
specifications.
Example:
 An ambulance service claims that it takes, on
the average 8.9 minutes to reach its
destination in emergency calls.To check on this
claim, the agency which licenses ambulance
services has then timed on 50 emergency calls,
getting a mean of 9.3 minutes with a standard
deviation of 1.8 minutes.Does this constitute
evidence that the figure claimed is not right
at 1% level of significance?
Hint: Ho: = 8.9; Ha: 8.9, Zcal = 1.574 ;

Ho accepted.
Example:
A random sample of boots worn by 40 combat
soldiers in a desert region showed an average
life of 1.08 yrs with a standard deviation of
0.05.Under the standard conditions,the boots
are known to have an average life of 1.28 yrs.Is
there reason to assert at a level of significance
of 0.05 that use in the desert causes the mean
life of such boots to decrease?

Hint: Ho:  = 1.28, Ha: <1.28 ,Zcal= -28.57


Ho rejected.
Example:
Hinton Press hypothesizes that the average life
of its largest web press is 14,500 hrs.They know
that the standard deviation of press life is 2100
hrs.From a sample of 25 presses, the company
finds a sample mean of 13000 hrs. At a 0.01
significance level, should the company conclude
that the average life of the presses is less than
the hypothesized 14,500 hours?

Ans: Ho rejected.
Example:
ABC company is engaged in the packaging of a
superior quality tea in jars of 500 gm each.The
company is of the view that as long as jars
contain 500 gm of tea, the process is in
control.The standard deviation is 50 gm.A sample
of 225 jars is taken at random and the sample
average is found to be 510 gm.Has the process
gone out of control?

Hint:  =500, 500; Zcal = 3; Ho rejected


Example:

American Theaters knows that a certain hit


movie ran an average of 84 days in each city, and
the corresponding standard deviation was 10
days.The manager of the southeastern district
was interested in comparing the movie;s
popularity in his region with that in all of
American’s other theaters. He randomly chose
75 theaters in his region and found that they
ran the movie an average of 81.5 days.
 State appropriate hypothesis for testing
whether there was a significant difference in
the length of the picture’s run between
theaters in the southeastern district and all of
American’s other theaters.

 At a 1% significance level, test these


hypothesis.

 (Ans: Accept Ho)


Example:

A manufacturer claims that at least 95% of the


equipments which he supplied to a factory
conformed to the specification.An examination
of the sample of 200 pieces of equipment
revealed that 18 were faulty.Test the claim of
the manufacturer.

Hint: Ho:P=.95 Ha:P<.95 p=1-18/100=.91


Ho rejected.

You might also like