Hypothesis Testing - II
Anitha G (BMAT202L)
Module 6
April 11, 2025
Anitha G (BMAT202L) Hypothesis Testing - II
Content
Small sample tests- Student’s t-test, F-test- chi-square test-
goodness of fit - independence of attributes- Design of
Experiments - Analysis of variance – One way-Two way-Three way
classifications - CRD-RBD- LSD.
Anitha G (BMAT202L) Hypothesis Testing - II
Comparison of t-Tests
Type Purpose Example
One-Sample Compare the mean of Testing if the average
a sample to a known weight of apples from
population mean a farm is 200g
Independent Compare the means Comparing exam
of two separate scores of two differ-
groups ent classes
Paired Compare the means Checking if students’
of the same group test scores improved
before and after an after a training pro-
event gram
Anitha G (BMAT202L) Hypothesis Testing - II
t-distribution Table
Anitha G (BMAT202L) Hypothesis Testing - II
Based on single sample
Q1
The mean weekly sales of soap bars in departmental stores was
146.3 bars per store. After an advertising campaign, the mean
weekly sales in 22 stores for a typical week increased to 153.7, with
a standard deviation of 17.2. Was the advertising campaign
successful?
Ans:
Null Hypothesis (H0 ): The advertising campaign had no effect.
H0 : µ = 146.3
Alternative Hypothesis (H1 ): The advertising campaign increased
sales.
H1 : µ > 146.3
Anitha G (BMAT202L) Hypothesis Testing - II
Based on single sample
Step 2: Compute the t-Statistic
The t-statistic is given by:
x̄ − µ
t= √
s/ n − 1
Substituting values:
153.7 − 146.3
t= √
17.2/ 21
Step 3: Conclusion
Tabulated value of t for 21 degrees of freedom at a 5% level of
significance (for a one-tailed test) is 1.72.
Since the calculated t-value is much greater than the tabulated
value, it is highly significant.
Anitha G (BMAT202L) Hypothesis Testing - II
Based on single sample
Hence, we reject the null hypothesis and conclude that the
advertising campaign was definitely successful in promoting
sales.
Anitha G (BMAT202L) Hypothesis Testing - II
Q2
Q2
A random sample of 10 boys had the following I.Q. scores:
70, 120, 110, 101, 88, 83, 95, 98, 107, 100
Do these data support the assumption of a population mean I.Q.
of 100? Find a reasonable range in which most of the mean I.Q.
values of samples of 10 boys lie.
Anitha G (BMAT202L) Hypothesis Testing - II
Independent test
The test marks obtained by a group of 9 regular course students
and another group of 11 part time course students in a test are
given below :
Regular 56 62 63 54 60 51 67 69 58
Part-time 62 70 71 62 60 56 75 64 72 68 66
Examine whether the marks obtained by regular students and
part-time students differ significantly at 5% level.
Hint: X̄ = 60; Ȳ = 66; s12 = 280 2 334
9 , s2 = 11 , S = 5.84
test stat: t = −2.28; table value= 2.101 at 5% level. H0 is
rejected.
Anitha G (BMAT202L) Hypothesis Testing - II
Paired t -test
Q
An IQ test was administered to 5 persons before and after they
were trained. The results are given below:
Candidates A B C D E
before 110 120 123 132 125
after 120 118 125 136 121
Test whether there is any changes in IQ after the training
programme.
Hint:
t = 0.816, df = 4
H0 is accepted at 1% level of significance.
What about 5% LOS?
Anitha G (BMAT202L) Hypothesis Testing - II
F-test: Procedure
H0 : σ12 = σ22 (Population variances are equal)
H1 : σ12 ̸= σ22 (Population variances are different)
Sample variance is determined by:
n1 2
S12 = s
n1 − 1 1
n2 2
S22 = s
n2 − 1 2
The F-statistic is computed as:
Larger Sample Variance
F =
Smaller Sample Variance
Specifically:
S12
F = if S12 > S22 ; df = (n1 − 1, n2 − 1)
S22
Anitha G (BMAT202L) Hypothesis Testing - II
F-test: Procedure
S22
F = if S12 < S22 ; df = (n2 − 1, n1 − 1)
S12
Comparison rules:
If Fcalculated > Fcritical : Reject H0
If Fcalculated ≤ Fcritical : Fail to reject H0
Anitha G (BMAT202L) Hypothesis Testing - II
F-Table(@ 5% LOS)
Anitha G (BMAT202L) Hypothesis Testing - II
Question1-
From the following data test if the difference between the variances
is significant at 5% level of significance.
Sample A B
Size 8 10
sum of squares of deviations from the mean 84.4 102.6
Hint:
df (7, 9) = 3.29
Anitha G (BMAT202L) Hypothesis Testing - II
Question-2
Values of a variate in two samples are given below:
Sample 1 5 6 8 1 12 4 3 9 6 10
Sample 2 2 3 6 8 1 10 2 8
Test the significance of the difference between the two sample
variances.
Hint:
F = 1.03; df (7, 9) = 5.29
Anitha G (BMAT202L) Hypothesis Testing - II
Chi-Square test
The Chi-Square test is a statistical method used to determine
whether there is a significant difference between observed and
expected frequencies in categorical data. The formula is given by:
X (Oi − Ei )2
χ2 =
Ei
where:
Oi is the observed frequency of category i,
Ei is the expected frequency of category i.
Anitha G (BMAT202L) Hypothesis Testing - II
Q1
A company keeps records of accidents. During a record safety
review, a random sample of 60 accidents was selected and
classified by the day of the week on which they occured.
Day MON TUE WED THU FRI
[Link]. Accidents 8 12 9 14 17
Test whether there is any evidence that accidents are more likely
on some days than others.
Anitha G (BMAT202L) Hypothesis Testing - II
Soln:
H0 : Accidents are equally likely to occur on any day of the week
H1 : Accidents are not equally likely to occur on any day of the week
On the assumption of accidents H0 , the expected number of
accidents on any day 60
5 = 12
χ2 = 4.5, df = 4, Table value = 9.488(@LOS = 5%)
Anitha G (BMAT202L) Hypothesis Testing - II
Q2
In 120 throws of a single die, the following distribution of faces was
observed
faces 1 2 3 4 5 6
frequency 30 25 18 10 22 15
Can you say that the die is biased?
H0 : the die is fair( unbaised)
H1 : the die is biased
Anitha G (BMAT202L) Hypothesis Testing - II
Q3
A company produces a product of four sizes -small,medium,large
and extra large. In the past, the demand for these sizes has been
fairly constant at 20% for small , 45% for medium, 25% for large
and 10% for extra large.
A random sample of 400 recent sales included 66 small, 172
medium, 109 large and 53 extra large.
Test whether there is evidence of significant change in demand for
the different sizes.
Hint : χ2 = 7.841, DF = 3
Anitha G (BMAT202L) Hypothesis Testing - II
Q4
A sample analysis of examination results of 500 students was
performed. It was found that 220 students have failed, 170 have
secured a third class, 90 have secured a second class, and the rest,
a first class. Do these figures support the general belief that the
above categories are in the ratio 4 : 3 : 2 : 1 respectively?
Hint : χ2 = 23.667, DF = 3
Anitha G (BMAT202L) Hypothesis Testing - II
Property: Grouping when frequencies are small
Anitha G (BMAT202L) Hypothesis Testing - II
Test of goodness of fit-Binomial
Four coins are thrown simultaneously, and the number of heads
occurring at each throw was noted. This was repeated 240 times
with the following results.
No. of heads 0 1 2 3 4
[Link] throws 13 64 85 58 20
Fit a Binomial distribution assuming under the hypothesis that the
coins are unbiased.
Anitha G (BMAT202L) Hypothesis Testing - II
Null Hypothesis
H0 : The given data fits the Binomial distribution
i.e., the coins are unbiased.
1
p=q= , n = 4, N = 240
2
Anitha G (BMAT202L) Hypothesis Testing - II
Computation of Expected Frequencies
P(X = x) = x4 p x q 4−x
No. of Heads [Link](X = x)
4
1 0 1 4 1 1
0 0 2 2 = 16 16 × 240 = 15
4 1 1 1 3 4 4
1 1 2 2 = 16 16 × 240 = 60
4 1 2 1 2 6 6
2 2 2 2 = 16 16 × 240 = 90
4 1 3 1 1 4 4
3 3 2 2 = 16 16 × 240 = 60
4 1 4 1 0 1 1
4 4 2 2 = 16 16 × 240 = 15
Total: 240
Anitha G (BMAT202L) Hypothesis Testing - II
Computation of Chi-Square Values
O E (O - E) (O - E)2 (O - E)2 /E
13 15 -2 4 0.27
64 60 4 16 0.27
85 90 -5 25 0.28
58 60 -2 4 0.07
20 15 5 25 1.67
Total: 2.56
Anitha G (BMAT202L) Hypothesis Testing - II
Chi-Square Computation
X (O − E )2
χ2cal = = 2.56
E
Degrees of freedom = 5 − 1 = 4
χ2tab = 9.488 (from chi-square table at 5% significance level)
Anitha G (BMAT202L) Hypothesis Testing - II
Inference
Since χ2cal < χ2tab , we accept our null hypothesis at the 5% level of
significance and conclude that the given data fits a Binomial
distribution.
Anitha G (BMAT202L) Hypothesis Testing - II
G.O.F-Poisson
The following table shows the distribution of goals in a foot ball
[Link] Goals 0 1 2 3 4 5 6 7
[Link] Matches 95 158 108 63 40 9 5 2
Fit a Poisson distribution and test the goodness of fit.
Anitha G (BMAT202L) Hypothesis Testing - II
Answer: Poisson Distribution Goodness of Fit
Null Hypothesis: The given data fits the Poisson distribution.
Level of Significance: α = 0.05
Computation of Expected Frequencies:
812
λ= = 1.7
480
Computation of Expected Frequencies:
(1.7)0
P(0) = e −1.7 = 0.183
0!
f (0) = N · P(0) = 480 × 0.183 = 87.84 = 88(approximately )
Putting x = 0, 1, 2, ..., we obtain the following frequencies:
No. of goals 0 1 2 3 4 5 6 7 Total
Expected frequency 88 149 127 72 30 10 3 1 480
Anitha G (BMAT202L) Hypothesis Testing - II
Continued..
Computation of Statistic:
)2
O E (O − E )2 (O−E
E
95 88 49 0.56
158 150 64 0.43
108 126 324 2.57
63 72 81 1.13
40 30 100 3.33
16 14 4 0.29
Total 8.31
2
P (O−E )2
Test Statistic: χ = E = 8.31
Degrees of Freedom: df = k − 1 − m = 6 − 1 − 1 = 4
k = number of categories (after combining, if any)
m = number of parameters estimated from the data (here, λ)
We subtract 1 because of the total frequency constraint (fixed
total sample size)
Anitha G (BMAT202L) Hypothesis Testing - II
Continued..
Critical Value: χ20.05,4 = 9.488
Decision: Since χ2 = 8.31 < χ20.05,4 = 9.488, we fail to reject the
null hypothesis.
Anitha G (BMAT202L) Hypothesis Testing - II
Test of Independence: Contingency Analysis
A different Chi-square test, the Chi-square test of independence,
can be used to analyse the frequencies of two variables with
multiple categories to determine whether the two variables are
independent. Many times, this type of analysis is desirable.
For example,
A market researcher might want to determine whether the
type of soft drink preferred by a customer is independent of
the consumer’s age.
An organizational behaviourist might want to know whether
absenteeism is independent of job classifications.
Financial investors might want to determine whether the type
of preferred stock investment is independent of the region
where the investor resides.
Whether voters can be classified by gender is independent of
political affiliation.
Anitha G (BMAT202L) Hypothesis Testing - II
Test Procedure
1 Null Hypothesis (H0 ): No relationship exists between two
variables, that is, they are independent.
2 Alternative Hypothesis (H1 ): A relationship exists, that is,
they are related.
3 Level of Significance: Let α and d.f.
4 Calculate the expected frequencies:
Row total × Column total
E=
Grand total
5 Calculate the degree of freedom:
d.f. = (No. of rows−1)×(No. of columns−1) = (r −1)(c −1)
Anitha G (BMAT202L) Hypothesis Testing - II
Test Procedure
6 Calculate the Statistic:
X (Oi − Ei )2
χ2cal =
Ei
7 Inference:
If χ2cal ≤ χ2tab , we accept the null hypothesis.
If χ2cal > χ2tab , we reject the hypothesis.
Anitha G (BMAT202L) Hypothesis Testing - II
Formula for 2 × 2 contingency table
Under the null hypothesis of independence of attributes, the value
of χ2 for the 2 × 2 contingency table is given by:
Category 1 Category 2 Total
Group 1 a b a+b
Group 2 c d c +d
Total a+c b+d N
The chi-square statistic is given by:
N(ad − bc)2
χ2 =
(a + c)(b + d)(a + b)(c + d)
Anitha G (BMAT202L) Hypothesis Testing - II
Q1
1000 students at college level were graded according to their I.Q.
and the economic conditions of their homes. use the the the χ2
test to find out whether there is any association between economic
condition at home and IQ.
Economic Conditions I.Q. Total
High Low
Rich 460 140 600
Poor 240 160 400
Total 700 300 1000
Ans : χ2 = 31.746, df = 3.84, H0 is rejected at 5% level
Anitha G (BMAT202L) Hypothesis Testing - II
Q2
Two hundred randomly selected adults were asked whether TV
shows as a whole are primarily entertaining, educational, or a waste
of time (only one answer could be chosen). The respondents were
categorized by gender. Their responses are given in the following
table:
Gender Opinion Total
Entertaining Educational Waste of Time Total
Female 52 28 30 110
Male 28 12 50 90
Total 80 40 80 200
Is this evidence convincing that there is a relationship between
gender and opinion in the population of interest?(H0 is rejected).
Anitha G (BMAT202L) Hypothesis Testing - II
Q3
Of the 1000 workers in a factory exposed to an epidemic, 700 in all
were attacked, 400 had been inoculated, and of these 200 were
attacked. On the basis of this information, can it be believed that
inoculation and attack are independent?
Anitha G (BMAT202L) Hypothesis Testing - II
DOE & ANOVA
Anitha G (BMAT202L) Hypothesis Testing - II
Design of Experiments vs Analysis of variance
Design of Experiments (DOE):
A structured approach to planning and conducting
experiments efficiently.
Focuses on selecting factors, levels, and experimental runs to
study the effects of variables on an outcome.
Includes methods like factorial designs, randomized block
designs, and response surface methodology.
Anitha G (BMAT202L) Hypothesis Testing - II
Design of Experiments vs Analysis of variance
Analysis of variance(ANOVA):
A statistical technique used to analyze the differences between
means of multiple groups.
Often used in DOE to test whether factor levels significantly
affect the response variable.
Common types include one-way ANOVA, two-way ANOVA,
and repeated measures ANOVA.
Relationship
DOE is the broader framework that involves planning and
conducting experiments, while ANOVA is a statistical tool used to
analyze the data from those experiments. In other words, DOE
generates the data, and ANOVA helps interpret the results.
Anitha G (BMAT202L) Hypothesis Testing - II
Classifications
CRD (Completely Randomized Design): Treatments are
randomly assigned to all experimental units without any
grouping.
RBD (Randomized Block Design): Treatments are assigned
within blocks of similar experimental units to reduce
variability.
LSD (Latin Square Design): Treatments are arranged so each
appears once in every row and column, controlling two
blocking factors.
Anitha G (BMAT202L) Hypothesis Testing - II
Key Understanding
CRD: Objective: Evaluate the effect of a single factor (e.g., study
method) by randomly assigning treatments under
homogeneous conditions.
Experimental Factor: Study Method
Levels: Self-study, Group study, Online tutoring
Treatments: Students receiving one of the three methods
RBD: Objective: Assess the effect of a single factor (e.g., study
method) while controlling for a nuisance factor (e.g., gender)
by grouping similar experimental units into blocks.
Factors: 2 (Study Method, Gender)
Levels: 3 (methods) × 2 (genders)
Treatments: 6 combinations (e.g., Male–Self-study,
Female–Group study, etc.)
Anitha G (BMAT202L) Hypothesis Testing - II
Key Understanding
LSD: Objective: Study the effect of study method while controlling
for two nuisance factors: gender and academic stream
Treatment Factor: Study Method
Levels: 4 (Self-study, Group study, Online, Blended)
Blocking Factors: Gender (rows), Academic Stream
(columns)
Treatments: 4 unique methods arranged in a Latin Square
Experimental Unit: Each student receives one treatment
Anitha G (BMAT202L) Hypothesis Testing - II
Test Procedure (for test statistics) for One-way
classification
I: Find N, the total number of observations.
II: Find T , the total of all observations.
T2
III: Find , the correction factor.
N
IV: Calculate the total sum of squares:
X X X T2
TSS = X12 + X22 + X32 + · · · −
N
V: Calculate the column sum of squares:
( X1 )2 ( X2 )2 ( X3 )2 T2
P P P
SSC = + + + ··· −
n1 n2 n3 N
VI: Find the sum of squares within the class
SSE = TSS − SSC
Anitha G (BMAT202L) Hypothesis Testing - II
Test Procedure (for test statistics) for One-way
classification
VII: Set up ANOVA Table
Source of Variation S.S DF MSS F-Ratio
SSC MSC
Between columns SSC c −1 MSC = F =
c −1 MSE
SSE MSE
Within columns SSE N −c MSE = or F =
N −c MSC
Total SST N −1
Where:
MSS = Mean Sum of Squares
DF =Degrees of freedom
SSC = Sum of Squares between the classes (or sum of squares
of all the classes)
SSE = Sum of Squares within the class (or sum of squares due
to error/residual error)
Anitha G (BMAT202L) Hypothesis Testing - II
Probelm-1
Three processes A,B and C are tested to see whether their outputs
are equivalent. The following observations are made of the outputs.
A B C
10 9 11
12 11 10
13 10 15
11 12 14
10 13 12
14 13
15
13
Perform the analysis of variance and state your conclusion.
Anitha G (BMAT202L) Hypothesis Testing - II
Problem-2
Setup following ANOVA table for the following per hectare yield(in
hundred kgs) for three varieties of wheat
A B C
6 5 5
7 5 4
3 3 3
8 7 4
Test whether there is a significant difference among the average
yields in the 3 varieties of wheat.
Anitha G (BMAT202L) Hypothesis Testing - II
Test statistic part(two way)
Anitha G (BMAT202L) Hypothesis Testing - II
Formula to Calculate TSS/SSC/SST/SSE
i Calculate the Total Sum of Squares:
X X X T2
TSS = X12 + X22 + X32 + · · · −
N
ii Calculate the Row Sum of Squares:
( Y1 )2 ( Y2 )2 ( Y3 )2 T2
P P P
SSR = + + + ··· −
m1 m2 m3 N
iii Calculate the Column Sum of Squares:
( X1 )2 ( X2 )2 ( X3 )2 T2
P P P
SSC = + + + ··· −
n1 n2 n3 N
iv Calculate the Error Sum of Squares:
SSE = TSS − (SSC + SSR)
Anitha G (BMAT202L) Hypothesis Testing - II
Problem-1
To study the performance of three detergents and three different
water temperatures, the following ‘whiteness’ readings were
obtained with specially designed equipment:
Water Temperature Detergent A Detergent B Detergent C
Cold water 57 55 67
Warm water 49 52 68
Hot water 54 46 58
Perform a two-way analysis of variance, using 5 per cent level of
significance.
Anitha G (BMAT202L) Hypothesis Testing - II
Inference:
1 Since calculated value of FC = 9.85 at (2, 4) and α = 0.5 is
greater than its table value Fe = 6.94, the null hypothesis is
rejected. Hence we conclude that there is significant
difference between the performance of the three
detergents.
2 Since calculated value of Fr = 2.38 at (2, 4) and α = 0.5 is
less than its table value Fe = 6.94, the null hypothesis is
accepted. Hence we conclude that the water temperature
does not make a significant difference in the performance of
the detergent.
Anitha G (BMAT202L) Hypothesis Testing - II
Problem-2
Perform a TWO way ANOVA on the data given below.
Coding Method: Subtract 30 from each data point.
Anitha G (BMAT202L) Hypothesis Testing - II
What is a Latin Square?
Is it possible to have a 2 × 2 Latin square?
Note: The number of columns, rows, and
treatments are the same.
Anitha G (BMAT202L) Hypothesis Testing - II
LSD: Anova table setup
Anitha G (BMAT202L) Hypothesis Testing - II
Formula to Calculate SSK and SSE
Calculate the Treatment Sum of Squares (A, B, C, . . . are
treatments):
( A)2 ( B)2 ( C )2 T2
P P P
SSK = + + + ··· −
n1 n2 n3 N
Calculate the Error Sum of Squares:
SSE = TSS − (SSR + SSC + SSK )
Anitha G (BMAT202L) Hypothesis Testing - II
Problem-3
The following is a Latin square os a design when 4 varieties of
seeds are being tested. Set up the ANOVA table and state your
conclusion. You may make a suitable change of origin and scale.
105 A 95 B 125 C 115 D
115 C 125 D 105 A 105 B
115 D 95 C 105 B 115 A
95 B 135 A 95 D 115 C
Anitha G (BMAT202L) Hypothesis Testing - II
THE END
Anitha G (BMAT202L) Hypothesis Testing - II