women_weight <- c(38.9, 61.2, 73.3, 21.8, 63.4, 64.6, 48.4, 48.8, 48.5)
men_weight <- c(67.8, 60, 63.4, 76, 89.4, 73.3, 67.3, 61.3, 62.4)
my_data <- data.frame(
group = rep(c("Woman", "Man"), each = 9),
weight = c(women_weight, men_weight))
my_data
## group weight
## 1 Woman 38.9
## 2 Woman 61.2
## 3 Woman 73.3
## 4 Woman 21.8
## 5 Woman 63.4
## 6 Woman 64.6
## 7 Woman 48.4
## 8 Woman 48.8
## 9 Woman 48.5
## 10 Man 67.8
## 11 Man 60.0
## 12 Man 63.4
## 13 Man 76.0
## 14 Man 89.4
## 15 Man 73.3
## 16 Man 67.3
## 17 Man 61.3
## 18 Man 62.4
Plotting with ‘ggpubr’ package
library("ggpubr")
## Loading required package: ggplot2
## Loading required package: magrittr
ggboxplot(my_data, x = "group", y = "weight",
color = "group", palette = c("#00AFBB", "#E7B800"),
ylab = "Weight", xlab = "Groups")
‘visualize’ is the package used in R for plotting the descrete and continuous distributions of statistics and to fing the probability area according the desires values of parameters of distribution.
library(visualize)
par(mfrow=c(2,2))
visualize.it(dist='norm', stat = c(0,1), params = list(mu = 1, sd = 1), section = "bounded")
visualize.norm(stat = 1, mu = 4, sd = 5, section = "lower")
visualize.norm(stat = 1, mu = 3, sd = 2, section = "upper")
visualize.norm(stat=c(-2,6),mu=3,sd=2,section="tails")
par(mfrow=c(2,2))
visualize.chisq(stat = 1, df = 4, section = "lower")
visualize.chisq(stat = c(1,2), df = 6, section = "bounded")
visualize.chisq(stat = 4, df = 3, section = "upper")
visualize.chisq(stat=c(1,4),df=3,section = "tails")
## Warning: Abnormal request for tails condition supplied on nonsymmetric distribution.
par(mfrow=c(2,2))
visualize.t(stat = -2, df = 4, section = "lower")
visualize.t(stat = c(0,2), df = 6, section = "bounded")
visualize.t(stat = 1, df = 4, section = "upper")
visualize.t(stat=c(-2.5,2.5),df=4,section = "tails")
par(mfrow=c(2,2))
visualize.f(stat = 1, df1 = 5, df2 = 5, section = "lower")
visualize.f(stat = c(1,2), df1 = 6, df2 = 5, section = "bounded")
visualize.f(stat = 1, df1 = 5, df2 = 6, section = "upper")
visualize.f(stat = c(0.5,2.5), df1 = 5, df2 = 7, section = "tails")
## Warning: Abnormal request for tails condition supplied on nonsymmetric distribution.
par(mfrow=c(2,2))
visualize.exp(stat = .5, theta = 3, section = "lower")
visualize.exp(stat = c(1,2), theta = 3, section = "bounded")
visualize.exp(stat = .5, theta = 3, section = "upper")
visualize.exp(stat=c(0.3,1),theta=2,section = "tails")
## Warning: Abnormal request for tails condition supplied on nonsymmetric distribution.
par(mfrow=c(2,2))
visualize.cauchy(stat = -10, location = 9, scale = 9, section = "lower")
## Warning: df2 < 2, mean is not able to be generated.
visualize.cauchy(stat = c(3,5), location = 5, scale = 3, section = "bounded")
## Warning: df2 < 2, mean is not able to be generated.
visualize.cauchy(stat = 7, location = 4, scale = 2, section = "upper")
## Warning: df2 < 2, mean is not able to be generated.
visualize.cauchy(stat=c(0,8),location=3,scale=2,section = "tails")
## Warning: df2 < 2, mean is not able to be generated.
par(mfrow=c(2,2))
visualize.beta(stat = 0.25, alpha = 2, beta = 3, section = "lower")
visualize.beta(stat = c(.5,0.75), alpha = 4, beta = 3, section = "bounded")
visualize.beta(stat = 0.75, alpha = 2, beta = 3, section = "upper")
visualize.beta(stat=c(0.35,0.75),alpha=4,beta=5,section = "tails")
## Warning: Abnormal request for tails condition supplied on nonsymmetric distribution.
par(mfrow=c(2,2))
visualize.gamma(stat = 1, alpha = 3, theta = 1, section = "lower")
visualize.gamma(stat = c(0.75,1), alpha = 3, theta = 1, section = "bounded")
visualize.gamma(stat = 3, alpha = 3, theta = 1, section = "upper")
visualize.gamma(stat=c(0.75,3),alpha=3,theta=1,section="tails")
## Warning: Abnormal request for tails condition supplied on nonsymmetric distribution.
par(mfrow=c(2,2))
visualize.geom(stat = 1, prob = 0.5, section = "lower", strict = FALSE)
visualize.geom(stat = c(1,3), prob = 0.35, section = "bounded", strict = c(0,1))
visualize.geom(stat = 1, prob = 0.5, section = "upper", strict = 1)
visualize.geom(stat=c(1,7),prob=0.25,section = "tails",strict=TRUE)
## Supplied strict length < 2, setting inequalities to strict inequality.
par(mfrow=c(2,2))
visualize.binom(stat = 1, size = 3, prob = 0.5, section = "lower", strict = FALSE)
visualize.binom(stat = c(1,2), size = 5, prob = 0.35, section = "bounded", strict = c(0,1))
visualize.binom(stat = 1, size = 3, prob = 0.5, section = "upper", strict = TRUE)
visualize.binom(stat=c(0,3),size=5,prob=0.4,section = "tails",strict = c(0,2))