Learn R Programming

goft (version 1.3.6)

exp_test: Tests for exponentiality

Description

Test based on a data trasformation and Cox-Oakes test for exponentiality.

Usage

exp_test(x, method = "transf", N = 10^3)

Arguments

x

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

method

test to be used. Tow available options are "transf" and "ratio". Default option is "transf".

N

number of Monte Carlo samples used to approximate p-values when "transf" option is chosen and the sample size is less than 200. Default is N = 10^3.

Value

A list with class "htest" containing the following components.

statistic

the calculated value of the test statistic.

p.value

approximated p-value of the test.

method

a character string giving the name of the method used for testing exponentiality.

data.name

a character string giving the name of the data set.

Details

Option "transf" performs a test based on a transformation to approximately uniformly distributed variables. If the sample size is larger than 200, the asymptotic null distribution of the test statistic is used to approximate the p-value; otherwise, it is approximated by Monte Carlo simulation (Villasenor and Gonzalez-Estrada, 2020).

Option "ratio" performs Cox and Oakes (1984) test.

References

Villasenor, J.A. and Gonzalez-Estrada, E. 2020. On testing exponentiality based on a new estimator for the scale parameter. Brazilian Journal of Probability and Statistics (accepted for publication).

Cox, D.R., Oakes, D. 1984. Analysis of Survival Data. Chapman and Hall/CRC.

Examples

Run this code
# NOT RUN {
# Testing exponentiality on a simulated random sample from the exponential distribution
x <- rexp(20)
exp_test(x)

# }

Run the code above in your browser using DataLab