Ejercicio 2 segundo corte

3
>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,3 2,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 > C=6 > min(datos) [1] 22 > max(datos) [1] 59 > intervalos=cut(datos,breaks=c(19,25,31,37,43,49,55,61)) > intervalos [1] (43,49] (37,43] (31,37] (25,31] (25,31] (37,43] (37,43] (31,37] (37,43] [10] (37,43] (19,25] (31,37] (31,37] (49,55] (43,49] (31,37] (49,55] (31,37] [19] (43,49] (37,43] (49,55] (31,37] (37,43] (37,43] (31,37] (37,43] (49,55] [28] (19,25] (31,37] (43,49] (31,37] (37,43] (55,61] (25,31] (37,43] (31,37] [37] (37,43] (43,49] (43,49] (19,25] (37,43] (43,49] (31,37] (25,31] (31,37] [46] (37,43] (31,37] (31,37] (31,37] (43,49] Levels: (19,25] (25,31] (31,37] (37,43] (43,49] (49,55] (55,61] > f=table(intervalos) > f intervalos (19,25] (25,31] (31,37] (37,43] (43,49] (49,55] (55,61] 3 4 16 14 8 4 1 > n=sum(f) > n [1] 50 > h=(f/n)*100 > h intervalos (19,25] (25,31] (31,37] (37,43] (43,49] (49,55] (55,61] 6 8 32 28 16 8 2 > F=cumsum(f) > F (19,25] (25,31] (31,37] (37,43] (43,49] (49,55] (55,61] 3 7 23 37 45 49 50

Transcript of Ejercicio 2 segundo corte

Page 1: Ejercicio 2 segundo corte

>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,3 2,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 > C=6 > min(datos) [1] 22 > max(datos) [1] 59 > intervalos=cut(datos,breaks=c(19,25,31,37,43,49,55,61)) > intervalos [1] (43,49] (37,43] (31,37] (25,31] (25,31] (37,43] (37,43] (31,37] (37,43] [10] (37,43] (19,25] (31,37] (31,37] (49,55] (43,49] (31,37] (49,55] (31,37] [19] (43,49] (37,43] (49,55] (31,37] (37,43] (37,43] (31,37] (37,43] (49,55] [28] (19,25] (31,37] (43,49] (31,37] (37,43] (55,61] (25,31] (37,43] (31,37] [37] (37,43] (43,49] (43,49] (19,25] (37,43] (43,49] (31,37] (25,31] (31,37] [46] (37,43] (31,37] (31,37] (31,37] (43,49] Levels: (19,25] (25,31] (31,37] (37,43] (43,49] (49,55] (55,61] > f=table(intervalos) > f intervalos (19,25] (25,31] (31,37] (37,43] (43,49] (49,55] (55,61] 3 4 16 14 8 4 1 > n=sum(f) > n [1] 50 > h=(f/n)*100 > h intervalos (19,25] (25,31] (31,37] (37,43] (43,49] (49,55] (55,61] 6 8 32 28 16 8 2 > F=cumsum(f) > F (19,25] (25,31] (31,37] (37,43] (43,49] (49,55] (55,61] 3 7 23 37 45 49 50

Page 2: Ejercicio 2 segundo corte

> H=cumsum(h) > H (19,25] (25,31] (31,37] (37,43] (43,49] (49,55] (55,61] 6 14 46 74 90 98 100 > cbind(f,h,F,H) f h F H (19,25] 3 6 3 6 (25,31] 4 8 7 14 (31,37] 16 32 23 46 (37,43] 14 28 37 74 (43,49] 8 16 45 90 (49,55] 4 8 49 98 (55,61] 1 2 50 100 > LimSup=c(25,31,37,43,49,55,61) > LimInf=c(19,25,31,37,43,49,55) > Marca=(LimSup+LimInf)/2 > Marca [1] 22 28 34 40 46 52 58 > cbind(f,Marca,h,F,H) f Marca h F H (19,25] 3 22 6 3 6 (25,31] 4 28 8 7 14 (31,37] 16 34 32 23 46 (37,43] 14 40 28 37 74 (43,49] 8 46 16 45 90 (49,55] 4 52 8 49 98 (55,61] 1 58 2 50 100 > X=Marca*f > X intervalos (19,25] (25,31] (31,37] (37,43] (43,49] (49,55] (55,61] 66 112 544 560 368 208 58 > Media=sum(X)/n > Media [1] 38.32 > cbind(f,h,F,H,Marca,X) f h F H Marca X (19,25] 3 6 3 6 22 66 (25,31] 4 8 7 14 28 112 (31,37] 16 32 23 46 34 544 (37,43] 14 28 37 74 40 560 (43,49] 8 16 45 90 46 368 (49,55] 4 8 49 98 52 208 (55,61] 1 2 50 100 58 58

Page 3: Ejercicio 2 segundo corte

> hist(datos, col = "green", border = 1, main = "Edad Microempresarios", xlab = "Edad" , ylab = "frecuencia") > plot(LimInf, F) > lines(c(min(LimInf), LimInf,max(LimSup)),c(0,F,0),type="l")