Está en la página 1de 4

tabla de frecuencia datos agrupados

datos=c(200,190,150,148,152,158,100,174,187,188,160,178,153,151,128,137,174,199,103,168,18
8,127,150,130,175)
> datos
[1] 200 190 150 148 152 158 100 174 187 188 160 178 153 151 128 137 174 199 103 168 188 127
150 130 175
> max(datos)
[1] 200
> min(datos)
[1] 100
> Rango=max(datos)-min(datos)
> Rango
[1] 100
> n=round(1+3.3*log10(25))
>n
[1] 6
> C=Rango/n
>C
[1] 16.66667
> C=17
> C*n
[1] 102
> Inicio=min(datos)-1
> Inicio
[1] 99
> Final=max(datos)+1
> Final
[1] 201
> cbind(Inicio,Final)
Inicio Final

[1,]

99 201

> Intervalos=cut(datos, breaks(99,116,133,150,167,184,201))


Error en cut.default(datos, breaks(99, 116, 133, 150, 167, 184, 201)) :
no se pudo encontrar la funcin "breaks"
> Intervalos=cut(datos, breaks=c(99,116,133,150,167,184,201))
> Intervalos
[1] (184,201] (184,201] (133,150] (133,150] (150,167] (150,167] (99,116] (167,184] (184,201]
(184,201] (150,167] (167,184] (150,167] (150,167] (116,133] (133,150]
[17] (167,184] (184,201] (99,116] (167,184] (184,201] (116,133] (133,150] (116,133] (167,184]
Levels: (99,116] (116,133] (133,150] (150,167] (167,184] (184,201]
> f=table(Intervalos)
>f
Intervalos
(99,116] (116,133] (133,150] (150,167] (167,184] (184,201]
2

> n=sum(f)
>n
[1] 25
> h=f/n
>h
Intervalos
(99,116] (116,133] (133,150] (150,167] (167,184] (184,201]
0.08

0.12

0.16

0.20

0.20

0.24

> h*100
Intervalos
(99,116] (116,133] (133,150] (150,167] (167,184] (184,201]
8

12

> F=cumsum(F)
>F

16

20

20

24

[1] 0
> F=cumsum(f)
>F
(99,116] (116,133] (133,150] (150,167] (167,184] (184,201]
2

14

19

25

> H=cumsum(h)
>H
(99,116] (116,133] (133,150] (150,167] (167,184] (184,201]
0.08

0.20

0.36

0.56

0.76

> cbind(f,F,h,H)
f F h H
(99,116] 2 2 0.08 0.08
(116,133] 3 5 0.12 0.20
(133,150] 4 9 0.16 0.36
(150,167] 5 14 0.20 0.56
(167,184] 5 19 0.20 0.76
(184,201] 6 25 0.24 1.00
> LimSuo=c(116,133,150,167,184,201)
> LimSup=c(116,133,150,167,184,201)
> limInf=c(99,116,133,150,167,184)
> Marca=(LinSup+LinInf)/2
Error: objeto 'LinSup' no encontrado
> Marca=(LimSup+LimInf)/2
Error: objeto 'LimInf' no encontrado
> LimInf=c(99,116,133,150,167,184)
> Marca=(LimSup+LimInf)/2
> Marca
[1] 107.5 124.5 141.5 158.5 175.5 192.5
> cbind(f,Marca,F,h,H)

1.00

f Marca F h H
(99,116] 2 107.5 2 0.08 0.08
(116,133] 3 124.5 5 0.12 0.20
(133,150] 4 141.5 9 0.16 0.36
(150,167] 5 158.5 14 0.20 0.56
(167,184] 5 175.5 19 0.20 0.76
(184,201] 6 192.5 25 0.24 1.00
> f.Marca=f*Marca
> f.Marca
Intervalos
(99,116] (116,133] (133,150] (150,167] (167,184] (184,201]
215.0

373.5

566.0

792.5

877.5 1155.0

> sum(f.Marca)
[1] 3979.5
> Media=sum(f.Marca)/n
> Media
[1] 159.18
> summary(datos)
Min. 1st Qu. Median Mean 3rd Qu. Max.
100.0 148.0 158.0 158.7 178.0 200.0

> hist(datos, col = "green", border = 1, main = "Ahorros Voluntarios", xlab = "Ahorro" , ylab =
"frecuencia")
> boxplot(datos,notch=TRUE,col=(c("green")),main="ahorros",xlab="Docentes")
> boxplot(datos)

También podría gustarte