Re: [R] feed cut() output into goodness-of-fit tests

2010-10-15 Thread Phil Spector
Andrei - Looking inside the code for cut, it looks like you could retrieve the breaks as follows: getbreaks = function(x,nbreaks){ nb = nbreaks + 1 dx = diff(rx <- range(x,na.rm=TRUE)) seq.int(rx[1] - dx/1000,rx[2] + dx/1000,length.out=nb) } The dx/1000 is what makes cut()'s br

Re: [R] feed cut() output into goodness-of-fit tests

2010-10-15 Thread Ista Zahn
On Fri, Oct 15, 2010 at 10:22 AM, Andrei Zorine wrote: > Hello, > My question is assuming I have cut()'ed my sample and look at the > table() of it, how can I compute probabilities for the bins? I actually don't know what you mean by this (my own ignorance probably). Do I have > to parse table'

[R] feed cut() output into goodness-of-fit tests

2010-10-15 Thread Andrei Zorine
Hello, My question is assuming I have cut()'ed my sample and look at the table() of it, how can I compute probabilities for the bins? Do I have to parse table's names() to fetch bin endpoints to pass them to p[distr-name] functions? i really don't want to input arguments to PDF functions by hand (n