0% found this document useful (0 votes)
24 views25 pages

Module 7. Hypothesis Testing

Module 7 focuses on hypothesis testing, a statistical method used to evaluate competing claims about population parameters based on sample data. It covers key concepts such as null and alternative hypotheses, types of errors, significance levels, and various statistical tests including Z-tests, t-tests, and chi-square tests. The module also provides examples and outlines the steps involved in conducting hypothesis tests.

Uploaded by

mictahijackjack
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)
24 views25 pages

Module 7. Hypothesis Testing

Module 7 focuses on hypothesis testing, a statistical method used to evaluate competing claims about population parameters based on sample data. It covers key concepts such as null and alternative hypotheses, types of errors, significance levels, and various statistical tests including Z-tests, t-tests, and chi-square tests. The module also provides examples and outlines the steps involved in conducting hypothesis tests.

Uploaded by

mictahijackjack
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

Module 7.

Hypothesis
Testing

©2017 Batangas State University


1
Introduction
In the previous chapters, how a parameter of a population can be estimated
from sample data using a point estimate or confidence interval was discussed. In
many situations there are two competing claims about the value of a parameter,
and whichever claim is correct must be determined. This can be done by
statistical inference. Inferential statistics is the other branch of statistics which
deals with the estimates of population values called parameters and to make
statements about computed statistics acceptable to some degree of confidence.
Statistical inference is the method concerned with making estimates of population
value. This method called hypothesis testing is a help in determining how
accurate the generalizations are. This chapter focuses on the basic principles of
hypothesis testing of means, variance and proportion involving a single sample
and two sample data.

©2017 Batangas State University


Learning Objectives

At the end of this module, it is expected that the students


will be able to:
1. Test hypotheses on the mean of a normal distribution
using either a Z-test or a t-test.
2. Test hypotheses on the variance or standard deviation of
a normal distribution.
3. Test hypotheses on a population proportion.
4. Use the P-value approach for making decisions in
hypothesis tests.

©2017 Batangas State University


Hypothesis Testing

Hypothesis testing is a decision-making process for evaluating the claims


about a population. The goal of this process is to make judgment about
the difference between the sample statistics and a hypothesized
population parameter. In this process, the researcher must define the
population under study, state the hypothesis to be investigated, give the
significance level, select a sample, collect data, perform the required test
and reach a conclusion. The z test and t test are statistical tests for
hypothesis testing on means while chi-square test is used for testing the
standard deviation.

©2017 Batangas State University


Hypothesis Testing

Null and Alternative Hypothesis


The null hypothesis, denoted as Ho is the statement of equality
indicating no existence of relationship between the variables under study.
This statement is tested for the purpose of being accepted or rejected.

The alternative hypothesis, denoted as H1 is also termed as research


hypothesis. It is a statement of the expectation derived from the theory
under the study.

©2017 Batangas State University


Hypothesis Testing
Type I and Type II Error
In hypothesis testing, there are four possible outcomes.

Type I Error
• Occurs when one rejects null hypothesis when it is true.
• Represented by Symbol alpha (α).
Type II Error
• Occurs when one rejects the null hypothesis when it is false.
• Represented by Symbol beta (β).
©2017 Batangas State University
Hypothesis Testing

Significance Level and Confidence Interval


The level of significance is the maximum probability of committing a
type I error. That is, P (type I error) = α. Generally, statisticians agree on
using three arbitrary significance levels: 0.10, 0.05 and 0.01 level. That
is, if the null hypothesis is rejected, the probability of a type I error will
be 10%, 5% or 1% and the probability of correct decision will be 90%,
95% or 99%, depending on which level of significance is used. The
values of correct decision is the confidence interval which represents the
chance of accepting the null hypothesis when in fact it is true.

©2017 Batangas State University


Hypothesis Testing
Critical Region
• Set of all values of the statistics that would cause a rejection of the null
hypothesis

Critical Value
• Any value that separates the critical region from the values of the
statistic that do not lead to a rejection of the null hypothesis.

©2017 Batangas State University


Hypothesis Testing
One-sided and Two-sided Hypothesis
In order to state the hypothesis correctly, the researcher must translate
correctly the claim into mathematical symbols. There are three possible
sets of statistical hypotheses.

©2017 Batangas State University


Hypothesis Testing
P-values
The p-value measures the “extremeness” of the sample.
Definition: The p-value is the probability we would get the sample we have or
something more extreme if the null hypothesis were true.
This probability is calculated assuming that the null hypothesis is true. The p-value is
between 0 and 1.
If P-value < α, reject Ho
If P-value > α, do not reject Ho
• Getting value of P:

©2017 Batangas State University


Hypothesis Testing
Steps in Testing Hypothesis
1. State the Ho and the H1
2. Choose the appropriate statistical test
3. Specify the level of significance to be used.
4. Compute the test statistic and determine the critical test value.
5. Make the decision. REJECT the Ho if calculated value is greater than
the critical value, otherwise do not reject the hypothesis.

If CALCULATED > CRITICAL, reject Ho


If CALCULATED < CRITICAL, do not reject Ho

©2017 Batangas State University


Test on the Mean of a Normal Distribution Variance
Known
One Sample Mean Test
• Z-test – If σ known, or in absence of the σ, the sample is relatively
large (n≥30):
𝑥ҧ − 𝜇0
𝑧= 𝜎
𝑛

• T-test – If σ unknown, the sample is relatively large (n<30):


𝑥ҧ − 𝜇0
𝑡= 𝑠
𝑛

df = n - 1
©2017 Batangas State University
Hypothesis Testing
Example 1. A random sample of 100 students enrolled in Statistics course under
Professor X shows that the average grade in the midterm examination is 85%.
Professor X claims that the average grade of the students in the midterm is at least
80% with a standard deviation of 16%. Is there an evidence to say that the claim is
correct at 5% level of significance?
N=100, z-test
a = 0.05 Zcalc = (85-80)/16/sqrt.100 = 3.125
Std. dev. = 16
X-bar = 85
DECISION: since Zcalc > Zcrit, reject Ho, claim
Ho: µ = 80 of professor is true.
H1: µ > 80, right tailed test
Using P-value:
Zcrit = 1.65 P-value: 1-0.991 = 0.009
©2017 Batangas State University P-value < a, reject Ho
Hypothesis Testing
Example 2. It is claimed that the calorie of a certain brand of powder milk exceeds
99.2 per bag. A sample of 10 bags has a mean calorie contents of 102 and a standard
deviation of 17.5. at an α=0.025, determine whether or not the claim is true.
N=10, t-test df=10-1 = 9
X-bar =102 Tcalc = (102-99.2)/17.5/srt.10 = 0.51
Std dev = 17.5
a = 0.025 DECISION: since Tcalc < Tcrit, do not reject Ho

Ho: µ = 99.2
H1: µ > 99.2 , right tailed test Using P-value:
P-value = 1 – 0.6950 = 0.305
Tcrit = 2.262 P value > a, do not reject Ho.

©2017 Batangas State University


Hypothesis Testing
Example 3. The College of Engineering of a State University gives an entrance exam to incoming
freshmen. Those who got scores equal or higher than the set passing are accepted in the College. The
average score of the incoming freshmen was 80% before the implementation of K to 12 education
system. Due to this implementation, the entrance exam was suspended for two years and it is thought
that the quality of the first year students had diminished. However, with the vision, mission, goals and
objectives of the University and the College towards quality education, the Dean wants to determine if
the quality of freshmen students has changed. He wants to know if it has improved or diminished so a
small random sample of 15 freshmen students and administers the same entrance exam. The average
score is found to be 83% with a standard deviation of 5%. Determine whether the quality has changed
using 1% level of significance.

©2017 Batangas State University


Test on the Mean of a Normal Distribution Variance
Known
• Chi-square distribution – used to test variance and standard
deviation
2 𝑛−1 𝑠2
𝑥 =
σ2

• Test statistic for proportions


𝑝 −𝑃 𝑝 −𝑃
𝑧= =
𝜎𝑝 𝑃𝑄
𝑛

©2017 Batangas State University


Hypothesis Testing
Example 1. An exporter of prawn claims that 90% of the harvest meets the
specifications. In a sample of 320 prawns, only 280 meets the specifications. At 99%
CL, determine the legitimacy of the exporter’s claim.

p = 280/320 = 0.875 Zcalc = (0.875-0.90)/sqrt.((0.90)(0.10)/320))


P = 0.90 Zcalc = -1.49
Q = 0.10
N = 320
Decision: -2.58 < 1.49 < 2.58, do not reject Ho
a = 0.01

Ho: P = 90%
H1: P ≠ 90%, two-tailed test

Z-crit = +-2.58
©2017 Batangas State University
Hypothesis Testing
Example 2. A company claims that the variance of the sugar content of its ice cream
is equal to 25 mg/oz. A sample of 20 servings is selected, and the sugar contents is
measured. The variance of the sample is found to be 36. At 10% level of significance,
is there enough evidence to reject the claim?

S2 = 36 X2= (20-1)(36)/25 = 27.36


N = 20 DECISION: 10.117 < 27.36 < 30.144, do not reject Ho.
a = 0.10
Df = 20-1 = 19
σ2 = 25

Ho: σ2 = 25
H1: σ2 ≠ 25, two-tailed test
Lower = 10.117
Upper = 30.144
©2017 Batangas State University
Hypothesis Testing
Two Sample Mean Test
• Comparison of Means of two large samples when standard deviations are known:
𝑥ҧ1 − 𝑥ҧ2 − (𝜇1 − 𝜇2 )
𝑧=
𝜎1 2 𝜎2 2
+
𝑛1 𝑛2

• Comparison of Means of two small samples when standard deviations are unknown:
𝑥ҧ1 −𝑥ҧ2 −(𝜇1 −𝜇2 ) 𝑛1 −1 𝑠1 2 + (𝑛2 −1)𝑠2 2
If 𝜎1 = 𝜎2 𝑡= where SP =
𝑆𝑃
1
+
1 𝑛1 +𝑛2 −2
𝑛1 𝑛2

• Comparison of Means of two small samples when standard deviations are unknown:
𝑥ҧ1 −𝑥ҧ2 −(𝜇1 −𝜇2 )
If 𝜎1 ≠ 𝜎2 𝑡= df = 𝑛1 + 𝑛2 − 2
𝑠1 2 𝑠2 2
+
𝑛1 𝑛2

©2017 Batangas State University


Hypothesis Testing
Example 1. The Bureau of Agricultural Research is studying two varieties of high yielding corn.
Based on past studies, the difference in yield is significant. To know if there is really significant
difference, the Director of the Bureau decided to conduct an experiment. Forty hectares of the first
variety and thirty hectares of the second variety are planted and are grown in the same laboratory
conditions. After harvesting, yield are 250 sacks for 1st variety with a standard deviation of 20 sacks
and 240 for the 2nd variety with a standard deviation of 15 sacks. Is there a significant difference in the
yield of the two varieties of corn? Use 1% level of significance.

N1=40, n2=30 250 −240 −(0)


X1=250, x1=240 Zcalc = = 2.39
202 152
S1=20, s2=15 40
+ 30
a=0.1

Ho: µ1 = µ2 Decision: -2.58 < 2.39 < 2.58, do not reject Ho.
H1: µ1 ≠ µ2, two tailed-test
Using P-value:
Zcrit = 2.58 P = 2(1-0.9916) = 0.0168, do not reject Ho.
©2017 Batangas State University
Hypothesis Testing
Example 2. An experiment was performed to compare the hardness of two different materials. Twelve
pieces of material A were tested by exposing each piece to a Brinell Hardness Tester. Ten pieces of
material B were also tested in the same machine. In each case the harness was determined and recorded.
The samples of material A gave an average hardness of 85 with a sample standard deviation of 4, while
the samples of material B gave an average of 81 and standard deviation of 5. Will we agree at 5% level
of significance that the hardness of material A exceeds that of material B by more than 2 BHN?

N1 = 12, n2= 10 85−81 −(2)


s1=4, s2=5 Tcalc = = 1.02
42 52
X1=85, x2=81 +
12 10
a=0.05
Df=12+10-2 =20
DECISION: Tcalc < Tcrit, do not reject Ho.
Ho: µ1 - µ2 = 2
Using P-value:
H1: µ1 - µ2 > 2 , right tailed test
P=1-0.8506 = 015, do not reject Ho.
Tcrit = 1.725
©2017 Batangas State University
Hypothesis Testing
• Inference on the Variance of Two Normal Distributions
Now, consider the problem of testing the equality of the variances 𝜎1 2 = 𝜎2 2 of two populations. For
independent random samples of size n1 and n2, respectively, from the two populations, the f-value for
testing 𝜎1 2 = 𝜎2 2 is the ratio
𝑠1 2
𝑓= 2
𝑠2

Where:
1
𝑓𝑐𝑟𝑖𝑡𝑖𝑐𝑎𝑙 =
𝑓𝛼 (𝑣1 , 𝑣2 )
𝑣1 & 𝑣2 = 𝑛 − 1

©2017 Batangas State University


Hypothesis Testing
Example 1. In testing for the difference in the hardness of the two materials in the previous example,
the variances of the two unknown population are assumed to be equal. Is this assumption justified? Use
a 0.10 level of significance.

S1 =4, s2=5
A=0.10

Ho: σ1^2 = σ2^2


Ho: σ1^2 ≠ σ2^2

Fcalc = 4^2/5^2 = 0.64

Fcrit = 1/Fa(v1,v2) = ½.90 =0.34


Fcrit = (3.14+3.07)/2 = 3.11

DECISION: 0.34 < 0.80 < 3.11, do not reject Ho.

©2017 Batangas State University


Hypothesis Testing
Testing the difference of two proportions
• If population proportions are known:
𝑝1 − 𝑝2
𝑧=
𝑃1 𝑄1 𝑃2 𝑄2
+
𝑛1 𝑛2
Where:
p1&p2 = sample proportions
P1&P2 = population proportions
Q1&Q2 = 1-P

• If population proportions are unknown:


𝑝1 − 𝑝2 𝑛1 𝑝1 + 𝑛2 𝑝2
𝑧= 𝑝Ƹ =
1 1 𝑛1 + 𝑛2
𝑝Ƹ 𝑞(
ො + )
𝑛1 𝑛2

©2017 Batangas State University


Hypothesis Testing
Example 1. An examination was administered to two groups of students. In group A, 10 out of 50
failed while in group B, there were 15 out of 60 students who failed. Is there a difference in the
performance of the two groups of students at 0.01 significance level.

p1=10/50 = 0.20
p2=15/60 = 0.25 50 0.20 +60(0.25)
N1=50, N2=60
p-hut = = 0.23
50+60
a=0.01

Ho: P1 = P2 Decision: -2.58 < -0.62 < 2.58, do not


H1: P1 ≠ P2, two-tailed test
reject Ho.
Zcrit = 2.58

0.20 −0.25
Zcalc =
1 1
= −0.62
0.23(0.77)( + )
50 60
©2017 Batangas State University

You might also like