Re: [R] Goodness of fit for gamma distributions

2009-01-29 Thread Albyn Jones
it is easy to make a qqplot for the gamma; suppose that the sample parameters are 1.101 and 2.49, the data in x: plot(qgamma(ppoints(x),1.101,2.49),sort(x)) see also lattice:qqmath albyn Quoting Dan31415 : Ah yes, that does produce a nice plot. Can i just ask what exactly it is sho

Re: [R] Goodness of fit for gamma distributions

2009-01-29 Thread Dan31415
Ah yes, that does produce a nice plot. Can i just ask what exactly it is showing. It seems to me to be a sort of Q-Q plot but with a different set of axes. Is this correct, if so do the same interpretation rules apply for this plot, i.e. departures from either end of the curve show poor fitting of

Re: [R] Goodness of fit for gamma distributions

2009-01-27 Thread Remko Duursma
It sounds like you just want to graph it though. For gammas, it's nice to graph the log of the density, because the tail is so thin and long, so you don't see much otherwise: mydata <- rgamma(1, shape=1.1, rate=2.5) # now suppose you fit a gamma distribution, and get these estimated parameter

Re: [R] Goodness of fit for gamma distributions

2009-01-27 Thread Dan31415
Thanks for that Remko, but im slightly confused because isnt this testing the goodness of fit of 2 slightly different gamma distributions, not of how well a gamma distribution is representing the data. e.g. data.vec<-as.vector(data) (do some mle to find the parameters of a gamma distribution fo

Re: [R] Goodness of fit for gamma distributions

2009-01-27 Thread Remko Duursma
Hi Dann, there is probably a better way to do this, but this works anyway: # your data gamdat <- rgamma(1, shape=1, rate=0.5) # comparison to gamma: gamsam <- rgamma(1, shape=1, rate=0.6) qqplot(gamsam,gamdat) abline(0,1) greetings Remko -

[R] Goodness of fit for gamma distributions

2009-01-26 Thread Dan31415
I'm looking for goodness of fit tests for gamma distributions with large data sizes. I have a matrix with around 10,000 data values in it and i have fitted a gamma distribution over a histogram of the data. The problem is testing how well that distribution fits. Chi-squared seems to be used more