Distribución de Medias
Distribución de Medias
Distribución de Medias
library(gtools)
N <- 6
n<- 3
P <- c(1:N)
C <- combinations(N,n,secre)
c1 <- C[1,]
mean(v)
m <- rowMeans(C)
mf <- apply(C,1,mean)
mean(m)
mean(mf)
mean(P)
sd(P)
1.870829^2
d <- apply(C,1,sd)
v <- apply(C,1,var)
mean(v)
mean(d)
sqrt(3.5)
hist(m)
table(round(m,2))
tm <- table(round(m,2))
pm <- prop.table(tm)
plot(pm)
#Distribuciones
names(Bsec1ec)
boxplot(Bsec1ec$Edad)
hist(Bsec1ec$Edad)
#Retiro de un dato
boxplot(Nbsec10$Edad)
hist(Nbsec10$Edad)
lines(density(Nbsec10$Edad))
boxplot(Nbsec25$Edad)
hist(Nbsec25$Edad)
table(Nbsec25$Edad)
lines(density(Nbsec25$Edad))
e <- Nbsec25$Edad
table(e)
mean(e)
median(e)
library(moments)
library(modeest)
mfv(e)
m <-mean(e)
sd(e)
s <-sd(e)
hist(e)
lines(density(e))
z <- (e-mean(e))/sd(e)
mean(z)
sd(z)
hist(z)
boxplot(Nbsec25$Edad,col =c("green"))
#generalizando z
z <- seq(-4,4,length=1000)#
mean(z)
sd(z)
#Con función de R
y=dnorm(z,mean=0,sd=1)
plot(z,y,type="l",lwd=2,col="green")
abline(v=2,lty=10,col="blue")
abline(v=-2,lty=20,col="brown")
#Calculo de probabilidad
pnorm(21,mean=20,sd=1.231312,lower.tail = TRUE)
pnorm(21,mean=20,sd=1.231312,lower.tail = FALSE)
ppi <-p32-p28
z1 <- (34-29.65)/3.73
pnorm(z1)
#Distribución t
df = c(1,4,10,30)
for (i in 1:4){
legend("topright", c("df = 1", "df = 4", "df = 10", "df = 30", "normal"),
s<- dt(s, df = 3)
a<- pt(g, df = 3)
#Distribución chi
curve(dchisq(x,2),col="red",lty=2,add=TRUE)
curve(dchisq(x,3),col="blue",lty=3,add=TRUE)
curve(dchisq(x,5),col="dark green",lty=4,add=TRUE)
curve(dchisq(x,10),col="brown",lty=5,add=TRUE)
legend(12,0.55,c("k=1","k=2","k=3","k=5","k=10"),
col=c("black","red","blue","dark green","brown"),lty=1:5)
###F distribución
y=df(x=xp,df1=4,df2=44)
F.critico=3.061
col = "blue")
y <- dnorm(x)
xv <- seq(-2, 2)
px <- dnorm(xv)
#Creando la distribución t
lwd = 2,
col = 'blue')
ylab = 'Density',
lwd = 2)
#Creando distribución F
F.critico=2.061
y=df(x=xp,df1=10,df2=60)
col = "blue")