John Sorkin wrote:
> R 2.3.1
> Windows XP 
>
> I am surprised at the lack of precision in R, as noted below. I would
> expect the values to be closer to zero, particularly the later examples
> where the sample size is quite large.
>
>   
>> mean(rnorm(500,0,1))
>>     
> [1] -0.03209727
>   
>> mean(rnorm(5000,0,1))
>>     
> [1] -0.005991322
>   
>> mean(rnorm(50000,0,1))
>>     
> [1] -0.0006160524
>   
>> mean(rnorm(500000,0,1))
>>     
> [1] -0.001254309
>   
>> mean(rnorm(5000000,0,1))
>>     
> [1] 0.0004633778
>   
>> mean(rnorm(50000000,0,1))
>>     
> [1] -0.0001325764
>
> I would appreciate any thoughts. Is the lack of precision due to
> running on a 32-bit system?
>
> Thanks,
> John
>
>
> J

Looks OK to me. The theoretical SEM in the latter case is 
sqrt(1/5e7)==0.0001414214.

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to