-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathq1.R
56 lines (33 loc) · 910 Bytes
/
q1.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#Question number 1
#importing the library required for calculation
install.packages("dplyr")
library(dplyr)
Path1 <- read.csv("poison.csv")
data <- Path1 %>%
select(-X) %>%
mutate(poison = factor(poison, ordered = TRUE))
glimpse(data)
levels(data$poison)
data %>%
group_by(poison) %>%
summarise(
count_poison = n(),
mean_time = mean(time, na.rm = TRUE),
sd_time = sd(time, na.rm = TRUE)
)
library(ggplot2)
ggplot(data, aes(x = poison, y = time, fill = poison)) +
geom_boxplot( col = rainbow(3))
#showing the data
data
#performing one way anova
anova_result <- aov(time ~ poison , data = data)
#showing results
anova_result
summary(anova_result)
#t test
#between poison and time
poison1 <- data
# pairwise comparison
pairwise.t.test(poison1$time, poison1$treat)
pairwise.t.test(poison1$time, poison1$poison)