61 data <- data.frame ( Gender = as.factor ( c ( rep ( "Girl" , 12 ) , rep ( "Boy" , 12 ))) , Grade = c ( 19 , 18 , 9 , 17 , 8 , 7 , 16 , 19 , 20 , 9 , 11 , 18 , 16 , 5 , 15 , 2 , 14 , 15 , 4 , 7 , 15 , 6 , 7 , 14 )) library ( ggplot2 ) ggplot ( data ) + aes ( x = Gender, y = Grade ) + geom_boxplot ( fill = "#0c4c8a" ) + theme_minimal () hist ( subset ( data , Gender == "Girl" )$ Grade, main = "Grades for girls" , xlab = "Grades" ) hist ( subset ( data , Gender == "Boy" )$ Grade, main = "Grades for boys" , xlab = "Grades" ) test <- wilcox.test ( data $ Grade ~ data $ Gender ) test Wilcoxon rank sum test