programación de la prueba de kolmogorov smirnov

3
Programación de la prueba de kolmogorov Smirnov. # Prueba de normalidad. Pesos (en gramos) vc05 <- 0.2940701 # semilla dat <- sort(c(156, 162,168, 182, 186, 190, 190, 196, 202, 210, 214, 220, 226, 230, 230, 236, 236, 242, 246, 270)) datu <- unique(dat) n <- length(dat) nu <- length(datu) aa <- table(dat) edf <- cumsum(aa)/n edf0 <- c(0,edf[-nu]) xx <- seq(150,275,length=200) yy <- pnorm(xx,mean=200,sd=35) ye <- pnorm(datu,mean=200,sd=35) yy <- pnorm(xx,mean=mean(dat),sd=sd(dat)) # usando estimaciones los ye <- pnorm(datu,mean=mean(dat),sd=sd(dat)) # valores criticos no validos Dn <- max(max(abs(ye-edf)),max(abs(ye-edf0))) ii <- which(Dn == pmax(abs(ye-edf),abs(ye-edf0)))[1] if( abs(ye[ii] -edf[ii]) ==Dn ){ yD <- edf[ii] }else{ yD <- edf0[ii] } plot(datu,edf, xlim=c(150,275), ylim=c(0,1.05), mgp=c(1.5,.5,0), xlab="", ylab="", cex.axis=.8, cex.lab=.8,type="n",

Upload: solangesardanmatijasevic

Post on 29-Sep-2015

21 views

Category:

Documents


14 download

DESCRIPTION

Prueba de Kolmogorov en simulación para números aleatorios

TRANSCRIPT

Programacin de la prueba de kolmogorov Smirnov.

# Prueba de normalidad. Pesos (en gramos)vc05