R/hegazy1.exp.test.R

Defines functions hegazy1.exp.test

Documented in hegazy1.exp.test

hegazy1.exp.test<-function(x, nrepl=2000)
{
DNAME <- deparse(substitute(x))
l<-0
n<-length(x)
x<-sort(x)
b<--log(1-c(1:n)/(n+1))
t<-(n^(-1))*sum(abs(x-b))
for(i in 1:nrepl)
{
z<-rexp(n)
z<-sort(z)
T<-(n^(-1))*sum(abs(z-b))
if (T>t) l=l+1
}
p.value<-l/nrepl
RVAL<-list(statistic=c(T=t), p.value=p.value, method="Hegazy-Green test for exponentiality",data.name = DNAME)
class(RVAL)<-"htest"
return(RVAL)
}

Try the exptest package in your browser

Any scripts or data that you put into this service are public.

exptest documentation built on May 1, 2019, 8:01 p.m.