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

8. Hypothesis Testing (1)

The document outlines the objectives and processes of hypothesis testing in statistics, including definitions of null and alternative hypotheses, and the types of errors that can occur. It details the steps for conducting hypothesis tests, the significance levels, and decision-making criteria based on test statistics and p-values. Additionally, it provides examples to illustrate the application of hypothesis testing in real-world scenarios.

Uploaded by

michot felegu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

8. Hypothesis Testing (1)

The document outlines the objectives and processes of hypothesis testing in statistics, including definitions of null and alternative hypotheses, and the types of errors that can occur. It details the steps for conducting hypothesis tests, the significance levels, and decision-making criteria based on test statistics and p-values. Additionally, it provides examples to illustrate the application of hypothesis testing in real-world scenarios.

Uploaded by

michot felegu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 62

Hypothesis Testing (HT)

By:Samrawit .F
Objectives
At this end of this session students are able to:

• Define what hypothesis testing is.

o Explain hypothesis testing process

o Explain the distinction between null and alternative hypothesis.

o Explain the distinction between type I and type II error.

o Test population mean and mean difference

o Test population proportion and proportion difference

School of Public Health


2
Hypothesis Testing
• In statistics, a hypothesis is a claim or statement about a property
of a population.

• A hypothesis test (or test of significance) is a standard procedure


for testing a claim about a property of a population.

• If, under a given assumption, the probability of a particular


observed event is exceptionally small, we conclude that the
assumption is probably not correct.

School of Public Health


3
Hypothesis testing
• Hypothesis testing is used to infer the result of a hypothesis
performed on sample data from a larger population.
• The test tells the analyst whether or not his primary hypothesis is
true.
• Statistical analysts test a hypothesis by measuring and examining
a random sample of the population being analyzed.
– Is the difference between X1 and X2 statistically significant for
us to reject the hypothesis that their corresponding u1 and u2
are the same?
�0 : male = female Vs. �1 : male ≠ female

School of Public Health 20 November 2019


What is Hypothesis?
• It is a statement about one or more populations.

• It is usually concerned with the parameters of the population.

– e.g. the hospital administrator may want to test the hypothesis

that the average length of stay of patients admitted to the

hospital is 5 days

Sch2o0oNloovefmbPeru2b0l1i9c Health 5
Idea of Hypothesis Testing

School of Public Health 11/20/2016


9
Statistical Hypotheses
 They are hypotheses that are stated in such a way that they may be
evaluated by appropriate statistical techniques.
 There are two hypotheses involved in hypothesis testing
 Null hypothesis
⚫ is the hypothesis to be tested.
⚫ is what we assume is true until proven
⚫ is always about a population parameter, not about a sample statistic

It claims that there is no difference between the hypothesized


value and the population value.
(The effect of interest is zero = no difference)
 May or may not be rejected

Sch2o0oNloovefmbPeru2b0l1i9c Health 7
Statistical hypotheses
 Alternative hypothesis

 HA : It is a statement of what we believe is true if our


sample data cause us to reject the null hypothesis

o Is a statement that disagrees (opposes) with Ho

(The effect of interest is not zero)

o Never contains “=” , “ ≤” or “≥ ” sign

 May or may not be accepted

School of Public Health 8


Summary of Forms for Null and Alternative Hypotheses
about a Population Mean

 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).

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

One-tailed One-tailed Two-tailed


(lower-tail) (upper-tail)

School of Public Health 9


Example: Identify the Null and Alternative Hypothesis.
use the given claims to express the corresponding null
and alternative hypotheses in symbolic form.
a) The proportion of drivers who admit to running red lights is
greater than 0.5.
��:P ≤ 0.5
��: P > 0.5
b) The mean height of professional basketball players is at most 7 ft.
�� : � ≤ 7
�� : � > 7
c) The standard deviation of IQ scores of actors is equal to 15.
��: � = 15
��: � ≠ 15

School of Public Health


Type I and Type II Error
Your Statistical True state of null hypothesis (Reality)
Decision (Action
/Conclusion)
H0 True H0 False
(example: the drug doesn’t work) (example: the drug works)

Reject H0
(ex: you conclude that the drug works) Type I error (α) Correct action
(Prob. = Power = 1-β)
Do not reject H0
(ex: you conclude that there is
insufficient evidence that the drug Correct action (Prob. Type II Error (β)
works)
= 1-α)

School of Public Health 11


The decision rule (significance level) = 
• The confidence with which a null hypothesis is rejected or not.
• It is not always possible to make a correct decision since we are dealing
with random samples.
• Two possible errors can be made in any types of hypothesis testing.
– Type I error(α): is made when HO is true but rejected.
– Convicting an innocent person
– Type II error(β): made when HO is false but we fail to reject
– Failing to convict a guilty person

School of Public Health 12


Hypothesis Testing Process

School of Public Health 13


Testing a hypothesis about the mean of a population:

 We have the following steps:

1. Data: determine variable, sample size (n), sample mean( X ),


population standard deviation or sample standard deviation (s) if it
is unknown
2. Assumptions : We have two cases:
 Case1: Population is normally or approximately normally
distributed with known or unknown variance (sample size n may
be small or large),
 Case 2: Population is not normal with known or unknown variance
(n is large i.e. n≥30).
School of Public Health 14
HT…
3. Hypotheses:

 we have three cases

 Case I : H0: μ=μ0

HA: μ μ0
⚫ e.g. we want to test that the population mean is different than 50
 Case II : H0: μ = μ0

HA: μ > μ0
⚫ e.g. we want to test that the population mean is greater than 50
 Case III : H0: μ = μ0
HA: μ< μ0
⚫ e.g. we want to test that the population mean is less than 50

School of Public Health 15


Test Statistic - Formulas
z=p– p 

Test statistic for


 pq
n
proportions

x - µ0
z= Test statistic for mean

n
Test statistic for
(n – 1)s2
2 = standard deviation

Copyright © 2007 Pearson
Education, Inc Publishing
School of Public Health as Pearson Addison-
HT…
4. Test Statistic
• There are many test Statistic techniques from which three
commonly used tests are
• Z- test
• Student –t- test
• Chi-square test
• Proper test is crucial, the choice is depend on
– The type of data
– The size of the sample (large or small)
– Whether the samples are independent or related.
– Population characteristics ( distribution, unknown standard deviation)
Example,
- Z-test is used when large sample (>30), normally distributed
data, known  - If sample is small (<30) with
unknown  t-test will be more suitable.
- Chi-square test is used for categorical data
School of Public Health 17
HT…
Case 1: population is normal or approximately normal

σ2 is known σ2 is unknown
( n large or small)
X -  o
Z 

n n large n Small X - o
T 
X -o s
Z  n
s
n
Case 2: If population is not normally distributed and n is large
i)If σ2 is known ii) If σ2 is unknown
X -  X -
Z  o
Z 
  so
n n

School of Public Health 18


HT…
5.Decision Rule:
i) If HA: μ  μ0
 Reject H0 if Z >Z1-α/2 or Z< - Z1-α/2
(when use Z - test)
Or Reject H0 if T >t1-α/2,n-1 or T< - t1-α/2,n-1
(when use T- test)
ii) If HA: μ> μ0
 Reject H0 if Z>Z1-α (when use Z - test)
Or Reject H0 if T>t1-α,n-1 (when use T - test)

School of Public Health 19


HT…
iii) If HA: μ< μ0
Reject H0 if Z< - Z1-α (when use Z - test)
 Or
Reject H0 if T<- t1-α,n-1 (when use T - test)
Note:
Z1-α/2, Z1-α , Zα are tabulated values obtained from table D
t1-α/2 , t1-α , tα are tabulated values obtained from table E
with (n-1) degree of freedom (df)

School of Public Health 20


HT…
6.Decisio
n:
• If we reject H0, we can conclude that HA is true.
• If, however, we do not reject H0, we may conclude that
H0 is true.

School of Public Health 21


An Alternative Decision Rule using the P - value
• The P-value (or p-value or probability value) is the probability of
getting a value of the test statistic that is at least as extreme as the
one representing the sample data, assuming that the null hypothesis
is true..
• The p-value is defined as the smallest value of α for which the null
hypothesis can be rejected.

• If the p-value is less than or equal to α, we reject the null


hypothesis (p ≤ α)
• If the p-value is greater than α, we do not reject the null
hypothesis (p > α)

Sch2o0oNloovefmbPeru2b0l1i9c Health 22
Conclusions in Hypothesis
Testing
We always test the null hypothesis. The initial
conclusion will always be one of the following:

1. Reject the null hypothesis.

2. Fail to reject the null hypothesis.

Copyright © 2007 Pearson Education, Inc Publishing as


School of Public Health Pearson Addison-Wesley.
Decision Criterion

1) Traditional method (test statistic method):


• Reject H0 if the test statistic falls within the
critical region.
• Fail to reject H0 if the test statistic does not fall
within the critical region.

Copyright © 2007 Pearson Education, Inc Publishing


School of Public Health as Pearson Addison-Wesley.
Decision Criterion…
2) P-value Method:

Reject H0 if the P-value   (where  is the

significance level, such as 0.05).

Fail to reject H0 if the P-value > .

School of Public Health Copyright © 2007 Pearson Education, Inc


Publishing as Pearson Addison-Wesley.
Decision Criterion…
3) Confidence Intervals:
Because a confidence interval estimate of a population
parameter contains the likely values of that parameter,
reject a claim that the population parameter has a value
that is not included in the confidence interval.

School of Public Health Copyright © 2007 Pearson Education, Inc


Publishing as Pearson Addison-Wesley.
Procedure for Finding P-Values

Copyright © 2007 Pearson Education, Inc


School of Public Health Publishing as Pearson Addison-Wesley.
Example
• Researchers are interested in the mean age of a certain
population.
• A random sample of 10 individuals drawn from the
population of interest has a mean of 27.
• Assuming that the population is approximately
normally distributed with variance 20, can we conclude
that the mean is different from 30 years? (α=0.05) .
• If the p - value is 0.0340 how can we use it in making a
decision?

28
Solution
1-Data: variable is age, n=10, x = 27, σ2=20,
α=0.05
2 Assumptions: the population is approximately
normally distributed with variance 20
3 Hypotheses:
• H0 : μ=30
• HA: μ ≠ 30

School of Public Health 29


HT…
4-Test Statistic:
• Z = -2.12
5. Decision Rule
• The alternative hypothesis is
• HA: μ ≠ 30
• Hence we reject H0 if Z >Z1-0.05/2= Z0.975
• or Z< - Z1-0.05/2= - Z0.975
• Z0.975=1.96(from table D)

School of Public Health 30


HT…
6. Decision:
 We reject H0, since -2.12 is in the rejection region .
7. Conclusion
 We can conclude that μ is not equal to 30
 Using the p value, we note that p-value = 2* P(z<-2.12)=2*0.0170= 0.0340<
0.05,therefore we reject H0, →μ is not equal to 30
 using confidence interval (fail to reject the Ho if the hypothesized vale lies in
between the LL and the UL of the specified confidence interval.
 95% CI for μ

20
x * �
± �1−�/2 � = 27±1.96* 10 = [24.23, 29.77]
Since μ0 is out side the interval and concluded that we are 95% confident that μ is
different from 30

School of Public Health 31


Referring to example above. Suppose that the researchers
have asked: Can we conclude that μ<30.
1. Data.see previous example
2. Assumptions .see previous example
3. Hypotheses:
• H0 μ =30
• HA: μ < 30

32
HT…
4.Test Statistic :
Z  X - 27  30
•   =
o
20
= -2.12
n
10

5. Decision Rule: Reject H0 if Z< Z α, where


• Z α= -1.645. (from table D)
6. Decision: Reject H0 ,thus we can conclude
that the population mean is smaller than 30.
using P-value: P-value = P(Z<z)= P(Z<-2.12)
= 0.0170 <0.05→ Reject Ho and thus,
Concluding that μ is less than 30.

School of Public Health


33
Example 2
• Among 157 African-American men, the mean systolic
blood pressure was 146 mm Hg with a standard
deviation of 27. We wish to know if on the basis of
these data, we may conclude that the mean systolic
blood pressure for a population of African-American is
greater than 140. Use α=0.01.

Sch2o0oNloovefmbPeru2b0l1i9c Health 34
Solution
1. Data: Variable is systolic blood pressure, n=157,
x =146, s=27, α=0.01.
2. Assumption: population is not normal, σ2 is
unknown
3. Hypotheses: H0 :μ=140
HA: μ>140
4. Test Statistic:
Z  X - 146  140
•  o s = 2 7 = 2.78
n 157

35
Cont’d
5. Decision Rule:
we reject H0 if Z>Z1-α
= Z0.99= 2.33
(from table D)
6. Decision: We reject H0.
Hence we may conclude that the mean systolic blood pressure for a
population of African-American is greater than 140.
• UL for μ = 146+2.33 27 = 151.02
*
157
• Therefore: we concluded the mean systolic blood pressure of
African-American is greater than 140 mmHg

School of Public Health 36


Example 3
• A sample of 25 freshman nursing students made a mean score of
77 on a test designed to measure attitude toward the dying
patient. The sample standard deviation was 10. Do these data
provide sufficient evidence to indicate, at the .05 level of
significance, that the population mean is less than 80? Suppose
population is approximately normally distributed.
Solution
1. Data: Variable is attitude to patient dying, n= 25,
x  77
s=10, α=0.05, �0 = 80.
2. Assumptions: population is normal, σ2 is unknown and sample size
(n=10 <30) → small

School of Public Health 37


Solution…
3. Hypothesis: H0 :μ=80 Vs. HA: μ<80

4. Test statistic:t X - o 7 7 - 8 0
    1 . 5 0
s 1 0
n 2 5

5. Decision Rule : fail to reject H0 , if t- calculated is >= -t-tabulated


(�(24) (0.05 ) → -1.50>-1.711

6. Decision and Conclusion: Fail to reject Ho


We are 95% confident that the population mean score is equal to
the hypothesized population mean score (80).

School of Public Health 38


Hypothesis Testing: The
Difference between Two
Population Means

School of Public Health 39


School of Public Health 40
School of Public Health 41
School of Public Health 42
School of Public Health 43
School of Public Health 44
EXAMPLE
Dernellis and Panaretou (A-7) examined subjects with hypertension and
healthy control subjects. One of the variables of interest was the aortic
stiffness index. Measures of this variable were calculated from the aortic
diameter evaluated by M-mode echocardiography and blood pressure
measured by a sphygmomanometer. Generally, physicians wish to reduce
aortic stiffness. In the 15 patients with hypertension (group 1), the mean aortic
stiffness index was 19.16 with a standard deviation of 5.29. In the 30 control
subjects (group 2), the mean aortic stiffness index was 9.53 with a standard
deviation of 2.69. We wish to determine if the two populations represented by
these samples differ with respect to mean aortic stiffness index.

School of Public Health 45


School of Public Health 46
School of Public Health 47
School of Public Health 48
Paired comparisons
• A method frequently employed for assessing the effectiveness of a treatment or
experimental procedure is one that makes use of related observations resulting from
dependent samples. A hypothesis test based on this type of data is known as a paired
comparisons test.

• Reasons for Pairing: It frequently happens that true differences do not exist
between two populations with respect to the variable of interest, but the presence of
extraneous sources of variation may cause rejection of the null hypothesis of no
difference. On the other hand, true differences also may be masked by the presence of
extraneous factors.

• The objective in paired comparisons tests is to eliminate a maximum number of


sources of extraneous variation by making the pairs similar with respect to as many
variables as possible.

School of Public Health 49


Paired comparisons

School of Public Health 50


School of Public Health 51
School of Public Health 52
School of Public Health 53
School of Public Health 54
Hypothesis Testing: A single population
proportion
• Testing hypothesis about population proportion (P) is
carried out in much the same way as for mean when
condition is necessary for using normal curve are
met
• We have the following steps:
1.Data: sample size (n), sample proportion( p̂), P0
no.of element in thesample with some charachtaristic a
p̂   n
Total no.of element in thesample

2. Assumptions: normal distribution ,

School of Public Health 55


HT…
3. Hypotheses:
 we have three cases
 Case I : H0: P = P0
HA: P ≠ P0
 Case II : H0: P = P0
HA: P > P0
 Case III : H0: P = P0
HA: P < P0 Z 
pˆ 
p 0p 0
4.Test Statistic: q 0n
Where H0 is true, is distributed approximately as the
standard normal
School of Public Health 56
HT…
5. Decision Rule:
i) If HA: P ≠ P0
• Reject H 0 if Z >Z1-α/2 or Z< - Z1-α/2
ii) If HA: P> P0
• Reject H0 if Z>Z1-α
iii) If HA: P< P0
• Reject H0 if Z< - Z1-α
Note: Z1-α/2 , Z1-α , Zα are tabulated values obtained from
table D
6. Conclusion: reject or fail to reject H0

School of Public Health 57


Example
Wagen collected data on a sample of 301 Hispanic women
Living in Texas. One variable of interest was the percentage
of subjects with impaired fasting glucose (IFG). In the
study, 24 women were classified in the (IFG) stage. The
article cites population estimates for (IFG) among Hispanic
women in Texas as 6.3 percent. Is there sufficient
evidence to indicate that the population Hispanic women
in Texas has a prevalence of IFG higher than 6.3 percent,
let α=0.05
Solution:
1.Data: n = 301, p0 = 6.3/100=0.063, a=24,
q0 =1- p0 = 1- 0.063 =0.937, α=0.05
School of Public Health 58
Solution…
2. Assumptions : p̂ is approximately normally distributed
3. Hypotheses:
• H0: P = 0.063
HA: P > 0.063
4.Test Statistic : Z 
p̂  p 0  0.08  0.063 
1.21
p0 q0 0.063(0.937)
n 301

5.Decision Rule: Reject H0 if Z>Z1-α


Where Z1-α = Z1-0.05 =Z0.95= 1.645

School of Public Health 59


HT…
6. Conclusion: Fail to reject H0
Since
Z =1.21 < Z1-α=1.645
Or ,
If P-value = 0.1131,
fail to reject H0 → P > α

School of Public Health 60


Hypothesis Testing: The
Difference between Two
Population Proportions

School of Public Health 61


62

You might also like