### importing and attaching the dataset [DELIVERY] delivery <- readxl::read_excel("state-data.xlsx", sheet="delivery") attach(delivery) ### Shapiro--Wilk's test shapiro.test(supA); shapiro.test(supB) ### Kolmogorv--Smirnov's test mean(supA); sd(supA) ks.test(supA, "pnorm", 478, 600) ### ploting empirical distribution function plot(ecdf(supA), xlim=c(-1000, 3000)) curve(pnorm(x, 478, 600), add = TRUE, col="magenta") # or, using ggplot2 library(ggplot2) supAplot <- ggplot(delivery, aes(supA)) + stat_ecdf(geom = "step") + scale_x_continuous(limits = c(-1000,3000)) supAplot + stat_function(fun=pnorm, color="magenta", args=list(mean=478, sd=600)) ### Normal Q-Q plots qqnorm(supA); qqline(supA) qqnorm(supB); qqline(supB) ggplot(delivery, aes(sample = supA)) + stat_qq() + stat_qq_line()