Professional Documents
Culture Documents
Tarea 1 R
Tarea 1 R
2022-07-04
#1.2
l=c(8.9,12.4,8.6,11.3,9.2,8.8,NA,6.2,7.0,
7.1,11.8,10.7,7.6,9.1,9.2,8.2,9.0,8.7,
9.1,10.9,10.3,9.6,7.8,11.5,9.3,7.9,8.8,
8.8,12.7,8.4,7.8,5.7,10.5,10.5,9.6,8.9,
10.2,10.3,7.7,10.6,8.3,8.8,9.5,8.8,9.4)
datos=matrix(l,nrow=9,ncol=5)
datos
##
## Attaching package: 'fdth'
## The following objects are masked from 'package:stats':
##
## sd, var
tabla=fdt(l,breaks = "Sturges",exclude=max(datos),na.rm=TRUE)
tabla
1
Histogram of datos
12
10
Frequency
8
6
4
2
0
6 8 10 12
datos
#1.8
x=c(21,21,45,45,46,47,47,48,50,57,57,67,68,71,84,86,89,90,92,93,96)
b=mean(x)
b
## [1] 62.85714
x_cen=x-b
x_cen
## [1] 6.394885e-14
#1.12
becarios=143
investigador=64
docencia=becarios-investigador
#1.13
x1=sort(c(4,8,2,5,7,9))
mean(x1)
## [1] 5.833333
median(x1)
2
## [1] 6
#No hay moda
y=2*x1+3
y
## [1] 7 11 13 17 19 21
mean(y)
## [1] 14.66667
median(y)
## [1] 15
#No hay moda
z=2*x1-3
z
## [1] 1 5 7 11 13 15
mean(z)
## [1] 8.666667
median(z)
## [1] 9
#No hay moda
## [1] 2 3 4 5 7 7 8 9 10 11
mean(x)
## [1] 6.6
library(modeest)
##
## Attaching package: 'modeest'
## The following object is masked from 'package:fdth':
##
## mfv
mfv(x)
## [1] 7
median(x)
## [1] 7
xgeo=(11*4*7*5*2*3*9*8*7)ˆ0.1
xgeo
## [1] 4.643124
3
xarm=length(x)/(1/11+1/4+1/7+1/5+1/2+1/3+1/9+1/8+1/7)
xarm
## [1] 5.274073
#1.58 Coeficiente de variacion
x=c(11,4,7,5,2,3,9,8,7)
x=sort(x)
x
## [1] 2 3 4 5 7 7 8 9 11
mean(x)
## [1] 6.222222
sd(x)
## [1] 2.948634
c_var=(sd(x)/mean(x))*100
c_var
## [1] 47.38877
#1.29 Diagramas de caja
x=c(15,36,36,43,45,53,56,61)
y=c(23,24,26,27,28,29,30,32)
z=c(4,9,12,12,16,24,35,46)
boxplot(x,main="Cantidad de SO2 (X)",horizontal=TRUE,col="RED")
20 30 40 50 60
boxplot(y,main="Cantidad de SO2 (Y)",horizontal=TRUE,col="BLUE")
4
Cantidad de SO2 (Y)
24 26 28 30 32
boxplot(z,main="Cantidad de SO2 (Z)",horizontal=TRUE,col="PURPLE")
10 20 30 40
#Probabilidad
sum(x>25)/length(x)
## [1] 0.875
#1.28 Vector de medias de la muestra, la matriz de varianzas y covarianzas, y la matriz de Correlacion d
b1=c(43,36,45,61,53,15,36,36)
b2=c(28,26,29,32,27,23,30,24)
b3=c(12,9,46,35,24,4,16,12)
5
datos1=matrix(c(b1,b2,b3),nrow=length(b1),ncol=3)
datos1