Está en la página 1de 1

>

>
>
>
>
>
>
>

encuesta=read.csv(file.choose())
attach(encuesta)
b=c(9,89,169,249,329,409,489,569,649,729,809,889,969,1049,1129)
hist(ingreso,breaks=b)
h=hist(ingreso,breaks=b)
plot(h$mids,h$counts)
lines(h$mids,h$counts,col="red")

Group.1
x
1 1 No complet el bachillerato 59.86619
2
2 Bachillerato 66.20713
3
3 Universitarios parciales 70.13456
4
4 Universitarios 78.65018
5
5 Post-universitarios 87.16992
> aggregate(ingreso,list(educacion),sd)
Group.1
x
1 1 No complet el bachillerato 61.30036
2
2 Bachillerato 72.72591
3
3 Universitarios parciales 81.03878
4
4 Universitarios 92.87753
5
5 Post-universitarios 94.79998
> boxplot(encuesta$ingreso~encuesta$satlab)
> x=rep(0,length(ingreso))
> x[(ingreso>100)]=1
> barplot(table(x,educacion))
> ese=function(y){tmp=sum(abs(y-mean(y))/(mean(y)*length(y)))}
> ss=ese(edad)
1.636875
> ele=function(y){tmp=sum(abs(y-mean(y))/length(y))}
> dd=ele(edad)
0.2971951

También podría gustarte