library(graphics)
library(ggplot2)
Warning: package 'ggplot2' was built under R version 4.2.2
library(readxl)
Kolmogorov <- read_excel("D:/MARV BS MATH/4th year, 2nd sem/Nonparametric Statistics/Kolmogorov.xlsx")
Kolmogorov
# A tibble: 30 × 2
Patient Scores
<dbl> <dbl>
1 1 21
2 2 32
3 3 38
4 4 40
5 5 48
6 6 55
7 7 63
8 8 66
9 9 70
10 10 75
# … with 20 more rows
mean(Kolmogorov$Scores)
[1] 90.06667
sd(Kolmogorov$Scores)
[1] 34.79292
ks.test(Kolmogorov,"pnorm")
Warning in ks.test.default(Kolmogorov, "pnorm"): ties should not be present for
the Kolmogorov-Smirnov test
Asymptotic one-sample Kolmogorov-Smirnov test
data: Kolmogorov
D = 0.96532, p-value < 2.2e-16
alternative hypothesis: two-sided
Since the p-value 2.2e-16 is less than D = 0.96532, then we reject the null hypothesis and conclude that at least one value does not match the specifies distribution.
ggplot(Kolmogorov, aes(Scores)) +
geom_density()
ggplot(data=Kolmogorov) +
geom_histogram( aes(Scores, ..density..) ) +
geom_density( aes(Scores, ..density..) ) +
geom_rug( aes(Scores) )
Warning: The dot-dot notation (`..density..`) was deprecated in ggplot2 3.4.0.
ℹ Please use `after_stat(density)` instead.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
Hence, the data is not normality distributed.