Description Usage Arguments Details Value Author(s) References See Also Examples

Test of fit for the Gamma distribution with unknown shape and scale parameters based on the ratio of two variance estimators (Villasenor and Gonzalez-Estrada, 2015).

1 | ```
gamma_test(x)
``` |

`x` |
a numeric data vector containing a random sample of positive real numbers. |

The test statistic is the ratio of two variance estimators, namely, the sample variance and the moments estimator obtained by Villasenor and Gonzalez-Estrada (2015), which is the product of the sample mean of X and the sample covariance of X and log(X).

The asymptotic null distribution of the test statistic is used to approximate p-values.

NOTE: the unbiased sample covariance estimator is used to compute the test statistic.

A list with class `"htest"`

containing the following components.

`statistic` |
the calculated value of the test statistic. |

`p.value` |
the approximated p-value of the test. |

`method` |
the character string "Test of fit for the Gamma distribution". |

`data.name` |
a character string giving the name of the data set. |

Elizabeth Gonzalez-Estrada [email protected], Jose A. Villasenor-Alva

Villasenor, J.A. and Gonzalez-Estrada, E. (2015). A variance ratio test of fit for Gamma distributions. *Statistics and Probability Letters*, **96** 1, 281-286. http://dx.doi.org/10.1016/j.spl.2014.10.001

`gamma_fit`

for fitting a Gamma distribution to data.

1 2 3 4 5 6 7 | ```
# Testing the gamma distribution hypothesis on the logarithm of variable Loss
# of the danishuni data set
library(fitdistrplus)
data(danishuni)
logLoss <- log(danishuni$Loss) # logarithm of Loss variable
logLoss <- logLoss[logLoss > 0] # observations > 0
gamma_test(logLoss)
``` |

```
Loading required package: fitdistrplus
Loading required package: MASS
Loading required package: survival
Test of fit for the Gamma distribution
data: logLoss
V = -0.32803, p-value = 0.8166
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.