0% found this document useful (0 votes)
15 views

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 PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

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 PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 58

Hypothesis testing

Types of Statistical Hypotheses


There are two types of statistical hypotheses:

● Null hypothesis: The null hypothesis, denoted by H 0, is usually


the hypothesis that sample observations result purely from
chance

● Alternative hypothesis. The alternative hypothesis, denoted by


H or H , is the hypothesis that sample observations are
1 a
influenced by some non-random cause (investigator's belief).
Guidelines to choose H0
Null Hypotheis is chosen as something:
● Which the scientists or statisticians want to
disprove or nullify.
● Or is an accepted fact.
● Lack of a difference : It just says with and without
modification the results are the same(no
difference). There's no effect of making a change.
● It says whatever the sample is saying or depicting
is misleading.
Null Hypothesis (H0)

• It is usually stated for the purpose of possible


acceptance.
Example : Identify H0 and Ha
A coin was flipped 50 times, resulting in 40 Heads
and 10 Tails.
Two interpretations of the sample:
1) Null Hypothesis : says that the effect indicated by the
sample is due to Sampling variation and tha the coin is fair
and unbaised. (coin is given a benefit of doubt)Hence, null
hypothesis might be that half the flips would result in Heads
and half in Tails.
H :P=
0.5
0
2) Alternative Hypothesis : says that the effect indicated by the
sample is real and that the coin is not fair and biased. The
alternative hypothesis might be that the number of Heads and
Tails would be very different.
H :P≠
0.5
a
Example 1 : Identify H0 and Ha
A hypothesis is put forward that children who take
vitamin C are less likely to become ill during flu
season than those who do not. A hypothesis
test is conducted where a sample group of
children is given vitamin C for three months
while another group is not.
Example 1 : Solution
1)Null Hypothesis : Taking vitamin C does not
produce any effect.

2)Alternative Hypothesis : Taking Vitamic C


produces a difference.

As it turns out, the alternative hypothesis is


confirmed.
Example 2 : Identify H0 and Ha
● An individual claims that, contrary to what is commonly
accepted, he is telekinetic(the production of motion in
objects without contact or other physical means.) and can
read minds.
Example 2 : Solution
1)Null Hypothesis : He cannot read minds and
is not telekinetic.

2)Alternative Hypothesis : He can read minds


and is telekinetic.
Example 3 :Identify H0 and Ha
● Accused of a grave crime, a person is
placed under arrest and a trial is conducted.
Example 3 : Solution
1)Null Hypothesis : He is innocent, is
challenged in court. [ Defendant is given
benefit of doubt - To give someone the benefit
of the doubt means you assume that he or she
is telling the truth until proven otherwise.].

2)Alternative Hypothesis : He is not innocent


and has committed the crime.
Problem 4
In each of the following situations, state the
most appropriate null hypothesis regarding
the population mean µ.

1) A new type of battery will be installed in heart


pacemakers if it can be shown to have a mean
lifetime is greater than eight years.
Problem 4 : Solution
1) A new type of battery will be installed in heart
pacemakers if it can be shown to have a mean
lifetime is greater than eight years.

H0 : µ ≤ 8

H1 : µ >8
Problem 5
In each of the following situations, state the
most appropriate null hypothesis regarding
the population mean µ.

2) A new material for manufacturing tires will be


used if it can be shown that the mean lifetime of
the tires will be more than 60,000 miles.
Problem 5 : Solution
2) A new material for manufacturing tires will be
used if it can be shown that the mean lifetime of
the tires will be more than 60,000 miles.
H0 : µ ≤ 60,000
H1 : µ > 60,000
Problem 6
In each of the following situations, state the
most appropriate null hypothesis regarding
the population mean µ.

3) A quailty control inspector will recalibrate a


flowmeter if the mean flow rate differs from 10
mL/s.
Problem 6 : Solution
3) A quailty control inspector will recalibrate a
flowmeter if the mean flow rate differs from 10
mL/s.
H0 : µ = 10
H1 : µ ≠ 10
Real world applications
of Hypothesis
Testing
1)Testing whether more men than women suffer
from nightmares.
2)Evaluating the effect of the full moon on
behavior.
3)Checking whether bumper stickers reflect car
owner behavior.
4) Testing the claims of handwriting analysts.
Hypothesis
Test
● In performing Hypothesis Test, we essentially put
the null hypothesis on trial.
● We begin by assuming H0 is true.
● The random sample provides the evidence.
● The Hypothesis test involves measuring the strength
of disagreement between the sample and H0 .
● Two methods :
1) Traditional Method : Rejection region approach
2) P-value approach
Type of Hypothesis
Tests
test-statistic
A test statistic is a standardized value that is calculated
from sample data during a hypothesis test.
Used to determine whether to reject the null
hypothesis.
The test statistic is used to assess the strength of
evidence against H0 .
Its observed value changes randomly from one random
sample to a different sample.
Different Hypothesis
Tests
Different hypothesis tests use different test
statistics

based on the probability model assumed in the null
hypothesis. Common tests and their test statistics
include:
Test of Hypothesis ( statistical
Tests)
• It is process or procedure under which a
statistical hypothesis is laid down and it is
accepted or rejected on the basis of sample
drawn from the population.
• Commonly used statistical tests are:
• Z, T, Chi-Square, F-test and etc
Procedure for testing hypothesis
Step1: setup a null hypothesis or an Alternate hypothesis.
Step2: Decide the test criterion(z,t,chisquare,f)
Step3: Specify the level of significance (5% or 1%)
Step4: Calculate the value (appr. Formula)
Step5: Then obtain the table value of the test statistic corresponding to the l.S
(alpha) and d.f (n-1)
Step6: Make decision about accepting/rejecting the null hypothesis.
-computed value is less than table value – ( Accepted) Acceptance Region
-computed value is greater than table value- (Rejected) Rejection Region
The probability distribution plot above shows the distribution of sample means
we’d obtain under the assumption that the null hypothesis is true (population
mean = 260) and we repeatedly drew a large number of random samples.
Where do we draw the line for statistical significance on the graph? Now we'll add
in the significance level and the P value, which are the decision-making tools we'll
need.
We'll use these tools to test the following hypotheses:
•Null hypothesis: The population mean equals the hypothesized mean (260).
•Alternative hypothesis: The population mean differs from the hypothesized mean
(260).
What Is the Significance Level (Alpha)?

The significance level, also denoted as alpha


or α, is the probability of rejecting the null
hypothesis when it is true.

For example, a significance level of 0.05


indicates a 5% risk of concluding that a
difference exists when there is no actual
difference.
The significance level determines how far out from the null
hypothesis value we'll draw that line on the graph.
To graph a significance level of 0.05, we need to shade the 5% of
the distribution that is furthest away from the null hypothesis.
In the graph shown, the two shaded areas
are equidistant from the null hypothesis
value and each area has a probability of
0.025, for a total of 0.05.
In statistics, we call these shaded areas
the critical region for a two-tailed test.
If the population mean is 260, we’d expect
to obtain a sample mean that falls in the
critical region 5% of the time.
The critical region defines how far away our
sample statistic must be from the null
hypothesis value before we can say it is
unusual enough to reject the null
hypothesis.
Our sample mean (330.6) falls within the
critical region, which indicates it is
statistically significant at the 0.05
• The two shaded areas each
have a probability of 0.005,
which adds up to a total
probability of 0.01.
• This time our sample mean
does not fall within the critical
region and we fail to reject
the null hypothesis.
• This comparison shows why
you need to choose your
Errors in Hypothesis
Testing
Introduction
● Since test results in a firm decision, there is a chance that
the decision could be the wrong one.
● There are exactly two ways in which the decision can be
wrong:

One can reject H0 when it is in fact true. This is known as a
type I error.
● Or, one can fail to reject H0 when it is false. This is known as a
type II error.
Type I error (a "false positive")
● When the null hypothesis is true and you reject it,
you make a type I error.
● The probability of making a type I error is α, which is the
level of significance you set for your hypothesis test.
● An α of 0.05 indicates that you are willing to accept a
5% chance that you are wrong when you reject the null
hypothesis.
● To lower this risk, you must use a lower value for α.
● However, using a lower value for alpha means that you
will be less likely to detect a true difference if one
really exists.
Problem 1
A hypothesis test is to be performed, and it is
decided to reject the null hypothesis if P ≤ 0.10.
If H0 is in fact true, what is the maximum
probability that it will be rejected?
Problem 1 : Solution
The maximum probability of rejecting H0 when
true is the level α = 0.10.
Type II error (a "false negative")
● When the null hypothesis is false and you fail to reject
it, you make a type II error.
● The probability of making a type II error is β, which
depends on the power of the test.
● You can decrease your risk of committing a type II error by
ensuring your test has enough power.
● You can do this by ensuring your sample size is large
enough to detect a practical difference when one truly
exists.
Type I error and Type II error
4 possible decisions:
1) Accepting a null hypothesis when it is true.
2) Rejecting a null hypothesis when it is false.
3) Rejecting a null hypothesis when it is true
4) Accepting a null hypothesis when it is false.
Type I error
The first kind of error is the rejection of a true null hypothesis as the result of a test
procedure. This kind of error is called a type I error (false positive) and is
sometimes called an error of the first kind.

Type II error
The second kind of error is the failure to reject a false null hypothesis as the
result of a test procedure. This sort of error is called a type II error (false
negative) and is also referred to as an error of the second kind.
• A perfect test would have zero false positives and zero false
negatives.
• However, statistical methods are probabilistic, and it cannot
be known for certain whether statistical conclusions are
correct. Whenever there is uncertainty, there is the
possibility of making an error.
• Considering this nature of statistics science, all statistical
hypothesis tests have a probability of making type I and
type II errors.
•The type I error rate or significance level is the probability of rejecting the
null hypothesis given that it is true.
•It is denoted by the Greek letter α (alpha) and is also called the alpha
level.
•Usually, the significance level is set to 0.05 (5%), implying that it is
acceptable to have a 5% probability of incorrectly rejecting the true null
hypothesis.
•The rate of the type II error is denoted by the Greek letter β (beta)
•These two types of error rates are traded off against each other:
•For any given sample set, the effort to reduce one type of error generally
results in increasing the other type of error.
Critical Region
• If the computed value of the test statistic falls
in the rejection region, we reject the null
hypothesis.
• The rejection region is also known as critical
region
Two Tailed Test
• Two tailed hypothesis tests are also known as
non directional and two sided test.
• When you perform a two tailed test, you split
the significance level percentage between
both tails of the distribution.
One tailed Test
• One tailed hypothesis are also known as
directional and one sided test.
• When you perform a one tailed test the entire
significance level percentage goes into
extreme end of one tail of the distribution.
One tailed test
Critical value
• The value of the test statistic which separates
the rejection region from the acceptance
region is called the critical value.
Level of Significance One tailed Two tailed

1% (0.01) 2.33 2.58

5% (0.05) 1.65 1.96


Tabl
e
When to use z-test and t-test?
• z-test:- To test the given population mean
when the sample is large (>30) or when the
population standard deviation is known.
• t-test:- To test the given population mean
when the sample is small (<30) or when the
population standard deviation is unknown.
Note
Population SD Population SD
known unknown
n < 30 Use Z table Use t table
(small sample and
appears to come
from a normal
population)

n >= 30 Use Z table Use Z or t table


(large sample)
Testing mean
• For this type of problems we can apply z-test or t-test.
Test for mean
A principal at a certain school claims that the students in his
school are above average intelligence. A random sample of
thirty (30) students IQ scores have a mean score of 112.

Is there sufficient evidence to support the principal's claim?

(The mean population IQ is 100 with a standard deviation of


15. Use a 0.05 significance level)
The amount of a certain trace element in blood is known to vary with a standard
deviation of 14.1 ppm (parts per million) for male blood donors and 9.5 ppm for
female donors. Random samples of 75 male and 50 female donors yield
concentration means of 28 and 33 ppm, respectively. What is the likelihood that
the population means of concentrations of the element are the same for men and
women? (Assume 10% significance)
Sample mean = 130.05
Population mean = 120
Sample size n = 20
Sample sd = 9.960316

df = ?

L.S = 0.01 (one side t-test, two-side t-test)

According to t-table : one-side: ?


two-side : ?
Thank you…

You might also like