You are on page 1of 30

ME-5102

Research Methodology &


Design of Experiments
Lect. # 4
Hypothesis Tests

Dr. Nazeer Ahmad Anjum


Mechanical Engineering Program
Engineering University Taxila
Symbols 3

Variable Population Sample


_
Mean X

Proportion p

Variance 2 s2

Standard deviation s
_ _
Size N n

Standard error of the mean x Sx


Standard error of the proportion p Sp

15-3

13-Mar-17

Questions 4

What is a statistical hypothesis?


What is the null hypothesis? Why is it
important for statistical tests?
Describe the steps in a test of the null
hypothesis.

13-Mar-17
Introduction to Hypothesis 5
Hypothesis Testing can be used to determine
whether a statement about the value of a
population parameter should or should not be
rejected.
The Null Hypothesis, denoted by H0 , is a tentative
assumption (some one expecting/hoping) about a
population parameter.
The Alternative Hypothesis, denoted by Ha, is the
opposite of what is stated in the null hypothesis.

The alternative hypothesis is what the test is


attempting to establish.
13-Mar-17

Intro to Hypothesis 6

A hypothesis is a statement about a Pop.


Parameter.
A hypothesis may be either true or false
In hypothesis testing, we must decided which
of two mutually exclusive hypothesis is
supported by the data.

13-Mar-17
Hypothesis 7

Two major areas of statistics:


i. Descriptive (X bar, S, graphs, etc.)
ii. Inference
Hypothesis testing is a procedure in which
we use data to decide which of two
hypothesis is more likely to be true.
Hypothesis testing allows us to make an
inference.

13-Mar-17

7 Steps of Hypothesis 8
1. State Null hypothesis, Ho, The mean age of all
UET students is 21 yrs, Ho: = 21
2. State alternate hypothesis, Ha, The mean age
of all UET students is not 21 yrs, Ha: 21
may by Ha: < 21, or Ha: > 21.
3. Decide on significance level,
4. Calculate the appropriate test statistic
5. Use tables to find the p-value of the test
statistic
6. Make decision
7. State conclusions (and assumptions, if any) 13-Mar-17
7 Steps Explaining (Statistical Testing) 9
Testing for statistical significance involves the
following six-stage sequence:
1. State the null hypothesis (Ho):
Make a formal clear statement of the null
hypothesis and also of the alternative
hypothesis (Ha);

13-Mar-17

Statistical Testing Procedures 10

2. Choose an appropriate statistical test:


Two types of tests are parametric (t-test)
and nonparametric (Chi-square).
In choosing a test, one can consider how
the sample is drawn, the nature of the
population, and the type of
measurement scale used.

13-Mar-17
Statistical Testing Procedures 11
3. Select the desired level of significance:
The choice of the level of significance should be
made before we collect the data. The most
common level is 0.05, although 0.01 is also
widely used. Other levels such as .10, .25, or
.001 are sometimes chosen.
The exact level to choose is largely determined by
how much risk one is willing to accept and the
effect that this choice has on risk. The larger
the , the lower is the .

13-Mar-17

Statistical Testing Procedures 12


4. Compute the calculated difference value:
After the data are collected, use the formula
for the appropriate significance test to
obtain the calculated value.

13-Mar-17
Statistical Testing Procedures 13

5. Obtain the critical test value:


After we compute the calculated t, Chi-
square, or other measure, we must look
up the critical value in the appropriate
table for that distribution. The critical
value is the criterion that defines the
region of rejection from the region of
acceptance of the null hypothesis.

13-Mar-17

Statistical Testing Procedures 14


6. Interpret the test:
For most tests, if the calculated value is larger
than the critical value, we reject the null
hypothesis.
If the critical value is larger, we conclude we
have failed to reject the null hypothesis.

13-Mar-17
Fundamental of Hypothesis Testing 15
There two types of statistical inferences, Estimation
and Hypothesis Testing

Hypothesis Testing: A hypothesis is a claim


(assumption) about one or more population parameters.
Average price of a Three-pack Lux is = Rs. 100
The population mean monthly cell phone bill is:
= Rs. 2000
The average number of TV sets at homes is; = 2

13-Mar-17

Fundamental of Hypothesis Testing 16


It is always about a population parameter, not about a
sample statistic
Sample evidence is used to assess the probability that the
claim about the population parameter is true
A. It starts with Null Hypothesis, H0
H 0 : 3 and X=2.79
1. We begin with the assumption that H0 is true and any
difference between the sample statistic and true
population parameter is due to chance and not a real
(systematic) difference.
2. Similar to the notion of innocent until proven guilty
3. That is, innocence is a null hypothesis.
13-Mar-17
Fundamental of Hypothesis Testing 17
4. Refers to the status quo
5. Always contains = , or sign
6. May or may not be rejected
B. Next we state the Alternative Hypothesis, Ha
1. Is the opposite of the null hypothesis
e.g., The average number of TV sets at homes is not
equal to 3 ( Ha: 3 )
2. Challenges the status quo
3. Never contains the = , or sign
4. May or may not be proven
5. Is generally the hypothesis that the researcher is
trying to prove. Evidence is always examined with
respect to Ha, never with respect to H0.
6. We never accept H0, we either reject or not
reject it 13-Mar-17

Example 18
A research team creates a fuel injection system to
improve/achieve efficiency of its cars, the current
efficiency is 24 MPG
Thus the research hypothesis is the alternate
hypothesis Ha.
Ho: 24
Ha : 24

13-Mar-17
Example 19
A company filled bottles at 250 mL at least. Thus the
Null Hypothesis would be
Ho: 250 mL
Challenge is to label the bottle are under filled
Ha : 250 mL
Govt. Agency will check Ha or Ho
Company does not want to under fill but also avoids
over filling, thus
Ho: = 250 mL
Ha : 250 mL
All these are controlled by the QC Deptt.

13-Mar-17

Hypothesis Testing (HT): Introduction 20


After discussing procedures for data
preparation and preliminary analysis, the
next step for many studies is hypothesis
testing.
In this context, induction and deduction is
fundamental to hypothesis testing.

13-Mar-17
Hypothesis Testing (HT): Introduction 21
Induction and deduction are used together in
research reasoning.
Researchers describe this process as the double
movement of reflective thought.
Induction occurs when we observe a fact and ask,
Why is this?
In answer to this we advance a tentative
explanation (hypothesis).
Deduction is the process by which we test whether
the hypothesis is capable of explaining the fact

13-Mar-17

Hypothesis Testing (HT): Introduction 22


Example:
You promote a product but sales dont increase.
(Fact1)
You ask the question Why didnt sales increase?.
(Induction)
You infer a conclusion (hypothesis) to answer the
question: The promotion was poorly executed.
(Hypothesis)

13-Mar-17
Hypothesis Testing (HT): Introduction 23
You use this hypothesis to conclude (deduce) that
sales will not increase during a poorly executed
promotion. You know from experience that
ineffective promotion will not increase sales.
(Deduction1)
We deduce that a well-executed promotion will
result in increased sales. (Deduction2)
We run an effective promotion, and sales
increase. (Fact2).

13-Mar-17

Hypothesis Testing (HT): Introduction 24


Inductive reasoning moves from specific facts to
general, but tentative, conclusions.
With the help of probability estimates,
conclusions can be refined and results discussed
with a degree of confidence.
Statistical inference is an application of inductive
reasoning.
It allows us to reason from evidence found in the
sample to conclusions we wish to make about the
population.

13-Mar-17
Statistical Significance 25
Following classical statistics approach, we accept
or reject a hypothesis on the basis of sampling
information alone.
Since any sample will almost surely vary somewhat
from its population, we must judge whether the
differences are statistically significant or
insignificant.
A difference has statistical significance if there is
good reason to believe the difference does not
represent random sampling fluctuations only.

13-Mar-17

Statistical Significance: Example 26


Honda, Toyota, and other auto companies produce
hybrid vehicles using an advanced technology that
combines a small gas engine with an electric motor.
The vehicles run on an electric motor at slow
speeds but shifts to both the gasoline motor and the
electric motor at city and higher freeway speeds.
Their advertising strategies focus on fuel economy.

13-Mar-17
Statistical Significance: Example 27
Lets say that the hybrid Civic has maintained an
average of about 50 miles per gallon (mpg) with a
standard deviation of 10 mpg.
Suppose researchers discover by analyzing all
production vehicles that the mpg is now 51.
Is this difference statistically significant from 50?

Yes it is, because the difference is based on a census of


the vehicles and there is no sampling involved.
It has demonstrated conclusively that the
been
population average has moved from 50 to 51 mpg.

13-Mar-17

Statistical Significance: Example 28


Since it would be too expensive to analyze all
of a manufacturers vehicles frequently, we
resort to sampling.
Assume a sample of 25 cars is randomly
selected and the average mpg is 54.
Is this statistically significant?
The answer is not obvious.
It is significant if there is good reason to
believe the average mpg of the total population
has moved up from 50.

13-Mar-17
Statistical Significance: Example 29
Since the evidence consists only of a sample
consider the second possibility: that this is
only a random sampling error and thus is not
significant.
The task is to decide whether such a result
from this sample is or is not statistically
significant.
To answer this question, one needs to consider
further the logic of hypothesis testing.

13-Mar-17

Decision Making Under Uncertainty30


You have to make decisions even when you
are unsure. School, marriage, therapy,
jobs, whatever.
Statistics provides an approach to
decision making under uncertainty. Sort of
decision making by choosing the same way
you would bet. Maximize expected utility
(subjective value).

13-Mar-17
Statistics as a Decision Aid 31
Because of uncertainty (have to estimate
things), we will be wrong sometimes.
The point is to be thoughtful about it; how
many errors of what kinds? What are the
consequences?
Statistics allows us to calculate
probabilities and to base our decisions on
those. We choose (at least partially) the
amount and kind of error.
Hypothesis testing done mostly by
convention, but there is a logic to it.

13-Mar-17

Hypothesis Testing 32
The general goal of a hypothesis test is to
rule out chance (sampling error) as a
plausible explanation for the results from a
research study.
Hypothesis testing is a technique to help
determine whether a specific treatment has
an effect on the individuals in a population.

13-Mar-17
Hypothesis Testing 33
Research hypothesis are formulated in terms
of the outcome that the experimenter wants,
and an alternative outcome that he doesnt
want
I.e. If were comparing scores on an exam
with two groups, one with test anxiety and
one without, our hypotheses are:
(1) That the group with test anxiety will score
higher (expected outcome)
(2) The two groups will score the same
(unexpected outcome)

13-Mar-17

The Logic of Hypothesis Testing 34


Analysts usually test to determine whether
there has been no change in the population of
interest or whether a real difference exists.
A null hypothesis is always stated in a
negative form.
In the hybrid-car example, the null hypothesis
states that the population parameter of 50 mpg has
not changed.

13-Mar-17
The Logic of Hypothesis Testing 35
The alternative hypothesis holds that there has
been a change in average mpg (i.e., the sample
statistic of 54 indicates the population value
probably is no longer 50).
The alternative hypothesis is the logical
opposite of the null hypothesis.
The hybrid-car example can be explored further to
show how these concepts are used to test for
significance.

13-Mar-17

The Logic of Hypothesis Testing 36

The null hypothesis (Ho): There has been no


change from the 50 mpg average.
The alternative (Ha) may take several forms,
depending on the objective of the researchers.
The Ha may be of the not the same or the
greater than or less than form:
The average mpg has changed from 50.
The average mpg has increased (decreased) from
50.

13-Mar-17
The Logic of Hypothesis Testing 37
These types of alternative hypotheses
correspond with two-tailed and one-tailed
tests.
A two-tailed test, or non-directional test,
considers two possibilities:
the average could be more than 50 mpg, or
It could be less than 50.
To test this hypothesis, the region of rejection
are divided into two tails of the distribution.

13-Mar-17

The Logic of Hypothesis Testing 38


Such hypothesis can be expressed in the
following form:
Null Ho: = 50 mpg
Alternative Ha: 50 mpg (not the same case)

13-Mar-17
Level of Significance 39
This is a very important concept in the
context of hypothesis testing.
It is always some percentage (usually 5%)
which should be chosen with great care,
thought and reason.
In case we take the significance level at 5 per
cent, then this implies that H0 will be rejected

13-Mar-17

Two-Tailed and One-Tailed Tests 40


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)

13-Mar-17
Two Tailed Tests 41

Mathematically we can state:

13-Mar-17

One Tailed Tests 42


If our H0 : =Ho and
Ha: <Ho then we are
interested in what is known as
one-tailed test (wherein there is
one rejection region only on
the left tail)
Mathematically we can state:

13-Mar-17
One Tailed Tests 43
If our H0 : =Ho and Ha:
>Ho then we are interested in
what is known as one-tailed
test (wherein there is one
rejection region only on the
right tail)
Mathematically we can state:

13-Mar-17

Summary 44
In the process of hypothesis testing, the null hypothesis
initially is assumed to be true
Data are gathered and examined to determine whether
the evidence is strong enough with respect to the
alternative hypothesis to reject the assumption.
In another words, the burden is placed on the researcher
to show, using sample information, that the null
hypothesis is false.
If the sample information is sufficient enough in favor
of the alternative hypothesis, then the null hypothesis is
rejected. This is the same as saying if the persecutor
has enough evidence of guilt, the innocence is
rejected.
Of course, erroneous conclusions are possible, type I
and type II errors. 13-Mar-17
Type I and Type II Errors 45
In the context of testing of Hypothesis, there are
basically two types of errors we can make.
We may reject Ho when Ho is true, and we may
accept Ho when in fact Ho is not true.
The former is known as Type I error and the latter as
Type II error.

13-Mar-17

Type I and Type II Errors 46

In other words, Type I error means rejection of


hypothesis which should have been accepted and
Type II error means accepting the hypothesis
which should have been rejected.
Type I error is denoted by (alpha) known as
error, also called the level of significance of test;
and
Type II error is denoted by (beta) known as
error.

13-Mar-17
Type I and Type II Errors 47
If type I error is fixed at 5%, it means that
there are about 5 chances in 100 that we
will reject Ho, when Ho is true.
We can control Type I error just by fixing
it at a lower level.
For instance, if we fix it at 1 percent, we will
say that the maximum probability of
committing a type I error would only be
0.01.

13-Mar-17

Type I and Type II Errors 48


With a fixed sample size n, when we try to reduce
Type I error, the probability of committing Type II
error increases. There is a trade off between the two
( error = 1 error).

= probability of rejecting the Ho when Ho is true (Type I


error)
= probability of failing to rejecting the Ho when Ho is
false (Type II error)

13-Mar-17
Type I and Type II Errors 49

13-Mar-17

Common Formula 50
1. Population normal, population infinite, sample size
may be large or small but variance of the population is
known, Ha may be one-sided or two-sided:

2. Population normal, population finite, sample size may be large or


small but variance of the population is known, Ha may be one-sided
or two-sided:

13-Mar-17
Common Formula 51
3. Population normal, population infinite, sample size
small and variance of the population unknown, Ha may
be one-sided or two-sided:

4. Population normal, population finite, sample size small


and variance of the population unknown, and Ha may be
one-sided or two-sided:

13-Mar-17

Common Formula 52
5. Population may not be normal but sample size is large,
variance of the population may be known or unknown,
and Ha may be one-sided or two-sided:

OR

13-Mar-17
Hypothesis: Example 53

A company owns a fleet of cars with mean mpg known


to be = 30. This company will use a gasoline additive
only if the additive increases gasoline mpg. A sample
of 36 cars used the additive. The sample mean was
calculated to be x = 31.3 miles with std. dev. S =7.0
miles. Does the additive significantly increase mean
mpg? Use = 0.10.

13-Mar-17

Hypothesis Example Solution 54


If sample size > 30, then z-distribution
If sample size 30 then t-distribution
1) H0 : = 30
2) Ha : > 30
3) = 0.10
4) n = 36
4) X bar = 31.3, s = 7.0

5) The p-value is the probability of getting a value of


1.11 or larger for the test statistics (since Ha : > 30)
The test statistics follows a t-distribution. But since n
is large.
13-Mar-17
Hypothesis Example Solution 55
The Central Limit Theorem (CLT), tells us that this t-dist. will
nearly identical to a standard normal dist. So we can use the
standard normal dist. (Table A-1) to find out p-value.
p( z 1.11) = 0.1335

z at 1.11 is 0.8665, so (1-0.8665) = 0.1335

Rejection
region is
0 shaded

6) Reject H0 if p-value
Since 0.1335 is not less than 0.110, so we don't reject
Ho.
13-Mar-17

Hypothesis Example Solution 56

7) At the 10% significance level we conclude that the


gasline additive does not significantly increase mpg of
the entire fleet of cars.
NOTE: Some books call this a z-test, since we use a
standard normal distribution to find the p-value.
Assumption:
Random sample of independent observations

13-Mar-17
Probability Values (p Values) 57
According to the interpret the test step of the
statistical test procedure, the conclusion is
stated in terms of rejecting or not rejecting the
null hypothesis based on a rejection region
selected before the test is conducted.
A second method of presenting the results of a
statistical test reports the extent to which the
test statistic disagrees with the null hypothesis.

13-Mar-17

Probability Values (p Values) 58


This second method has become popular
because analysts want to know what
percentage of the sampling distribution lies
beyond the sample statistic on the curve, and
most statistical computer programs report the
results of statistical tests as probability values
(p values).
The p value is the probability of observing a
sample value as extreme as, or more extreme
than, the value actually observed, given that
the null hypothesis is true.

13-Mar-17
Probability Values (p Values) 59

The p value is compared to the significance


level (), and on this basis the null hypothesis
is either rejected or not rejected.
If p value is less than the significance level, the
null hypothesis is rejected.
If p value is greater than or equal to the
significance level. The null hypothesis is not
rejected.

13-Mar-17

You might also like