What is the ditribution of the number og observations falling in a bin?
In other words, if we generate a 1000 r.n froma particular
distributions and we constructed a histogram of the the 1000 r.n and
then we count the number of points falling in a bin. What would be the
distribution of the proportion of observations falling within a
particular bin? For those who use S-Plus what's wrong with my function:

function(x, y)
{
        count <- matrix(rep(0, length(x) - 1), nrow = length(x) - 1)
        p <- matrix(rep(0, length(x) - 1), nrow = length(x) - 1)
        for(i in 1:length(x) - 1) {
                count[i] <- sum(x[i] < y & y <= x[i + 1])
                p[i] <- count[i]/length(y)
        }
        return(count, p)
}

Thanx,

Mark


Sent via Deja.com http://www.deja.com/
Before you buy.


=================================================================
Instructions for joining and leaving this list and remarks about
the problem of INAPPROPRIATE MESSAGES are available at
                  http://jse.stat.ncsu.edu/
=================================================================

Reply via email to