Displaying 1 result from an estimated 1 matches for "chi2unif".
2003 Mar 25
1
BUG report : 'rnorm' (LINUX, R 1.6.2) (PR#2682)
Dear colleague,
unfortunately 'rnorm' does not create normal distributed numbers as
you can see with following histogramm:
> hist(rnorm(1000000),breaks=100)
and
> hist(pnorm(rnorm(1000000)),breaks=100)
I have done several chi^2-tests which have all failed:
> chi2unif<- function(x,N)
> {
> anz=length(x)
> f0<-rep(anz/N,times=N)
> fi<-(hist(x,g<-seq(length(N+1),from=0, by=1/N), plot=FALSE)[2])
> fin<-fi[[1]][1:N]
> chi2=sum( ((f0-fin)^2)/f0 )
> pchisq(chi2,N-1)
> }
> chi2unif(x<-pnorm(rnorm(10000...