library(ggplot2)
## Warning: package 'ggplot2' was built under R version 3.5.3
library(dplyr)
## Warning: package 'dplyr' was built under R version 3.5.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(Hmisc)
## Warning: package 'Hmisc' was built under R version 3.5.3
## Loading required package: lattice
## Loading required package: survival
## Loading required package: Formula
## Warning: package 'Formula' was built under R version 3.5.2
##
## Attaching package: 'Hmisc'
## The following objects are masked from 'package:dplyr':
##
## src, summarize
## The following objects are masked from 'package:base':
##
## format.pval, units
library(corrplot)
## Warning: package 'corrplot' was built under R version 3.5.3
## corrplot 0.84 loaded
Y <- c(250,220,200,350,210,205,285,190)
X1 <- c(76,61,50,94,55,61,80,52)
X2 <- c(80,72,70,122,75,95,120,68)
X3 <- c(13.5,12.1,11.6,12.5,13.5,14,12.5,14.5)
plot(density(Y))
plot(density(X1))
plot(density(X2))
plot(density(X3))
#### 2. Muestre un breve análisis estadístico para cada variable recuerde que puede usar summary().
summary(Y)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 190.0 203.8 215.0 238.8 258.8 350.0
summary(X1)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 50.00 54.25 61.00 66.12 77.00 94.00
summary(X2)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 68.00 71.50 77.50 87.75 101.25 122.00
summary(X3)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 11.60 12.40 13.00 13.03 13.62 14.50
matriz <- as.matrix(Y,X1,X2,X3)
rcorr(matriz)
## [,1]
## [1,] 1
##
## n= 8
##
##
## P
## [,1]
## [1,]
correlacion<-round(cor(matriz), 1)
corrplot(correlacion, method="number", type="upper")