You are on page 1of 67

Hypothesis testing

1
Hypothesis testing
 A statistical method that uses sample data to
evaluate a hypothesis about a population parameter.
 It is intended to help researchers differentiate
between real and random patterns in the data(i.e.
Involves conducting a test of statistical significance
and quantifying the degree to which chance or
sampling variability may account for the results
observed in a particular study)
2
What is a Hypothesis?
 A hypothesis is a
I claim the mean GPA of
claim (assumption) about this class is   3.5
the true value of unknown
population parameter
- Parameter may be
population mean, proportion,
correlation coefficient,...
– Must be stated
before analysis
3
Hypothesis testing
 The purpose of hypothesis testing is to determine whether
enough statistical evidence exists to enable us to conclude that
a belief or hypothesis about a parameter is reasonable
 Examples

– Is a new drug effective in curing a certain disease? A


sample of patient is randomly selected. Half of them are
given the new drug where half are given the standard drug
. Then, the improvement in the patients conditions is
measured and compared
4
Hypothesis Testing Process
Assume the
population
mean age is 50.
( H 0 :   50) Identify the Population

Is X  20 likely if    ?
Take a Sample
No, not likely!

REJECT H0
 X  20 
5
Steps in hypothesis testing

1) State the statistical hypotheses


 There are two hypotheses:
-Null hypotheses

- Alternative hypotheses

6
State the null hypotheses

 Null hypothesis – called the hypothesis of no


difference or no association or no effect
 States that ‘’there’s no difference’’ between the
hypothesized value and the population
parameter value
 Is always about a population parameter, not
about a sample

7
Null Hypothesis:
H0

 The null hypothesis (denoted by H0) is a statement that


the value of a population parameter (such as proportion,
mean, or standard deviation) is equal to some claimed
value.
 Always contains the “=” “≤” or “” sign
 We test the null hypothesis directly.

 Either reject H0 or fail to reject H0.

8
State the alternative hypotheses
 Alternate to null hypothesis

 Says’’ there’s a difference between the


hypothesized value and the population parameter
value
 It is what we are trying to prove, i.e. the reason for
the research question.

9
Alternative Hypothesis:
H1 or HA

 The alternative hypothesis (denoted by H1 or HA) is


the statement that the parameter has a value that
somehow differs from the null hypothesis.

 The symbolic form of the alternative hypothesis


must use one of these symbols: , < or >.

 May or may not be accepted

10
Hypothesis
Example: Consider population mean

H 0 : μ = μ0 H0 : μ ≤ μ 0 H0: μ  μ0
H A : μ  μ0 HA : μ > μ 0 HA: μ < μ0

Two- tailed One - tailed One- tailed

11
Hypothesis-Testing Common Phrases
> <
 Is greater than  Is less than

 Is more than  Is below

 Is larger than  Is lower than

 Is longer than  Is shorter than

 Is bigger than  Is smaller than

 Is better than  Is reduced from

12
Hypothesis-Testing Common Phrases
≥ ≤
 Is greater than or equal to  Is less than or equal to
 Is at least  Is not more than
 Is not less than  Is at most

=

 Is equal to
 Is not equal to
 Is not different from
 Is different from
 Has no change from
 Has changed from
 Is the same as
 Is not the same as
13
Example:
A. Is the mean SBP of the population is different from 120
mmHg?

- H0 : The mean SBP of the population is not different from

120 mmHg (H0: m = 120).

- HA : The mean SBP of the population is different from 120

mmHg (H1: m ≠ 120).

14
Example:
B. Is the mean SBP of the population is less than 120 mmHg?

- H0 : The mean SBP of the population is equal to 120

mmHg (H0: m = 120).

- HA : The mean SBP of the population is less than 120

mmHg (H1: m < 120).

15
Example:
C. Is the mean SBP of the population is more than 120 mmHg?

- H0 : The mean SBP of the population is equal to 120

mmHg (H0: m = 120).

- HA : The mean SBP of the population is greater than 120

mmHg (H1: m > 120).

16
2) Select a sample and collect data
3) Decide on the appropriate test statistic for 
the hypothesis (Z, t, χ2, F, etc )

17
Selecting an appropriate test statistic

Sample size (n) <30 > / = 30

Population Z -TEST Z- TEST


standard
deviation known

Population
Standard T-TEST Z OR T- TEST
deviation not
known

18
4)Select the level of significance for the 
statistical test
Level of Significance () : Defines rejection
region of the sampling distribution
 Called rejection region of sampling distribution
 Is designated by  , (level of significance)
– Typical values are .01, .05, or .10
 Is selected by the researcher at the beginning
 Provides the critical value(s) of the test

19
5) Determine the critical value
 Find the critical value in the distribution table for each test
statistics(tabulated value ) using the α - value and the degrees of
freedom(where applicable)
 The critical value separates the acceptance zone from the
rejection zone
 One tailed test – area of rejection is in either the lower or
upper tail of the distribution
 Two- tailed – 2 areas of rejection, one in each tail of the
distribution 20
Rejection Regions
(Two -tail test)

H0: =
HA: 

21
Rejection Region
(One - tail test: Left tail test)

H0: =
H1: <

22
Rejection Region
(One - tail test: Right tail test)

H 0: =
H 1: >

23
6) Perform the calculation
 Apply the formula of the test statistics to get the
calculated value

Estimate-Hypothesized Parameter
test statistic=
Standard Error
 Compare the calculated value to the tabulated or the
critical value
 Check which zone the calculated value falls into
24
7) Make decision and State the conclusion
 There are two possible decisions:

I) Reject the null hypothesis
– Conclude that there is enough evidence to support the alternative
hypothesis

II) Do not reject the null hypothesis


– Conclude that there is not enough evidence to support the alternative
hypothesis
 If the numerical value of the test statistic falls in the 

rejection region, we reject the null hypothesis
 If the test statistic does not fall in the rejection region, 

we do not reject  H0 25


Rejection Regions
(Two -tail test)

 Reject H0

26
Rejection Regions
(Two -tail test)

 Reject
H0
27
Rejection Regions
(Two -tail test)

 Accept
H0
28
Rejection Region
(One - tail test: Left tail test)

 Accept H0

29
Rejection Region
(One - tail test: Left tail test)

 Reject H0

30
Rejection Region
(One - tail test: Right tail test)

 Accept H0

31
Rejection Region
(One - tail test: Right tail test)

 Reject H0

32
p-value
 p-value: is the probability of obtaining a test statistic
at least as extreme ( ≤ or  ) as the observed sample
value, given H0 is true
– Also called observed level of significance
– Smallest value of  for which H0 can be rejected
 Decision : Compare the p-value with 
– If p-value ≥ α, do not reject H0
– If p-value <  α, reject H0

33
Procedure for finding P-Values

 Critical region in P-value = area to the left of the


the left tail: test statistic
 Critical region in P-value = area to the right of the
the right tail: test statistic
 Critical region in P-value = twice the area in the tail
two tails: beyond the test statistic

34
Procedure for finding P-Values

35
The p-Value: Rules of Thumb
When the p-value is smaller than 0.01, the result is called very
significant.

When the p-value is between 0.01 and 0.05, the result is called
significant.

When the p-value is between 0.05 and 0.10, the result is considered
by some as marginally significant (and by most as not significant).

When the p-value is greater than 0.10, the result is considered not
significant.

36
The P-value

 By convention, p-values of <.05 are often accepted as


“statistically significant” in the medical literature; but
this is an arbitrary cut-off

 A cut-off of p<.05 means that in about 5 of 100


experiments, a result would appear significant just by
chance (“Type I error”)
37
Errors in making Decision
1.Type I Error
– Probability of rejecting true null hypothesis
– Probability of accepting a false alternative hypothesis
– Probability of Type I Error is (Alpha)
• Called level of significance

2.Type II Error
– Probability of failing to reject a false null hypothesis
– Probability of rejecting a true alternative hypothesis
– Probability of Type II Error is (Beta)

38
Decision Results
H0: Innocent
Jury Trial H0 Test
Actual Situation Actual Situation
Verdict Innocent Guilty Decision H0 True H0
False
Type II
Innocent Correct Error Accept 1–a Error
H0
(b)
Reject Type I Power
Guilty Error Correct
H0 Error (a) (1 – b)
Type I & II Errors Have an Inverse
Relationship
If you reduce the probability of one
error, the other one increases so that
everything else is unchanged.

40
Factors Affecting Type II Error
 Significance level

–  Increases when  decreases

 Population standard deviation
 
–  Increases when  increases

 Sample size

–  Increases when n decreases n
41
Controlling Type I and
Type II Errors
 For any fixed , an increase in the sample
size n will cause a decrease in 
 For any fixed sample size n, a decrease in 
will cause an increase in . Conversely, an
increase in  will cause a decrease in .
 To decrease both  and , increase the
sample size.

42
Power of a statistical test

 The power of a statistical test is the probability of


rejecting Ho, when Ho is really false. Thus power = 1-
β.
 Clearly if the test maximizes power, it minimizes the
probability of Type 2 error β.

43
Summary:
Elements of a Hypothesis Test
Null Hypothesis (H0)
– A theory about the values of one or more population
parameters. The status quo.
Alternative Hypothesis (Ha)
– A theory that contradicts the null hypothesis. The theory
generally represents that which we will accept only when
sufficient evidence exists to establish its truth.
Test Statistic
– A sample statistic used to decide whether to reject the null
hypothesis. In general,
Estimate-Hypothesized Parameter
test statistic=
Standard Error
44
Summary:
Elements of a Hypothesis Test

Critical Value
– A value to which the test statistic is compared at some
particular significance level. (usually at  =.01, .05, .10)
Rejection Region
– The numerical values of the test statistic for which the null
hypothesis will be rejected.
– The probability is  that the rejection region will contain the
test statistic when the null hypothesis is true, leading to a
Type I error.  is usually chosen to be small (.01, .05, .10) and
is the level of significance of the test. 45
Summary of One- and Two-Tail Tests

One-Tail Test Two-Tail Test One-Tail Test


(left tail) (right tail)

H0 : μ  μ 0 H0: μ ≤ μ0
H A : μ < μ0 HA: μ > μ0

46
Summary: Rejection Regions
1. Rejection Regions (In Grey)
.5 
 
.5 
Form of Ha: 0 2 2

2-tail hypothesis 

2 2

If |z|>|z/2|
0

Then reject the null hypothesis.

Form of Ha: <0 .5  


1-tail hypothesis
 .5

If z< z
0

Then reject the null hypothesis.

Form of Ha: >o


.5  
1-tail hypothesis

.5
If z> z

Then reject the null hypothesis

47
Summary :Type I and Type II Errors

48
Example: Two-Tail Test

Q. Does an average box of


cereal contain 368 grams of
cereal? A random sample of
25 boxes showed X = 372.5.
The company has specified s
368 gm.
to be 15 grams. Test at the a
= 0.05 level.

49
Example Solution: Two-Tail Test
H0: m = 368
H1: m ¹ 368 Test Statistic:
s= 15
n = 25 X   372.5  368
Z   1.50
Z –test is appropriate  15
a = 0.05
n 25
Decision: Do not reject H0
Critical Value: ±1.96
at a = .05
Reject Reject
.025 .025
Conclusion: There is
No evidence that the
-1.96 0 1.96
Z true Mean is not 368
1.50
50
Example: Two-Tailed Test
Does an average box of cereal
contain 368 grams of cereal?
A random sample of 36 boxes
had a mean of 372.5 and a
standard deviation of 12
368 gm.
grams. Test at the .05 level of
significance.
Solution
Test Statistic:
• H0:  = 368
• HA:   368 X   372.5  368
t*     2.25
•  = 0.05 S 12
• df = 36-1=35 n 36
• Critical Value: ±2.042 0.02 < p-value < 0.05

Decision: Reject Ho since p-


Reject H0 Reject H0 value <  = .05 and t* > t-critical
.025 .025
Conclusion: There is evidence
-2.042 0 2.042 t population average is not 368 but
is >
Example: One Tail Test

Q. Does an average box of


cereal contain more than
368 grams of cereal? A
random sample of 25
boxes showed X = 372.5.
The company has 368 gm.
specified s to be 15 grams.
Test at the a = 0.05 level. H0: m £ 368
H1: m > 368

53
Solution
H0: m £ 368
H1: m > 368 Test Statistic:
a = 0.05 X 
Z 1.50
n = 25 
Critical Value: 1.645 n
Reject

.05 Do Not reject H0 at a = .05


Decision:
0 1.645
Z No evidence that true
Conclusion:
mean is more than 368
1.50 54
p -Value Solution

p-Value is P(Z ³ 1.50) = 0.0668


Use the
alternative P-Value =.0668
hypothesis
to find the
direction of
the rejection
region.
0 1.50 Z

Z Value of
Sample Statistic
55
p -Value Solution
(p-Value = 0.0668) ³ (a = 0.05)
Do Not reject H0 .
p Value = 0.0668

Reject

a = 0.05

0 1.645
Z
1.50
Test Statistic 1.50 is in the non reject region
56
Example: One-ailed Test

Is the average capacity of the


batteries less than 140 ampere-
hours? A random sample of 20
batteries had a mean of 138.47 and
a standard deviation of 2.66.
Assume a normal distribution. Test
at the .05 level of significance.
Solution
Test Statistic:
• H0:  = 140
X   138.47  140
Ha:  < 140
*
• t    2.57
S 2.66
•  = 0.05
n 20
• df = 20-1=19
• Critical Value: • 005 < p-value <.01

Reject H0 Decision: Reject Ho since


p-value < a and t* < t-critical
.05
Conclusion: There is an evidence
population average is less than 140
-1.729 0 t
Example

 In a survey of diabetics in a large city, it was found that


100 out of 400 have diabetic foot. Can we conclude that
20 percent of diabetics in the sampled population have
diabetic foot. Test at the a =0.05 significance level.
Solution
p  
Ho: π = 0.20 Z 
 (1   )
H1: π  0.20
n
0.25 – 0.20
Z= 0.20 (1- 0.20) = 2.50
400
Critical Value: 1.96
Decision:
Reject Reject We have sufficient evidence to reject
.025 .025 the Ho value of 20%
We conclude that in the population
of diabetic the proportion who have
-1.96 0 +1.96 Z diabetic foot does not equal 0.20
60
Inference About a
Population Variance

61
Inference About a Population Variance

 Sometimes we are interested in making


inference about the variability of processes.
– Examples:
• The consistency of a production process
for quality control purposes.

62
Inference About a Population Variance

 A common goal in business and industry is to improve


the quality of goods or services by reducing variation.
Quality control engineers want to ensure that a product
has an acceptable mean, but they also want to produce
items of consistent quality so that there will be few
defects.
 To draw inference about variability, the parameter
of interest is s2.
63
Inference About a Population Variance

 The sample variance s2 is an unbiased,


consistent and efficient point estimator for s2.
2
(n  1)s
 The statistic  2
has a distribution
called Chi-squared, if the population is
normally distributed.
( n  1) s 2
d.f. = 1 2  2
d.f .  n  1

d.f. = 5 d.f. = 10

64
Properties of Chi-Square Distribution

 All values of  2 are non-negative, and the


distribution is not symmetric

 There is a different distribution for each number


of degrees of freedom

 The critical values are found in table using n – 1


degrees of freedom.

65
Properties of Chi-Square
Distribution - cont
Properties of the Chi-Square Chi-Square Distribution for 10
Distribution and 20 df

Different distribution for each


number of df.
66
Thank You!

You might also like