You are on page 1of 2

SAMRIDH VIKHAS S | 20MIY0001 | MAT3011[ELA] | DA – 6

Objective:

To perform “Kruskal Wallis H Test” using R Programming

Null Hypothesis[H0]:

There is no significant difference between the samples

Alternative Hypothesis[H1]:

There is significant difference between the samples

Level of Significance = 5%

Code:
grps = rep(c("fb","insta","twitter"),each=5)
eng = c(25,30,35,40,45,20,22,25,28,30,
15,18,20,22,25)
kruskal.test(eng~grps)

Output:
Kruskal-Wallis rank sum test

data: eng by grps


Kruskal-Wallis chi-squared = 8.7544, df = 2, p-value = 0.01256
Conclusion:

Since calculated p-value < 0.05, Do not Reject Null Hypothesis (H0). There is no significant difference
between the samples.
SAMRIDH VIKHAS S | 20MIY0001 | MAT3011[ELA] | DA – 6
Objective:

To perform “Kolmogorov Smirnov Test” using R Programming

Null Hypothesis[H0]:

There is no significant difference between the distributions of the samples

Alternative Hypothesis[H1]:

There is significant difference between the distributions of the samples

Level of Significance = 5%

Code:
a = c(85,90,88,92,89,91,87,93,86,90)
b = c(78,82,80,85,79,83,81,84,77,80)
ks.test(a,b)

Output:
Exact two-sample Kolmogorov-Smirnov test
data: a and b
D = 0.9, p-value = 0.0002165
alternative hypothesis: two-sided

Conclusion:

Since calculated p-value < 0.05, Do not Reject Null Hypothesis (H0). There is no significant difference
between the distribution of the samples.

You might also like