[R] Fwd: Re: Goodness-of-fit test for gamma distribution?

Sean Connolly sean.connolly at jcu.edu.au
Fri May 18 09:35:58 CEST 2007

Thanks Petr. Comments below:

At 03:40 PM 18/05/2007, Petr Klasterecky wrote:

>Sean Connolly napsal(a):
>>Hi all,
>>I am wondering if anyone has written (or knows of) a function that 
>>will conduct a goodness-of-fit test for a gamma distribution. I am 
>>especially interested in test statistics have some asymptotic 
>>parametric distribution that is independent of sample size or 
>>values of fitted parameters (e.g., a chi-squared distribution with some

Petr's reply:

>The GOF test will always depend on the parameter values, since it 
>has to estimate them (if you don't provide them yourself). Anyway, 
>the gamma family is so versatile that you can fit *some* gamma 
>distribution to almost any nonnegative continuous data.

Sean's reply to Petr:

An example of what I'm looking for would be the "K-squared" statistic 
that tests for normality (D'Agostino and Pearson 1973, Biometrika 60: 
613, also in Zar, 1996, Biostatistical Analysis, p89). The expected 
distribution of the test statistic is approximately chi-squared with 
2df, regardless of values of estimated parameters or sample size 
(provided sample size is sufficiently large).

Petr's reply:

>Maybe it is easier and sufficient to use the Kolmogorov - Smirnov 
>test, that is implemented as ks.test() in R. However, I am not able 
>to check your reference, so my comment may not be what you want at all.

Sean's reply to Petr:

My understanding is that the K-S test requires that parameters be 
specified (i.e., not estimated from data), and that the test 
statistic depends on sample size. Am I missing something?

Thanks again.


>>Sean R. Connolly, PhD
>>Associate Professor
>>ARC Centre of Excellence for Coral Reef Studies, and
>>School of Marine and Tropical Biology
>>James Cook University
>>Townsville, QLD 4811
>>R-help at stat.math.ethz.ch mailing list
>>PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>>and provide commented, minimal, self-contained, reproducible code.
>Petr Klasterecky
>Dept. of Probability and Statistics
>Charles University in Prague
>Czech Republic

More information about the R-help mailing list