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

Problem:
Comparing two independent sample means, taken from two populations with unknown variance.
The following data shows the heights of individuals of two different countries with unknown
population variances. Is there any significant difference b/n the average heights of two groups?
A: 175 168 168 190 156 181 182 175 174 179
B: 120 180 125 188 130 190 110 185 112 188

R - Code:-
> X=c(175,168,168,190,156,181,182,175,174,179)
> X
[1] 175 168 168 190 156 181 182 175 174 179
> Y=c(120,180,125,188,130,190,110,185,112,188)
> Y
[1] 120 180 125 188 130 190 110 185 112 188
>t.test(X,Y)
Welch Two Sample t-test
data: X and Y
t = 1.8827,
df = 10.224, p-value = 0.08848
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-3.95955
47.95955
sample estimates:
mean of x
mean of y
174.8
152.8
> qt(0.975,10+10-2)
[1] 2.100922