library(summarytools)
## Warning: package 'summarytools' was built under R version 4.2.3
library(dplyr)
## Warning: package 'dplyr' was built under R version 4.2.3
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(FrF2)
## Warning: package 'FrF2' was built under R version 4.2.3
## Loading required package: DoE.base
## Warning: package 'DoE.base' was built under R version 4.2.3
## Loading required package: grid
## Loading required package: conf.design
## Registered S3 method overwritten by 'DoE.base':
## method from
## factorize.factor conf.design
##
## Attaching package: 'DoE.base'
## The following objects are masked from 'package:stats':
##
## aov, lm
## The following object is masked from 'package:graphics':
##
## plot.design
## The following object is masked from 'package:base':
##
## lengths
library(agricolae)
## Warning: package 'agricolae' was built under R version 4.2.3
library(psych)
## Warning: package 'psych' was built under R version 4.2.3
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 4.2.3
##
## Attaching package: 'ggplot2'
## The following objects are masked from 'package:psych':
##
## %+%, alpha
df=read.csv("dataset.csv")
view(df)
## x must either be a summarytools object created with freq(), descr(), or a list of summarytools objects created using by()
attach(df)
datos=df[,1]
datos
## [1] 0.631222 1.490481 3.794069 0.259221 0.752061 1.863514 0.145566 0.406703
## [9] 1.235257 6.180577 0.994389 1.659229 5.491132 0.459403 0.403217 0.946419
## [17] 0.461193 0.158424 3.032464 4.589733 1.960377 0.262715 0.370000 0.611714
## [25] 2.016077 0.106091 0.711532 0.418434 2.339656 0.310419 0.089238 0.458548
## [33] 1.848129 3.087178 2.366220 0.027057 0.539808 0.040550 0.445357 0.278686
## [41] 6.446549 2.392834 2.124887 0.311627 1.622128 0.381355 3.979851 2.833169
## [49] 1.362006 0.386275 2.132119 1.388803 0.275575 0.859919 1.645578 1.163510
## [57] 0.344131 3.246464 2.984168 2.803686 1.395732 0.445214 0.472021 2.467957
## [65] 0.095377 0.990055 0.247269 2.323802 1.935008 2.113218 1.798623 0.554760
## [73] 0.593497 0.250723 0.324915 3.764271 0.514697 1.755794 0.729147 3.408564
## [81] 2.989042 0.408419 0.057798 0.714778 2.198201 0.106190 3.550689 1.309282
## [89] 3.074975 0.060837 0.464260 0.730732 1.527630 0.822129 1.252563 0.272997
## [97] 1.674986 2.414340
histograma=hist(datos, main = "Histogramas de Frecuencias", ylab = "Frecuencia", xlab = "Intervalo de frecuencia")
plot(histograma)
histograma$breaks
## [1] 0 1 2 3 4 5 6 7
frecuencia=freq(datos)
print(frecuencia)
## Frequencies
## datos
## Type: Numeric
##
## Freq % Valid % Valid Cum. % Total % Total Cum.
## -------------- ------ --------- -------------- --------- --------------
## 0.027057 1 1.02 1.02 1.02 1.02
## 0.04055 1 1.02 2.04 1.02 2.04
## 0.057798 1 1.02 3.06 1.02 3.06
## 0.060837 1 1.02 4.08 1.02 4.08
## 0.089238 1 1.02 5.10 1.02 5.10
## 0.095377 1 1.02 6.12 1.02 6.12
## 0.106091 1 1.02 7.14 1.02 7.14
## 0.10619 1 1.02 8.16 1.02 8.16
## 0.145566 1 1.02 9.18 1.02 9.18
## 0.158424 1 1.02 10.20 1.02 10.20
## 0.247269 1 1.02 11.22 1.02 11.22
## 0.250723 1 1.02 12.24 1.02 12.24
## 0.259221 1 1.02 13.27 1.02 13.27
## 0.262715 1 1.02 14.29 1.02 14.29
## 0.272997 1 1.02 15.31 1.02 15.31
## 0.275575 1 1.02 16.33 1.02 16.33
## 0.278686 1 1.02 17.35 1.02 17.35
## 0.310419 1 1.02 18.37 1.02 18.37
## 0.311627 1 1.02 19.39 1.02 19.39
## 0.324915 1 1.02 20.41 1.02 20.41
## 0.344131 1 1.02 21.43 1.02 21.43
## 0.37 1 1.02 22.45 1.02 22.45
## 0.381355 1 1.02 23.47 1.02 23.47
## 0.386275 1 1.02 24.49 1.02 24.49
## 0.403217 1 1.02 25.51 1.02 25.51
## 0.406703 1 1.02 26.53 1.02 26.53
## 0.408419 1 1.02 27.55 1.02 27.55
## 0.418434 1 1.02 28.57 1.02 28.57
## 0.445214 1 1.02 29.59 1.02 29.59
## 0.445357 1 1.02 30.61 1.02 30.61
## 0.458548 1 1.02 31.63 1.02 31.63
## 0.459403 1 1.02 32.65 1.02 32.65
## 0.461193 1 1.02 33.67 1.02 33.67
## 0.46426 1 1.02 34.69 1.02 34.69
## 0.472021 1 1.02 35.71 1.02 35.71
## 0.514697 1 1.02 36.73 1.02 36.73
## 0.539808 1 1.02 37.76 1.02 37.76
## 0.55476 1 1.02 38.78 1.02 38.78
## 0.593497 1 1.02 39.80 1.02 39.80
## 0.611714 1 1.02 40.82 1.02 40.82
## 0.631222 1 1.02 41.84 1.02 41.84
## 0.711532 1 1.02 42.86 1.02 42.86
## 0.714778 1 1.02 43.88 1.02 43.88
## 0.729147 1 1.02 44.90 1.02 44.90
## 0.730732 1 1.02 45.92 1.02 45.92
## 0.752061 1 1.02 46.94 1.02 46.94
## 0.822129 1 1.02 47.96 1.02 47.96
## 0.859919 1 1.02 48.98 1.02 48.98
## 0.946419 1 1.02 50.00 1.02 50.00
## 0.990055 1 1.02 51.02 1.02 51.02
## 0.994389 1 1.02 52.04 1.02 52.04
## 1.16351 1 1.02 53.06 1.02 53.06
## 1.235257 1 1.02 54.08 1.02 54.08
## 1.252563 1 1.02 55.10 1.02 55.10
## 1.309282 1 1.02 56.12 1.02 56.12
## 1.362006 1 1.02 57.14 1.02 57.14
## 1.388803 1 1.02 58.16 1.02 58.16
## 1.395732 1 1.02 59.18 1.02 59.18
## 1.490481 1 1.02 60.20 1.02 60.20
## 1.52763 1 1.02 61.22 1.02 61.22
## 1.622128 1 1.02 62.24 1.02 62.24
## 1.645578 1 1.02 63.27 1.02 63.27
## 1.659229 1 1.02 64.29 1.02 64.29
## 1.674986 1 1.02 65.31 1.02 65.31
## 1.755794 1 1.02 66.33 1.02 66.33
## 1.798623 1 1.02 67.35 1.02 67.35
## 1.848129 1 1.02 68.37 1.02 68.37
## 1.863514 1 1.02 69.39 1.02 69.39
## 1.935008 1 1.02 70.41 1.02 70.41
## 1.960377 1 1.02 71.43 1.02 71.43
## 2.016077 1 1.02 72.45 1.02 72.45
## 2.113218 1 1.02 73.47 1.02 73.47
## 2.124887 1 1.02 74.49 1.02 74.49
## 2.132119 1 1.02 75.51 1.02 75.51
## 2.198201 1 1.02 76.53 1.02 76.53
## 2.323802 1 1.02 77.55 1.02 77.55
## 2.339656 1 1.02 78.57 1.02 78.57
## 2.36622 1 1.02 79.59 1.02 79.59
## 2.392834 1 1.02 80.61 1.02 80.61
## 2.41434 1 1.02 81.63 1.02 81.63
## 2.467957 1 1.02 82.65 1.02 82.65
## 2.803686 1 1.02 83.67 1.02 83.67
## 2.833169 1 1.02 84.69 1.02 84.69
## 2.984168 1 1.02 85.71 1.02 85.71
## 2.989042 1 1.02 86.73 1.02 86.73
## 3.032464 1 1.02 87.76 1.02 87.76
## 3.074975 1 1.02 88.78 1.02 88.78
## 3.087178 1 1.02 89.80 1.02 89.80
## 3.246464 1 1.02 90.82 1.02 90.82
## 3.408564 1 1.02 91.84 1.02 91.84
## 3.550689 1 1.02 92.86 1.02 92.86
## 3.764271 1 1.02 93.88 1.02 93.88
## 3.794069 1 1.02 94.90 1.02 94.90
## 3.979851 1 1.02 95.92 1.02 95.92
## 4.589733 1 1.02 96.94 1.02 96.94
## 5.491132 1 1.02 97.96 1.02 97.96
## 6.180577 1 1.02 98.98 1.02 98.98
## 6.446549 1 1.02 100.00 1.02 100.00
## <NA> 0 0.00 100.00
## Total 98 100.00 100.00 100.00 100.00
Tabla=table.freq(histograma); Tabla
min(datos); max(datos); median(datos); mean(datos); sum(datos); summary(datos)
## [1] 0.027057
## [1] 6.446549
## [1] 0.968237
## [1] 1.446298
## [1] 141.7372
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 0.02706 0.40409 0.96824 1.44630 2.13031 6.44655
sd(datos); var(datos); range(datos)
## [1] 1.37815
## [1] 1.899297
## [1] 0.027057 6.446549
quantile(datos)
## 0% 25% 50% 75% 100%
## 0.0270570 0.4040885 0.9682370 2.1303110 6.4465490
skew(datos); kurtosi(datos)
## [1] 1.407712
## [1] 1.972434
x1=rexp(frecuencia)
x1data=data.frame(x1)
ggplot(data=x1data,aes(x1))+
geom_histogram(color="black", fill="lightblue",
linetype="dashed")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
plot(density(datos), xlab = "Intervalos", ylab = "Frecuencia", las=1, main = "")
pruebaKolmoro=ks.test(datos,"pexp",1/2.02, exact = TRUE, alternative = "less")
print(pruebaKolmoro)
##
## Exact one-sample Kolmogorov-Smirnov test
##
## data: datos
## D^- = 0.013305, p-value = 0.9575
## alternative hypothesis: the CDF of x lies below the null hypothesis
pexp(1.7, rate=1/2.02, lower.tail = FALSE)
## [1] 0.4310272