In: Statistics and Probability
2.34, 8.22+, 2.29, 0.75, 3.79, 20.95, 2.03, 3.65+, 2.28, 2.48, 20.61+, 1.02+, 3.34, 0.69, 3.64, 2.86
0.18, 0.73+, 1.00+, 1.66, 11.19+
[HINT: USE GOODNESS OF FIT PLOTTING]
The given data follow log-normal distribution on the basis of plotting and K-S test because the P-value for log-normal distribution is greater than other two distribution named normal and exponential distribution.
R code:
library("fitdistrplus")
data = c(2.34, 8.22, 2.29, 0.75, 3.79, 20.95, 2.03, 3.65, 2.28,
2.48, 20.61, 1.02, 3.34, 0.69, 3.64, 2.86,
0.18, 0.73, 1.00, 1.66, 11.19)
fn <- fitdist(data, "norm")
plot(fn)
fln <- fitdist(data, "lnorm")
plot(fln)
fe <- fitdist(data, "exp")
plot(fe)
ks.test(data, "pnorm", mean=mean(data), sd=sd(data))
ks.test(data, "plnorm", meanlog=mean(log(data)),
sd=sd(log(data)))
ks.test(data, "pexp", rate=1/mean(data))
Plotting of normal distribution for given data:
Plotting of log-normal distribution for given data:
Plotting of exponential distribution for given data:
Output:
fn <- fitdist(data, "norm")
> plot(fn)
> fln <- fitdist(data, "lnorm")
> plot(fln)
> fe <- fitdist(data, "exp")
> plot(fe)
> ks.test(data, "pnorm", mean=mean(data), sd=sd(data))
One-sample Kolmogorov-Smirnov test
data: data
D = 0.36063, p-value = 0.005941
alternative hypothesis: two-sided
> ks.test(data, "plnorm", meanlog=mean(log(data)), sd=sd(log(data)))
One-sample Kolmogorov-Smirnov test
data: data
D = 0.16067, p-value = 0.5946
alternative hypothesis: two-sided
> ks.test(data, "pexp", rate=1/mean(data))
One-sample Kolmogorov-Smirnov test
data: data
D = 0.24485, p-value = 0.1357
alternative hypothesis: two-sided