library(tidyverse)Formative_Assesment_
Mosquitos Data Set:
This data set contains information on 100 mosquitos providing their sex and wingspan.
Sex is a categorical factor and wingspan is continuous (numerical)
The data can be represented as a box plot
mosquitos <- read.table("C://Users//kathr//OneDrive//Documents//mosquitos.txt", header = TRUE)
ggplot(mosquitos, aes(x= sex, y= wing, fill = sex))+
geom_boxplot(show.legend = FALSE)+
labs(x= "Sex", y= "Wing Span (mm)", title = "Comparison of wing spans of male and female mosquitos")To test if there is a statistical difference in the means of males vs female we can perform a t-test :
t.test(wing ~ sex, data = mosquitos)
Welch Two Sample t-test
data: wing by sex
t = -1.6686, df = 97.324, p-value = 0.09842
alternative hypothesis: true difference in means between group f and group m is not equal to 0
95 percent confidence interval:
-7.0098735 0.6064862
sample estimates:
mean in group f mean in group m
47.17738 50.37907
p = 0.09842
This means that we cannot say there is a statistical difference in the wingspan between males and females.
Student ID
N1344796
N1325553
N1301242
N1340143
N1349229