Vous êtes sur la page 1sur 4

TALLER DE APLICACIN

Basndose en los anteriores procedimientos construir intervalos y grficos para los siguientes
datos que corresponden a la edad de 50 microempresarios de la ciudad de Villavicencio

48

39

35

29

30

38

42

37

40

38

22

37

34

55

48

35

50

36

48

42

53

35

38

38

35

40

50

23

32

45

35

42

59

28

38

34

38

44

46

23

40

48

34

30

35

43

32

36

32

46

Solucin
R version 3.1.1 (2014-07-10) -- "Sock it to Me"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)
R es un software libre y viene sin GARANTIA ALGUNA.
Usted puede redistribuirlo bajo ciertas circunstancias.
Escriba 'license()' o 'licence()' para detalles de distribucion.
R es un proyecto colaborativo con muchos contribuyentes.
Escriba 'contributors()' para obtener ms informacin y
'citation()' para saber cmo citar R o paquetes de R en publicaciones.
Escriba 'demo()' para demostraciones, 'help()' para el sistema on-line de
ayuda,
o 'help.start()' para abrir el sistema de ayuda HTML con su navegador.
Escriba 'q()' para salir de R.
[Previously saved workspace restored]

>
datos=c(48,39,35,29,30,38,42,37,40,38,22,37,34,55,48,35,50,36,48,42,53,35
,38,38,35,40,50,23,32,45,35,42,59,28,38,34,38,44,46,23,40,48,34,30,35,43,
32,36,32,46

+ )
> datos
[1] 48 39 35 29 30 38 42 37 40 38 22 37 34 55 48 35 50 36 48 42 53 35 38
38 35
[26] 40 50 23 32 45 35 42 59 28 38 34 38 44 46 23 40 48 34 30 35 43 32 36
32 46
> Rang= max(datos)-min(datos)
> Rang
[1] 37
> m=round(1+3.3*log10(50))
> m
[1] 7
> C=Rang/m
> C
[1] 5.285714
> intervalos=cut(datos,
breaks=c(22,27.28,32.56,37.84,43.12,48.4,53.68,58.96))
> intervalos
[1] (43.1,48.4] (37.8,43.1] (32.6,37.8] (27.3,32.6] (27.3,32.6]
(37.8,43.1] (37.8,43.1] (32.6,37.8] (37.8,43.1] (37.8,43.1] <NA>
(32.6,37.8] (32.6,37.8] (53.7,59]
[15] (43.1,48.4] (32.6,37.8] (48.4,53.7] (32.6,37.8] (43.1,48.4]
(37.8,43.1] (48.4,53.7] (32.6,37.8] (37.8,43.1] (37.8,43.1] (32.6,37.8]
(37.8,43.1] (48.4,53.7] (22,27.3]
[29] (27.3,32.6] (43.1,48.4] (32.6,37.8] (37.8,43.1] <NA>
(27.3,32.6] (37.8,43.1] (32.6,37.8] (37.8,43.1] (43.1,48.4] (43.1,48.4]
(22,27.3]
(37.8,43.1] (43.1,48.4]
[43] (32.6,37.8] (27.3,32.6] (32.6,37.8] (37.8,43.1] (27.3,32.6]
(32.6,37.8] (27.3,32.6] (43.1,48.4]
Levels: (22,27.3] (27.3,32.6] (32.6,37.8] (37.8,43.1] (43.1,48.4]
(48.4,53.7] (53.7,59]
> f=table(intervalos)
> f
intervalos
(22,27.3] (27.3,32.6] (32.6,37.8] (37.8,43.1] (43.1,48.4] (48.4,53.7]
(53.7,59]
2
7
13
14
8
3
1
> n=sum(f)
> n
[1] 48
> h=f/n
> h
intervalos
(22,27.3] (27.3,32.6] (32.6,37.8] (37.8,43.1] (43.1,48.4] (48.4,53.7]
(53.7,59]
0.04166667 0.14583333 0.27083333 0.29166667 0.16666667 0.06250000
0.02083333
> F=cumsum(f)
> F
(22,27.3] (27.3,32.6] (32.6,37.8] (37.8,43.1] (43.1,48.4] (48.4,53.7]
(53.7,59]
2
9
22
36
44
47
48

> H=cumsum(h)
> H
(22,27.3] (27.3,32.6] (32.6,37.8] (37.8,43.1] (43.1,48.4] (48.4,53.7]
(53.7,59]
0.04166667 0.18750000 0.45833333 0.75000000 0.91666667 0.97916667
1.00000000
> cbind(f,h,F,H)
f
h F
H
(22,27.3]
2 0.04166667 2 0.04166667
(27.3,32.6] 7 0.14583333 9 0.18750000
(32.6,37.8] 13 0.27083333 22 0.45833333
(37.8,43.1] 14 0.29166667 36 0.75000000
(43.1,48.4] 8 0.16666667 44 0.91666667
(48.4,53.7] 3 0.06250000 47 0.97916667
(53.7,59]
1 0.02083333 48 1.00000000
> LimSup=c(27.3,32.6,37.8,43.1,48.4,53.7,59)
> LimInf=c(22,27.3,32.6,37.8,43.1,48.4,53.7)
> Marca= (LimSup+LimInf)/2
> Marca
[1] 24.65 29.95 35.20 40.45 45.75 51.05 56.35
> tabla=cbind(f,Marca,h,F,H)
> tabla
f Marca
h F
H
(22,27.3]
2 24.65 0.04166667 2 0.04166667
(27.3,32.6] 7 29.95 0.14583333 9 0.18750000
(32.6,37.8] 13 35.20 0.27083333 22 0.45833333
(37.8,43.1] 14 40.45 0.29166667 36 0.75000000
(43.1,48.4] 8 45.75 0.16666667 44 0.91666667
(48.4,53.7] 3 51.05 0.06250000 47 0.97916667
(53.7,59]
1 56.35 0.02083333 48 1.00000000
> hist(datos, breaks=c(22,27.3,32.6,37.8,43.1,48.4,53.7,59), col =
"blue", border = 1, main = "MICROEMPRESAS", xlab = "personas" , ylab =
"microempresarios")

> Prod=Marca*f
> cbind(f,Marca,Prod)
f Marca
Prod
(22,27.3]
2 24.65 49.30

(27.3,32.6] 7 29.95 209.65


(32.6,37.8] 13 35.20 457.60
(37.8,43.1] 14 40.45 566.30
(43.1,48.4] 8 45.75 366.00
(48.4,53.7] 3 51.05 153.15
(53.7,59]
1 56.35 56.35
> Media=sum(Prod)/n
> Media
[1] 38.71563
> Me=median(datos)
> Me
[1] 38
> summary(datos)
Min. 1st Qu. Median
Mean 3rd Qu.
Max.
22.00
34.25
38.00
38.70
43.75
59.00
> boxplot(datos)
> datos
[1] 48 39 35 29 30 38 42 37 40 38 22 37 34 55 48 35 50 36 48 42 53 35 38
38 35 40 50 23 32 45 35 42 59 28 38 34 38 44 46 23 40 48 34 30 35 43 32
36 32 46

>

Vous aimerez peut-être aussi