You are on page 1of 4

Name : SURIYA G

Reg No : 20MIY0002

Course Code : MAT3011

Faculty : MOKESH RAYALU

Assignment : DA4
Objective:
To perform Run test using R programming

Null Hypothesis: The given observations are in random order


Alternate Hypothesis: The given observations are not in
random order
Level of Significance: 5%
Code:
library(randtests)
data = c(20,15,25,18,22,16,21,17,19,23,14,24,18,20,16,
19,17,21,16,18,22,15,20,23,14,25,19,18,24)
runs.test(data,alternative="t")

Output:
Runs Test

data: data
statistic = 3.6029, runs = 23, n1 = 13, n2 = 13, n = 26, p-value = 0.0003147
alternative hypothesis: nonrandomness

Conclusion:
Do not Reject H0. The given observations are in
random order
Objective:

To perform median test using R programming

Null Hypothesis: There is no significance difference between


samples
Alternate Hypothesis: There is significance difference between
samples
Level of Significance: 5%
Code:
library(agricolae)
method = rep(c("Facebook","Instagram"),each=10)
likes = c(50,45,55,48,52,60,58,53,47,51,40,42,38,
36,41,39,37,43,44,40)
df = data.frame(method,likes)
Median.test(likes,method,simulate.p.value = TRUE)

Output:
The Median Test for likes ~ method

Chi Square = 16.2 DF = 1 P.Value 5.699412e-05


Median = 44.5

Median r Min Max Q25 Q75


Facebook 51.5 10 45 60 48.50 54.50
Instagram 40.0 10 36 44 38.25 41.75

Post Hoc Analysis

Groups according to probability of treatment differences and alpha level.

Treatments with the same letter are not significantly different.

likes groups
Facebook 51.5 a
Instagram 40.0 b

Conclusion:
Do not reject H0. There is no significance difference
between samples.

You might also like