[R] how to estimate distribution?

Simone Gabbriellini simone.gabbriellini at gmail.com
Wed Mar 4 16:01:39 CET 2009


Dear R-Experts,

I have an empirical dataset with 150 subjects for 24 observations.
In each observation, each subject can have a score in the range 0:3.

I made then a simple index making the sum of the values in each row,
so each subject have a score between 0 and 72.

I was thinking about what kind of theoretical distribution such an
index should have, so I try to make things random like:

data<-array(0,c(150,24))
data2<-array(0, c(150, 100))
for (prova in 1:100){
	for (i in 1:24){
		for (q in 1:150){
			data[q,i]<-sample(0:3, 1)
			}
		}
	for (riga in 1:150){
		data2[riga,prova]<-sum(data[riga,])
		}
	}

now here you can find the plotted theoretical values (black) against
the empirical ones (red):

http://www.digitaldust.it/papers/indice.png

How can I estimate the density of both distribution? because the red
one looks like a pareto distribution, but I am not an expert...

many thanks,
Simone




More information about the R-help mailing list