Академический Документы
Профессиональный Документы
Культура Документы
>
> #suscripcin al periodico () barplot(table(suscp),main=c("Susc
> suscp<- ripcin al
c("S","N","N","N","S","S","N","N" periodico"),col=c("orange","yello
,"S","N","N","N","S","N","N","N", w"))
"S");suscp
[1] "S" "N" "N" "N" "S" "S" "N"
"N" "S" "N" "N" "N" "S" "N" "N"
"N" "S"
> sort(suscp)
[1] "N" "N" "N" "N" "N" "N" "N"
"N" "N" "N" "N" "S" "S" "S" "S"
"S" "S"
> t.suscp<-table(suscp);t.suscp
suscp
N S
11 6
>
pie(c(6,11),c("Si","No"),main=c("
Suscripcin al
periodico"),col=c("yellow","orang
e")) > #Numero de personas por familia
> npf<-
c(2,3,3,5,4,7,2,4,2,5,3,6,4,4,2,5
,3);npf
[1] 2 3 3 5 4 7 2 4 2 5 3 6 4 4
2 5 3
> sort(npf) [1] 64
[1] 2 2 2 2 3 3 3 3 4 4 4 4 5 5 > prod(npf)
5 6 7 [1] 1741824000
> t.npf<-table(npf);t.npf > max(npf)
npf [1] 7
2 3 4 5 6 7 > min(npf)
4 4 4 3 1 1 [1] 2
> > range(npf)
boxplot(npf,horizontal=TRUE,col=" [1] 2 7
violet") > length(npf)
[1] 17
> mean(npf)
[1] 3.764706
> median(npf)
[1] 4
> var(npf)
[1] 2.191176
> sd(npf)
[1] 1.480262
> sd(npf)/mean(npf)
[1] 0.3931947
> IQR(npf)
[1] 2
> g<-((sum(npf-mean(npf))^3)/
(length(npf)-1))/(sd(npf)^3);g
[1] 1.350096e-47
> pie(table(npf),main=c("Nmero > k<-((sum(npf-mean(npf))^4)/
de personas por (length(npf)-1))/(sd(npf)^4);k
familia"),col=rainbow(5)) [1] 8.100768e-63
> #Ingreso
> stem(npf) > Ingreso<-
c(26.2,18.4,19.3,14.5,26.2,30.1,2
4.2,26.2,22.1,20.6,24.2,20.3,18.6
,15.2,17.9,19.4,28.2);Ingreso
[1] 26.2 18.4 19.3 14.5 26.2
30.1 24.2 26.2 22.1 20.6 24.2
20.3 18.6 15.2 17.9
[16] 19.4 28.2
> sort(Ingreso)
[1] 14.5 15.2 17.9 18.4 18.6
19.3 19.4 20.3 20.6 22.1 24.2
24.2 26.2 26.2 26.2
[16] 28.2 30.1
> t.Ingreso<-
table(Ingreso);t.Ingreso
Ingreso
14.5 15.2 17.9 18.4 18.6 19.3
19.4 20.3 20.6 22.1 24.2 26.2
28.2 30.1
The decimal point is at the | 1 1 1 1 1 1
1 1 1 1 2 3 1
2 | 00000000 1
4 | 0000000
6 | 00
> sum(npf)
>boxplot(Ingreso,col=c("cyan"),ma > min(Ingreso)
in=c("Ingreso"),horizontal=TRUE) [1] 14.5
> range(Ingreso)
[1] 14.5 30.1
> length(Ingreso)
[1] 17
> mean(Ingreso)
[1] 21.85882
> median(Ingreso)
[1] 20.6
> var(Ingreso)
[1] 20.56507
> sd(Ingreso)
[1] 4.534873
> sd(Ingreso)/mean(Ingreso)
[1] 0.2074619
> IQR(Ingreso)
[1] 7.6
> g<-((sum(Ingreso-
mean(Ingreso))^3)/
> (length(Ingreso)-1))/
pie(table(Ingreso),main=c("Ingres (sd(Ingreso)^3);g
o"),col=rainbow(10)) [1] -8.113888e-46
> #Activar paquete agricolae
> library(agricolae)
> #tabla de frecuencias
> classes<-
sturges.freq(Ingreso);classes;
$maximum
[1] 30.1
$minimum
[1] 14.5
$amplitude
[1] 17
$classes
[1] 5
#Ojiva
h<-graph.freq(Ingreso,plot=F)
points<-
ojiva.freq(h,type="l",col="red",f
rame=FALSE,
xlab="Limit of class",
ylab="Accumulated relative
frequency", main="ojiva")
grid(col="black")
pie(table(Costo),main=c("Costo"),
col=rainbow(9))
> #Costo
> k<-((sum(Costo-mean(Costo))^4)/
(length(Costo)-1))/
(sd(Costo)^4);k
[1] 1.485764e-58
barplot(table(Costo),main=c("Cost
o"),col=rainbow(14))
> stem(Costo)
7 | 6689
8 | 234
9 | 6
10 | 1224
> #Activar paquete agricolae
11 | 334
> library(agricolae)
12 | 23
> #tabla de frecuencias
> classes<-
> sum(Costo)
sturges.freq(Costo);classes;
[1] 164.8
$maximum
> prod(Costo)
[1] 12.3
[1] 4.663082e+16
> max(Costo)
$minimum
[1] 12.3
[1] 7.6
> min(Costo)
[1] 7.6
$amplitude
> range(Costo)
[1] 6
[1] 7.6 12.3
> length(Costo)
$classes
[1] 17
[1] 5
> mean(Costo)
[1] 9.694118
$interval
> median(Costo)
[1] 1.2
[1] 10.1
> var(Costo)
$breaks
[1] 2.734338
[1] 7.0 8.2 9.4 10.6 11.8 13.0
> sd(Costo)
> breaks<-classes$breaks;breaks
[1] 1.653583
[1] 7.0 8.2 9.4 10.6 11.8 13.0
> sd(Costo)/mean(Costo)
> h2<-hist(Costo,breaks
[1] 0.170576
=classes$breaks,plot=FALSE)
> IQR(Costo)
> table.freq(h2)
[1] 3.1
Lower Upper Main freq relative
> g<-((sum(Costo-mean(Costo))^3)/
CF RCF
(length(Costo)-1))/
7.0 8.2 7.6 5 0.2941176
(sd(Costo)^3);g
5 0.2941176
[1] 2.127808e-44
8.2 9.4 8.8 2 0.1176471
7 0.4117647
9.4 10.6 10.0 5 0.2941176
12 0.7058824
10.6 11.8 11.2 3 0.1764706
15 0.8823529
11.8 13.0 12.4 2 0.1176471
17 1.0000000
> #Poligono de frecuencias
> windows()
> h1<-
hist(Ingreso,border=FALSE,xlim=c(
40,56))
>
polygon.freq(h1,frequency=1,col="
violet")
> par(mfrow=c(1,2),cex=0.8)
> h1<-
graph.freq(Costo,col="orange",fre
quency=1,las=2,xlab="h1") #Ojiva
> h2<- graph.freq (Costo, windows()
frequency =2, axes= h<-graph.freq(costo,plot=F)
FALSE,las=2,xlab="h2") points<-
> polygon.freq(h2, col="green", ojiva.freq(h,type="l",col="red",f
lwd=2, frequency =2) rame=FALSE,
> TIC<- h2$breaks[2]- xlab="Limit of class",
h2$breaks[1] ylab="Accumulated relative
> axis(1,c(h2$mids[1]-TIC, frequency", main="ojiva")
h2$mids, grid(col="black")
h2$mids[6]+TIC ),cex=0.6)