Para iniciar vamos a utilizar las librerias ade4, FactoClass y FactoMineR. La base de datos es decathlon con informacion de deportistas y su rendimiento en diversas competencias olimpicas.
require(ade4)
require(FactoClass)
require(FactoMineR)
data("decathlon")
decathlon2=decathlon[,1:10]
head(decathlon2,4)
## 100m Long.jump Shot.put High.jump 400m 110m.hurdle Discus Pole.vault
## SEBRLE 11.04 7.58 14.83 2.07 49.81 14.69 43.75 5.02
## CLAY 10.76 7.40 14.26 1.86 49.37 14.05 50.72 4.92
## KARPOV 11.02 7.30 14.77 2.04 48.37 14.09 48.95 4.92
## BERNARD 11.02 7.23 14.25 1.92 48.93 14.99 40.87 5.32
## Javeline 1500m
## SEBRLE 63.19 291.7
## CLAY 60.15 301.5
## KARPOV 50.31 300.2
## BERNARD 62.77 280.1
Se realiza un resumen de indicadores descriptivos por cada variable y graficos de cajas.
## Resumen de Indicadores Descriptivos
summary(decathlon2)
## 100m Long.jump Shot.put High.jump 400m
## Min. :10.44 Min. :6.61 Min. :12.68 Min. :1.850 Min. :46.81
## 1st Qu.:10.85 1st Qu.:7.03 1st Qu.:13.88 1st Qu.:1.920 1st Qu.:48.93
## Median :10.98 Median :7.30 Median :14.57 Median :1.950 Median :49.40
## Mean :11.00 Mean :7.26 Mean :14.48 Mean :1.977 Mean :49.62
## 3rd Qu.:11.14 3rd Qu.:7.48 3rd Qu.:14.97 3rd Qu.:2.040 3rd Qu.:50.30
## Max. :11.64 Max. :7.96 Max. :16.36 Max. :2.150 Max. :53.20
## 110m.hurdle Discus Pole.vault Javeline
## Min. :13.97 Min. :37.92 Min. :4.200 Min. :50.31
## 1st Qu.:14.21 1st Qu.:41.90 1st Qu.:4.500 1st Qu.:55.27
## Median :14.48 Median :44.41 Median :4.800 Median :58.36
## Mean :14.61 Mean :44.33 Mean :4.762 Mean :58.32
## 3rd Qu.:14.98 3rd Qu.:46.07 3rd Qu.:4.920 3rd Qu.:60.89
## Max. :15.67 Max. :51.65 Max. :5.400 Max. :70.52
## 1500m
## Min. :262.1
## 1st Qu.:271.0
## Median :278.1
## Mean :279.0
## 3rd Qu.:285.1
## Max. :317.0
##Grafico de Cajas
require(ggplot2)
require(plotly)
g1=ggplot(data=decathlon,aes(y=Long.jump,x=Competition,fill=Competition))+geom_boxplot()+theme_bw()
ggplotly(g1)
##Grafico de Dispercion
g2=ggplot(data=decathlon,aes(x=`400m`,y=Long.jump,fill=Competition))+geom_point()+geom_smooth(method = "lm")+theme_bw()
ggplotly(g2)