[R] Variance Computing- - HELP!!!!!!!!!!!!!!!!!!
Padmanabhan, Sudharsha
sudAR_80 at neo.tamu.edu
Tue Aug 19 19:42:40 CEST 2003
Hello,
I am running a few simulations for clinical trial anlysis. I want some help
regarding the following.
We know trhat as the sample size increases, the variance should decrease, but
I am getting some unexpected results. SO I ran a code (shown below) to check
the validity of this.
large<-array(1,c(1000,1000))
small<-array(1,c(100,1000))
for(i in 1:1000){large[i,]<-rnorm(1000,0,3)}
for(i in 1:1000){small[i,]<-rnorm(100,0,3)}}
yy<-array(1,100)
for(i in 1:100){yy[i]<-var(small[i,])}
y1y<-array(1,1000)
for(i in 1:1000){y1y[i]<-var(large[i,])}
mean(yy);mean(y1y);
[1] 8.944
[1] 9.098
This shows that on an average,for 1000 such samples of 1000 Normal numbers,
the variance is higher than that of a 100 samples of 1000 random numbers.
Why is this so?
Can someone please help me out????
Thanks.
Regards
~S.
More information about the R-help
mailing list