[R] Physical or Statistical Explanation for the "Funnel" Plot?

Jason Rupert jasonkrupert at yahoo.com
Fri Mar 27 03:44:04 CET 2009


The R code below produces (after running for a few minutes on a decent computer) the plot shown at the following location:

http://n2.nabble.com/Is-there-a-physical-and-quantitative-explanation-for-this-plot--td2542321.html

I'm just taking the mean of a given set of random variables, where the set size is increased.  There appears to be a quick convergence and then a pretty steady variance out to a set size of 10,0000.  

I'm just wondering if there is a statistical explanation out there for this convergence and it has been explored further.  Thanks again. 

# First case
N<-100000
X<-rnorm(N)
step_size<-1


# Groups
g<-rep(1:(N/step_size),each=step_size)

# The result
tmp_output<-tapply(X[1:length(g)],g,mean)

length_tmp_output<-length(tmp_output)
tmp_x_vals<-rep(step_size,length_tmp_output)
plot(tmp_x_vals, tmp_output, xlim=c(0,10000))
#points(tmp_x_vals, tmp_output)

for(ii in 1:10000)
{   
	step_size<-ii

	# Groups
	g<-rep(1:(N/step_size),each=step_size)

	# The result
	#tmp_output<-tapply(X,g,mean)
	tmp_output<-tapply(X[1:length(g)],g,mean)

	length_tmp_output<-length(tmp_output)
	tmp_x_vals<-rep(step_size,length_tmp_output)
	points(tmp_x_vals, tmp_output)
}




More information about the R-help mailing list