Understanding Hypothesis Testing Basics
Understanding Hypothesis Testing Basics
For testing the hypothesis, the computed t-value of 1.71 needs to be compared with the critical value in
the t-table. If the calculated t-value is larger than the critical t-value from the table, the null hypothesis will
be discarded.
Ques. A Little League baseball coach wants to know if his team is representative of other teams in
scoring runs. Nationally, the average number of runs scored by a Little League team in a game is
5.7. He chooses five games at random in which his team scored 5, 9, 4, 11, and 8 runs. Is it likely
that his team's scores could have come from the national distribution? Assume an alpha level of
0.05.
Ans. Null hypothesis: H 0: μ = 5.7
Alternative hypothesis: H a: μ ≠ 5.7
Now calculate the mean and standard deviation:
5+9+4+11+8= 37
x̄ = 37/5 = 7.4
S= 2.88
Now, check the critical value from the t-table. The tabled value for t .025,4 is 2.776. The calculated t of
1.32 is smaller, so we cannot reject the null hypothesis that is the mean of this team is equal to the
population mean. The coach cannot deduce that his team is different from the national distribution of runs
scored.
Ques: Determine if there is a significant difference in the average scores between the two teams.
The following data is given:
Team A: Score: 65, 68, 70, 63, 67
Team B: Score: 62, 66, 69, 64, 68
Solution:
According to the question, we come to know that we need to perform an Independent Samples T-test. Set
up the null hypothesis and alternative hypothesis:
Null hypothesis: The means of the two groups are equal (μA = μB).
Alternative hypothesis: The means of the two groups are not equal (μA ≠ μB).
Next, we calculate the sample means (x̄A and x̄B) and sample standard deviations (σA and σB):
Team A:
Sample size (nA) = 5
Sample mean (x̄A) = (65 + 68 + 70 + 63 + 67) / 5 = 66.6
Sample standard deviation (σA) ≈ 2.607
Team B:
Sample size (nB) = 5
Sample mean (x̄B) = (62 + 66 + 69 + 64 + 68) / 5 = 65.8
Sample standard deviation (σB) ≈ 2.588
Now, we calculate the t-value using the formula:
t = (x̄A - x̄B) / √((σA2 / nA) + (σB2 / nB))
⇒ t = (66.6 - 65.8) / √{(2.6072/5) + (2.5882/5)}
⇒ t ≈ 0.296
Then, determine the degrees of freedom (df):
df = nA + nB - 2 = 5 + 5 - 2 = 8
and set the level of significance as 0.05.
From the table, we get the critical t-value as 2.306. As the calculated t-value is less than the critical t-
value, we conclude that the null hypothesis is not rejected, which suggests that there is no significant
difference between the average scores of the two teams.
Ques: You need to assess the effectiveness of a new teaching scheme by comparing the test
scores of the same group of students before and after the implementation of the scheme. The
following data is given:
Before scores: 76, 88, 65, 56, 76
After scores: 85, 95, 75, 60, 81
Determine if there is a significant difference in the average test scores before and after the
implementation of the scheme.
Solution:
Here, we need to perform a Paired Samples T-test, as we need to compare data of the same sample. Set
up the null hypothesis and alternative hypothesis:
Null hypothesis: The population mean difference between the before and after scores are zero
(μd = 0).
Alternative hypothesis: The population mean difference between the before and after scores is
not zero (μd ≠ 0).
Next, calculate the differences between the paired observations:
Difference (d) = After score - Before score
d1 = 85 - 76 = 9
d2 = 95 - 88 = 7
d3 = 75 - 65 = 10
d4 = 60 - 56 = 4
d5 = 81 - 76 = 5
Now, calculate the sample mean (x̄d) and sample standard deviation (σd) of the differences:
Sample size (n) = 5
Sample mean (x̄d) = (d1 + d2 + d3 + d4 + d5) / 5 = (9 + 7 + 10 + 4 + 5) / 5 = 7
Sample standard deviation (σd) ≈ 2.828
Then, calculate the t-value using the formula:
t = (x̄d - μd) / (σd / √n)
⇒ t = (7 - 0) / (2.828 / √5)
⇒ t ≈ 5.535
Next, calculate the value of degrees of freedom (df):
df = n - 1 = 5 - 1 = 4.
And, define the level of significance(α) as 0.05.
Now, from the t-distribution table, we find that the critical t-value is 2.776. As the calculated t-value is
greater than the critical t-value (5.535 > 2.776), thus, the null hypothesis is rejected. And we conclude that
there is a significant difference in the average test scores before and after the implementation of the
scheme.
5. Now we compare with the hypothesis and decide whether to reject or not reject the null hypothesis.
Type of Z-test
There are mainly two types of Z-tests. Let's understand them one by one:
1. One Sample Z test
A one-sample Z-test is used to determine if the mean of a single sample is significantly different from a
known population mean. When to Use:
The population standard deviation is known.
The sample size is large (usually n>30).
The data is approximately normally distributed.
Suppose a company claims that their new smartphone has an average battery life of 12 hours. A
consumer group tests 100 phones and finds an average battery life of 11.8 hours with a known population
standard deviation of 0.5 hours.
Step 1: Hypotheses:
H0 : μ=12
H1 : μ≠12
Step2: Calculate the Z-Score:
Where: xˉ=11.8 , μ=12, σ=0.5 and n=100
After putting the value we get:
z=11.8−12 / 0.5/ √100
z=−4
Step3: Decision
Since ∣Z∣=4>1.96 (critical value forα = 0.05) we reject H0 indicate significant evidence against the
company's claim.
2. Two-sampled z-test
In this test we have provided 2 normally distributed and independent populations and we have drawn
samples at random from both populations. Here we consider u1 and u2 to be the population mean
and X1 and X2 to be the observed sample mean. Here our null hypothesis could be like this:
H0 : μ1−μ2=0 and alternative hypothesis
H1 : μ1−μ2≠0
and the formula for calculating the z-test score:
Example: There are two groups of students preparing for a competition: Group A and Group B. Group A
has studied offline classes, while Group B has studied online classes. After the examination the score of
each student comes. Now we want to determine whether the online or offline classes are better.
Group A: Sample size = 50, Sample mean = 75, Sample standard deviation = 10
Group B: Sample size = 60, Sample mean = 80, Sample standard deviation = 12
Assuming a 5% significance level perform a two-sample z-test to determine if there is a significant
difference between the online and offline classes.
Solution:
Step 1: Null & Alternate Hypothesis
Null Hypothesis: There is no significant difference between the mean score between the online
and offline classes
μ1−μ2=0
Alternate Hypothesis: There is a significant difference in the mean scores between the online
and offline classes.
μ1−μ2≠0
Step 2: Significance Level
Significance Level: 5%
α=0.05
Step 3: Z-Score
= (75−80)−0 / √( 10^2/50 + 12^2/ 60)
= -5 /√ 2+2.4
= -5/ 2.0976
= -2.384
Step 4: Check to Critical Z-Score value in the Z-Table for alpha/2 = 0.025
Critical Z-Score = 1.96
Step 5: Compare with the absolute Z-Score value
absolute(Z-Score) > Critical Z-Score
So we reject the null hypothesis and there is a significant difference between the online and
offline classes.
Solved examples
Problem 1: A company claims that the average battery life of their new smartphone is 12 hours. A
consumer group tests 100 phones and finds the average battery life to be 11.8 hours with a
population standard deviation of 0.5 hours. At a 5% significance level, is there evidence to refute
the company's claim?
Solution:
Step 1: State the hypotheses
H0 : μ=12 (null hypothesis)
Ques : A study investigates the relationship between eye color (blue, brown, green) and hair color
(blonde, brunette, Redhead). The following data is collected:
Eye Blonde Brunette Redhead Total
Color
Blue 35 52.5 12.5 100
Brown 28.1 42.1 9.8 80
Green 6.9 10.4 2.7 20
Solution:
Calculate the chi-square value for each cell in the contingency table using the formula
χ² = (Oi - Ei)² / Ei
For instance, consider someone with brown hair and blue eyes:
χ² = (15 - 28.1)² / 28.1 ≈ 6.07.
To complete the total chi-square statistic, find each cell’s chi-squared value and sum them up across all
the nine cells in the table.
Degrees of Freedom (df):
df = (number of rows - 1) × (number of columns - 1)
df = (3 - 1) × (3 - 1)
df = 2 × 2 = 4
Finding p-value:
You may reference a chi-square distribution table to get an estimated chi-square stat of (χ²) using
the appropriate degrees of freedom. Look for the closest value and its corresponding p-value since most
tables do not show precise numbers.
If your Chi-square value was 20.5, you would observe that the nearest number in the table for df = 4 is
14.88 with a p-value in 0.005; an illustration is.
Interpreting Results:
Selecting a level of significance (α = 0.05 is common)or than if the null hypothesis holds, the
probability of either rejecting it at all is limited (Type I error).
Compare the alpha value and p-value.
When the p-value is less than the significance level, which in this case is written as p-value <
0.05, we can reject the null hypothesis. There is sufficient evidence to say that hair and eye color are
related in one direction according to statistical terms. If the p-value is greater than the significance level
it means that we cannot reject the null hypothesis therefore p-value > 0.05.
Based on the data at hand, we cannot say that there is a statistically significant correlation
between eye and hair colors.
Q1. Market Research on Beverages
A company conducts a survey to determine whether there's a relationship between age groups and
preferred beverages. The data collected is as follows:
Age Coffee Tea Soft Water
Group Drinks
18-25 30 20 25 15
26-35 25 30 20 25
36-45 20 25 30 25
46-55 15 20 25 40
Use a chi-square test to determine if there is an association between age groups and preferred
beverages.
Q2. Student Performance
A teacher wants to find out if there is a relationship between study habits and grades. The data collected
is as follows:
Study A B C D F
Habits
Regular 15 20 25 10 5
Occasional 10 15 20 15 10
Rare 5 10 15 20 25
Perform a chi-square test to determine if study habits and grades are associated.
Q3. Gender and Major
A university wants to see if there is an association between gender and chosen major. The data collected
is:
Major Male Female
Engineering 60 30
Business 40 50
Arts 20 40
Sciences 30 30
Conduct a chi-square test to examine if gender and chosen major are related.
Q4. Voting Preferences
A political analyst wants to know if there is a relationship between gender and voting preference. The
data is:
Preference Male Female
Candidate
80 90
A
Candidate
70 60
B
Undecided 50 40
Test the hypothesis that gender and voting preference are independent.
Q5. Diet and Exercise
A health study examines the relationship between diet type and exercise frequency. The data is:
Exercise Vegan Vegetarian Omnivore
Frequency
Regular 40 30 50
Occasionally 30 40 30
Never 20 30 20
Use a chi-square test to determine if diet type and exercise frequency are associated.
Anova Test
ANOVA (Analysis of Variance) is a statistical method used to determine whether there are significant
differences between the means of three or more independent groups by analyzing the variability within
each group and between the groups. It helps in testing the null hypothesis that all group means are
equal.
It does this by comparing two types of variation: (F-statistics)
1. Differences BETWEEN groups (how much group averages differ from each other)
2. Differences WITHIN groups (how much individuals in the same group vary naturally).
If the between-group differences are significantly larger than within-group variation, ANOVA tells us: At
least one group is truly different. Otherwise, it concludes: The differences are likely due to
random chance.
For example:
Compare test scores of students taught with 3 methods (Traditional, Online, Hybrid). ANOVA is used
to determine if at least one teaching method yields significantly different average scores.
ANOVA Formula
The ANOVA formula is made up of numerous parts. The best way to tackle an ANOVA test problem is to
organize the formulae inside an ANOVA table.
Here's a general structure of an ANOVA table:
where,
F = ANOVA Coefficient
MSB = Mean of the total of squares between groupings
MSW = Mean total of squares within groupings
MSE = Mean sum of squares due to error
SST = total Sum of squares
p = Total number of populations
n = The total number of samples in a population
SSW = Sum of squares within the groups
SSB = Sum of squares between the groups
SSE = Sum of squares due to error
s = Standard deviation of the samples
N = Total number of observations
Assumptions of ANOVA
These must be validated before analysis:
1. Independence: Observations are randomly sampled, and groups are independent.
2. Normality: Residuals (errors) are approximately normally distributed (checked via Q-Q plots or
Shapiro-Wilk test).
3. Homoscedasticity: Equal variances across groups (verified using Levene’s or Bartlett’s test).
ANOVA is robust to minor violations of normality and homoscedasticity with balanced sample sizes.
Calculating ANOVA
Let's explore calculating ANOVA for the scenario:
Compare plant growth under 3 fertilizers (A, B, C):
Fertilizer A: [10, 11, 12]
Fertilizer B: [7, 8, 9]
Fertilizer C: [4, 5, 6]
1. State Hypothesis
Null Hypothesis (H0): μA = μB = μC
Alternative Hypothesis (Ha ): At least one μ differs.
2. Calculate Group means and Grand mean.
Group Means: x̄A, x̄B and x̄C
Grand Mean: x̄grand
X‾A=10+11+12/3=11
X‾B=7+8+9/3=8
X‾C=4+5+6/3=5
X‾grand=10+11+12+7+8+9+4+5+6/9 =72/9 = 8
SST (Total Sum of Squares): Accounts for total variation from overall mean.
SST = SSB + SSW
SSB = 3(11 − 8)2 + 3(8 − 8)2 + 3(5 − 8)2 = 3(9) + 3(0) + 3(9) = 54
SSE:
Fertilizer A: (10 − 11)2 + (11−11)2 + (12−11)2 = 1 + 0 + 1 = 2
Fertilizer B: (7 − 8)2 + (8 − 8)2 + (9 − 8)2 = 1 + 0 + 1 = 2
Fertilizer C: (4 − 5)2 + (5 − 5)2 + (6 − 5)2 = 1 + 0 + 1 = 2
SSW = 2 + 2 + 2 = 6
SST = 54 + 6 = 60
6. F-statistic:
The F-statistic is calculated as the ratio of MSB to MSE:
F=MSBMSEF=MSEMSB
F=27/1=27
7. P-value:
The p-value is used to decide whether differences among groups are statistically significant. When the
p-value is smaller than the significance level (α), the null hypothesis is rejected.
If F > Fcritical → p < 0.05 : Null Hypothesis Rejected
Use the F-distribution table or software with: Numerator df1 = 2 , Denominator df2 = 6, α=0.05
Critical F-value, Fcritical: 5.14 (From F-distribution table)
F > Fcritical : 27 > 5.14 → p < 0.05; Reject null hypothesis
Types of ANOVA
An ANOVA test can be classified as either one-way or two-way based on the number of independent
variables involved.
One-Way ANOVA
This test is used to see if there is a variation in the mean values of three or more groups. Such a test is
used where the data set has only one independent variable. If the test statistic exceeds the critical value,
the null hypothesis is rejected, and the averages of at least two different groups are statistically
significant.
Two-Way ANOVA
Two independent variables are used in the two-way ANOVA. A two-way ANOVA test is used to
determine the main effect of each independent variable and whether there is an interaction effect. Each
factor is examined independently to determine the main effect, as in a one-way ANOVA. Furthermore, all
components are analyzed at the same time to test the interaction impact.
Solved Examples on ANOVA
Example 1: Three different kinds of food are tested on three groups of rats for 5 weeks. The objective is
to check the difference in mean weight(in grams) of the rats per week. Apply one-way ANOVA using a
0.05 significance level to the following data:
Food I Food II Food III
8 4 11
12 5 8
19 4 7
8 6 13
6 9 7
11 7 9
Solution:
H0: μ1= μ2=μ3
H1: The means are not equal
Since, X̄1 = 5, X̄2 = 9, X̄3 = 10
Total mean = X̄ = 8
SSB = 6(5 - 8)2 + 6(9 - 8)2 + 6(10 - 8)2 = 84
SSE = 68
MSB = SSB/df1 = 42
MSE = SSE/df2 = 4.53
f = MSB/MSE = 42/4.53 = 9.33
Since f > F, the null hypothesis stands rejected.
Example 2: Calculate the ANOVA coefficient for the following data:
Average
Plant Number span s
Hibiscus 5 12 2
Marigold 5 16 1
Rose 5 20 4
Solution:
Plant n x s s2
Hibiscus 5 12 2 4
Marigold 5 16 1 1
Rose 5 20 4 16
p=3
n=5
N = 15
x̄ = 16
SST = Σn(x−x̄)2
SST= 5(12 − 16)2 + 5(16 − 16)2 + 11(20 − 16)2 = 160
MST = SST/p-1 = 160/3-1 = 80
SSE = ∑ (n−1) = 4 (4 + 1) + 4(16) = 84
MSE = 7
F = MST/MSE = 80/7
F = 11.429
Example 3: The following data show the number of worms quarantined from the GI areas of four groups
of muskrats in a carbon tetrachloride anthelmintic study. Conduct a two-way ANOVA test.
I II III IV
338 412 124 389
Within the
98787.8 16 4567.89
groups
Total 167771.4 24
Since F = MST / MSE
= 9.4062 / 3.66
F = 2.57
Example 4: Enlist the results in APA format after performing ANOVA on the following data set:
[ nmeansd 3050.2610.45 3045.3212.76 3053.6711.47]⎣⎡ n 30 30 30mean50.2645.3253.67sd10.4512.7611.47⎦⎤
Solution:
Variance of first set = (10.45)2 = 109.2
Variance of second set = (12.76)2 = 162.82
Variance of third set = (11.47)2 = 131.56
MSerror = {109.2 + 162.82 + 131.56} / {3}
= 134.53
MSbetween = (17.62)(30) = 528.75
F = MSbetween / MSerror
= 528.75 / 134.53
F = 4.86
APA writeup: F(2, 87)=3.93, p >=0.01, η2=0.08.
Practice Problem Based On ANOVA
Question 1. Method A = {80, 85, 90, 87}, Method B = {75, 78, 72, 74}, and Method C = {88, 85, 90, 92}
are given. State the null and alternative hypotheses for performing a One-Way ANOVA test.
Question 2. Calculate the F-statistic for the given data using One-Way ANOVA. Group 1 = {5, 6, 7, 8},
Group 2 = {4, 5, 6, 5}, and Group 3 = {7, 7, 6, 8}.
Question 3. Interpret the significance of the p-value for the interaction effect in a Two-Way ANOVA,
where the p-value for the interaction effect is 0.02 and the significance level (α\alphaα) is 0.05.
Question 4. Group A = {10, 12, 14, 13}, Group B = {15, 17, 16, 18}, and Group C = {20, 22, 21, 23} are
given. Interpret the p-value of the ANOVA test and explain whether the null hypothesis is rejected, where
F-statistic = 4.86 and p-value = 0.01.
Answer:-
1. Null Hypothesis (H₀): μ₁ = μ₂ = μ₃ (The means of all groups are equal). Alternative Hypothesis (H₁): At
least one mean is different.
2. F-statistic = 4.58.
3. If the p-value (0.02) is less than the significance level (0.05), reject the null hypothesis and conclude
that there is a significant interaction effect.
4. Since the p-value (0.01) is less than 0.05 and the F-statistic is significant, we reject the null hypothesis,
indicating a significant difference between the group means.
Student 1
2 2 1
Student 2
4 3 2
Student 3
2 4 5
SSbetween=SSTotal−SSwithin=13.60−13.34=0.23
Step 6 Find the variance
S2between=SSbetween/dfbetween=0.23/2=0.115≈0.12
S2within=SSwithin/dfwithin=13.34/6=2.22
Step 7 Compute F-statistics
Fcalc=S2between/S2with in=0.12/2.22=0.05
Since, Fcalc < Ftable (0.05 < 5.14)
We cannot reject the null hypothesis.
Thus, we can say that the means of all three subjects is the same.
Conclusion
One-way ANOVA compares three or more than three categorical groups to establish whether there is a
difference between them. The fundamental strategy of ANOVA is to systematically examine variability
within groups being compared and also examine variability among the groups being compared.
F test is a statistical test that is used in hypothesis testing that determines whether the variances
of two samples are equal or not. The article will provide detailed information on f test, f statistic,
its calculation, critical value and how to use it to test hypotheses. To understand F test firstly we
need to have some basic understanding of F-distribution.
F-distribution
The F-distribution is a continuous statistical distribution used to test whether two samples have the same
variance. The F-Distribution has two parameters the numerator degrees of freedom (df1) and the
denominator degrees of freedom (df2).
Formula for F-distribution:
f-value=sample1/df1 / sample2/df2
The independent random variables Samples 1 and 2, have a chi-square distribution.
The related samples' degrees of freedom are denoted by df1 and df2.
Understanding F-Test
In F test the data follows an F distribution. This test uses the F statistic to compare two variances by
dividing them. An F test can either be one-tailed or two-tailed depending upon the parameters of the
problem. The F value obtained after conducting an F test is used to perform the one-way ANOVA
(analysis of variance) test. We can use this test when:
The population is normally distributed.
The samples are taken at random and are independent samples.
Hypothesis Testing Framework for F-test
For various hypothesis tests the F test formula is provided as follows:
1. Left Tailed Test:
Null Hypothesis: H0 : σ12=σ22
Alternate Hypothesis: H1 : σ12<σ22
Decision-Making Standard: The null hypothesis is to be rejected if the F statistic is less than the F critical
value.
2. Right Tailed Test:
Null Hypothesis: H0 : σ12=σ22
Alternate Hypothesis: H1 : σ12>σ22
Decision-Making Standard: Dismiss the null hypothesis if the F test statistic is greater than the F test
critical value.
3. Two Tailed Test:
Null Hypothesis: H0 : 𝜎1^2 = 𝜎2^2
Alternate Hypothesis: H1 : σ1^2≠σ2^2
Decision-Making Standard: When the F test statistic surpasses the F test critical value the null
hypothesis is declared invalid.
F Test Statistics
The F test statistic or simply the F statistic is a value that is compared with the critical value to check if
the null hypothesis should be rejected or not. The F test statistic formula is given below:
F statistic for large samples: Fcalc= 𝜎1^2 /𝜎2^2 where 𝜎1^2 is the variance of the first population
and 𝜎2^2 is the variance of the second population.
F statistic for small samples: Fcalc= s1^2 /s2^2 where s1^2 is the variance of the first sample and s2^2
is the variance of the second sample.
Steps to calculate F-Test
Step 1: Use Standard deviation (𝜎1) and find variance (𝜎2) of the data. (if not already given)
Step 2: Determine the null and alternate hypothesis.
H0: no difference in variances.
H1: difference in variances.
Step 3: Find Fcalc using Equation 1 (F-value).
NOTE : While calculating Fcalc, divide the larger variance with small variance as it makes calculations
easier.
Step 4: Find the degrees of freedom of the two samples.
Step 5: Find Ftable value using d1 and d2 obtained in Step-4 from the F-distribution table. Take learning
rate, α = 0.05 (if not given)
Looking up the F-distribution table:
In the F-Distribution table as per the given value of α in the question.
d1 (Across) = df of the sample with numerator variance. (larger)
d2 (Below) = df of the sample with denominator variance. (smaller)
Consider the F-Distribution table given below, while performing One-Tailed F-Test.
GIVEN:
α = 0.05
d1 = 2
d2 = 3
d2 /d1
1 2
161.4 199.5
1
18.51 19.00
2
10.13 9.55
3
Then, Ftable = 9.55
Step 6: Interpret the results using Fcalc and Ftable.
Interpreting the results:
If Fcalc < Ftable :
Cannot reject null hypothesis.
∴ Variance of two populations are similar.
σ 10.47 8.12
n 41 21
Step 1: The statement of the hypothesis is formatted as:
H0: no difference in variances.
H1: difference in variances.
Step 2: Let's calculated the value of the variances in numerator and denominator as F-value= σ12σ22σ22
σ12
σ12 = (10.47)2 = 109.63
σ22 = (8.12)2 = 65.99
Fcalc = (109.63 / 65.99) = 1.66
Step 3: Now, let's calculate the degree of freedom: Degree of freedom = sample - 1 Here we have
Sample 1 = n1 = 41 and
Sample 2 = n2 = 21
Degree of sample 1 = d1 = (n1 - 1) = (41 – 1) = 40
Degree of sample 2 = d2 = (n2 — 1) = (21 – 1) = 20
Step 4: The usual alpha level of 0.05 is selected because the question does not specify an alpha level.
The alpha level should be lowered during the test to half of its starting value. Using d1 = 40 and d2 = 20
in the F-Distribution table. (link here) and Take α = 0.05 as it's not given. Since it is a two-tailed F-test
then:
α = 0.05/2 = 0.025
Step 5: The critical F value is found with alpha at 0.025 using the F table. For (40, 20), the critical value
at alpha equal to 0.025 is 2.287. Therefore, Ftable = 2.287
Step 6: Since Fcalc < Ftable (1.66 < 2.287):
We cannot reject null hypothesis.
∴ Variance of two populations is similar to each other.
F-Test is the most often used when comparing statistical models that have been fitted to a data set to
identify the model that best fits the population.
Example 1: A research team wants to study the effects of a new drug on insomnia. 8 tests were
conducted with a variance of 600 initially. After 7 months 6 tests were conducted with a variance of 400.
At a significance level of 0.05 was there any improvement in the results after 7 months?
Solution: As the variance needs to be compared, the f test needs to be used.
H0 : s1^2= s2^2
H1 : s1^2 > s2^2
n1 = 8, n2 = 6
df1 = 8 - 1 = 7
df2 = 6 - 1 = 5
s1^2 = 600, s2^2= 400
The f test formula is given as follows:
F = s1^2 / s2^2 = 600 / 400
F = 1.5
Now from the F table the critical value F(0.05, 7, 5) = 4.88
As 1.5 < 4.88, thus, the null hypothesis cannot be rejected and there is not enough evidence to
conclude that there was an improvement in insomnia after using the new drug.
Answer: Fail to reject the null hypothesis.
Example 3: A toy manufacturer wants to get batteries for toys. A team collected 41 samples from
supplier A and the variance was 110 hours. The team also collected 21 samples from supplier B with a
variance of 65 hours. At a 0.05 alpha level determine if there is a difference in the variances.
Solution: This is an example of a two-tailed F test. Thus, the alpha level is 0.05 / 2 = 0.025
H0 : s1^2 = s2^2
H1 : s1^2 ≠ s2^2
n1 = 41, n2 = 21
df1 = 41 - 1 = 40
df2 = 21 - 1 = 20
s1^2 = 110, s2^2= 65
F = s1^2 / s2^2 = 110 / 65
F = 1.69
Using the F table F(0.025, 40, 20) = 2.287
As 1.69 < 2.287 thus, the null hypothesis cannot be rejected,
Answer: Fail to reject the null hypothesis.
F Test vs T-Test
F test and t-test are different types of statistical tests used for hypothesis
testing depending on the distribution followed by the population data. The
table given below outlines the differences between the F test and the t-test.
F Test T-Test
The T-test is
An F test is
used when
a test
the sample
statistic
size is small
used to
(n < 30) and
check the
the
equality of
population
variances
standard
of two
deviation is
populations
not known.
The data The data
F Test T-Test
follows an follows a
F Student t-
distribution distribution
The t-test
statistic for 1
sample is
given by t
=
x̄ −μ / s/√n,
where 𝑥̄ is
The F test the sample
statistic is
given as F mean, μ is
= 𝜎1^2 / 𝜎2^2 the
population
mean, s is
the sample
standard
deviation
and n is the
sample size.
The f test is
It is used for
used for
testing means.
variances.