Last data update: 2014.03.03

R: Goodness-of-fit test for exponential distribution
gofExp.testR Documentation

Goodness-of-fit test for exponential distribution

Description

Bartlett's goodness-of-fit test for exponential distribution

Usage

   gofExp.test(x)

Arguments

x

Sample with positive values.

Value

A list with elements

statistic

Statistic.

p.value

Critical value.

Author(s)

Yves Deville

References

See

Yagouti A., Abi-Zeid I., Ouarda, T.B.M.J. and B. Bobée (2001), Revue de processus ponctuels et synthèse de tests statistiques pour le choix d'un type de processus Revue des Sciences de l'Eau, 1, pp. 323-361.

See Also

Among other goodness-of-fit tests ks.test in the stats package. See expplot for a graphical diagnostic.

Examples

 ## a sample of size 30
 x <- rexp(30)
 res <- gofExp.test(x)

 ## ns samples: p.values should look as uniform on (0, 1)
 ns <- 100
 xmat <- matrix(rexp(30*ns), nrow = ns, ncol = 30)
 p.values <- apply(xmat, 1, function(x) gofExp.test(x)$p.value)
 plot(sort(p.values), type = "p", pch = 16)
 

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(Renext)
Loading required package: evd
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/Renext/gofExp.test.Rd_%03d_medium.png", width=480, height=480)
> ### Name: gofExp.test
> ### Title: Goodness-of-fit test for exponential distribution
> ### Aliases: gofExp.test
> 
> ### ** Examples
> 
>  ## a sample of size 30
>  x <- rexp(30)
>  res <- gofExp.test(x)
> 
>  ## ns samples: p.values should look as uniform on (0, 1)
>  ns <- 100
>  xmat <- matrix(rexp(30*ns), nrow = ns, ncol = 30)
>  p.values <- apply(xmat, 1, function(x) gofExp.test(x)$p.value)
>  plot(sort(p.values), type = "p", pch = 16)
>  
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>