Aim: To test whether there is significant difference between two sample means.

Problem:
A college conduct both day and night classes intended to be identical. A sample of 100 day
students yields examination results as
and a sample of 200 night students
as
. Are the two means statistically equal at 5% level?

R code:-
The null hypothesis H0 ,
Alternative hypothesis H1 ,
We begin with computing the test statistic.
> x1bar=72.4
# Sample1 mean
> x2bar=73.9
# Sample2 mean
> s1=14.8
# Sample1 SD
> s2=17.9
# Sample2 SD
> n1=100
# Sample1 size
> n2=200
# Sample2 size
> Test_Statistics=abs(((x1bar-x2bar)/sqrt((s1^2/n1)+(s2^2/n2))))
> Test_Statistics
[1] 0.7702493
We then compute the critical value at .05 significance level.
>alpha=0.05
>z.alpha=qnorm(1-alpha/2)
> z.alpha
[1] 1.959964