[R] Variance Computing- - HELP!!!!!!!!!!!!!!!!!!

Tony Plate tplate at blackmesacapital.com
Tue Aug 19 20:11:36 CEST 2003

Perhaps you were trying for "as sample size increases, variance *of the 
mean* decreases" (a least when variance is finite).  If you swap "mean" and 
"var" in your code, I think you will get what you are looking for.

-- Tony Plate

At Tuesday 05:42 PM 8/19/2003 +0000, Padmanabhan, Sudharsha wrote:

>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.
>for(i in 1:1000){large[i,]<-rnorm(1000,0,3)}
>for(i in 1:1000){small[i,]<-rnorm(100,0,3)}}
>for(i in 1:100){yy[i]<-var(small[i,])}
>for(i in 1:1000){y1y[i]<-var(large[i,])}
>[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????
>R-help at stat.math.ethz.ch mailing list

More information about the R-help mailing list