PRIMER EJERCICIO DE PROBABILIDAD Y ESTADISTICA: TABLAS, HISTOGRAMAS Y POLIGONOS DE DISTRIBUCIONES DE FRECUENCIA.
Importar datos
ob <- c(17.4, 18.6, 20.3, 23.5, 26.9, 30.6, 31.9, 31.6, 31.0, 27.5, 22.1, 17.9)
Ordenar datos de menor a mayor
sort(ob, decreasing=FALSE)
## [1] 17.4 17.9 18.6 20.3 22.1 23.5 26.9 27.5 30.6 31.0 31.6 31.9
Ordenar datos de mayor a menor
sort(ob, decreasing=TRUE)
## [1] 31.9 31.6 31.0 30.6 27.5 26.9 23.5 22.1 20.3 18.6 17.9 17.4
Histogramas, poligonos y tablas de distribuciones de frecuencia.
Histograma de frecuencia absoluta
hist(ob)

Tabla de distribución de frecuencia
library(fdth)
##
## Attaching package: 'fdth'
## The following objects are masked from 'package:stats':
##
## sd, var
tabla <- fdt(ob)
tabla
## Class limits f rf rf(%) cf cf(%)
## [17.226,20.225) 3 0.25 25.00 3 25.00
## [20.225,23.223) 2 0.17 16.67 5 41.67
## [23.223,26.222) 1 0.08 8.33 6 50.00
## [26.222,29.22) 2 0.17 16.67 8 66.67
## [29.22,32.219) 4 0.33 33.33 12 100.00
Histogramas y poligonos
Absolutos
plot(tabla, type = "fh")

plot(tabla, type = "fp")

Relativos
plot(tabla, type = "rfh")

plot(tabla, type = "rfp")

Acumulados
plot(tabla, type = "cfh")

plot(tabla, type = "cfp")

Medidas de tendencia central
Moda
library(modeest)
##
## Attaching package: 'modeest'
## The following object is masked from 'package:fdth':
##
## mfv
mlv(ob, method="mfv")
## [1] 17.4 17.9 18.6 20.3 22.1 23.5 26.9 27.5 30.6 31.0 31.6 31.9
Cuantiles
summary(ob)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 17.40 19.88 25.20 24.94 30.70 31.90
Grafico de caja y bigotes
boxplot(ob)
