Package 'normtest'

Title: Tests for Normality
Description: Tests for the composite hypothesis of normality. Compatibility updates by Renova.
Authors: Ilya Gavrilov [aut], Ruslan Pusev [aut, cre]
Maintainer: Ruslan Pusev <[email protected]>
License: GPL (>= 3)
Version: 1.1.9001
Built: 2026-11-13 17:48:13 UTC
Source: https://github.com/renova-r/normtest

Help Index


Adjusted Jarque–Bera test for normality

Description

Performs adjusted Jarque–Bera test for the composite hypothesis of normality, see Urzua (1996).

Usage

ajb.norm.test(x, nrepl=2000)

Arguments

x

a numeric vector of data values.

nrepl

the number of replications in Monte Carlo simulation.

Details

The adjusted Jarque–Bera test for normality is based on the following statistic:

AJB=(b1)2Var(b1)+(b2−E(b2))2Var(b2),AJB = \frac{(\sqrt{b_1})^2}{\mathrm{Var}\left(\sqrt{b_1}\right)} + \frac{(b_2 - \mathrm{E}\left(b_2\right))^2}{\mathrm{Var}\left(b_2\right)},

where

b1=1n∑i=1n(Xi−X‾)3(1n∑i=1n(Xi−X‾)2)3/2,b2=1n∑i=1n(Xi−X‾)4(1n∑i=1n(Xi−X‾)2)2,\sqrt{b_1} = \frac{\frac{1}{n}\sum_{i=1}^n(X_i - \overline{X})^3}{\left(\frac{1}{n}\sum_{i=1}^n(X_i - \overline{X})^2\right)^{3/2}}, \quad b_2 = \frac{\frac{1}{n}\sum_{i=1}^n(X_i - \overline{X})^4}{\left(\frac{1}{n}\sum_{i=1}^n(X_i - \overline{X})^2\right)^2},

Var(b1)=6(n−2)(n+1)(n+3),E(b2)=3(n−1)n+1,Var(b2)=24n(n−2)(n−3)(n+1)2(n+3)(n+5).\mathrm{Var}\left(\sqrt{b_1}\right) = \frac{6(n-2)}{(n+1)(n+3)}, \quad E\left(b_2\right) = \frac{3(n-1)}{n+1}, \quad \mathrm{Var}\left(b_2\right) = \frac{24n(n-2)(n-3)}{(n+1)^2(n+3)(n+5)}.

The p-value is computed by Monte Carlo simulation.

Value

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

statistic

the value of the adjusted Jarque–Bera statistic.

p.value

the p-value for the test.

method

the character string "Adjusted Jarque-Bera test for normality".

data.name

a character string giving the name(s) of the data.

Author(s)

Ilya Gavrilov and Ruslan Pusev

References

Urzua, C. M. (1996): On the correct use of omnibus tests for normality. — Economics Letters, vol. 53, pp. 247–251.

Examples

ajb.norm.test(rnorm(100))
ajb.norm.test(abs(runif(100,-2,5)))

Frosini test for normality

Description

Performs Frosini test for the composite hypothesis of normality, see e.g. Frosini (1987).

Usage

frosini.norm.test(x, nrepl=2000)

Arguments

x

a numeric vector of data values.

nrepl

the number of replications in Monte Carlo simulation.

Details

The Frosini test for normality is based on the following statistic:

Bn=1n∑i=1n∣Φ(Yi)−i−0.5n∣,B_n = \frac{1}{\sqrt{n}}\sum_{i=1}^n{\left|\Phi(Y_i) - \frac{i-0.5}{n} \right|},

where

Yi=X(i)−X‾s,s2=1n∑i=1n(Xi−X‾)2.Y_i=\frac{X_{(i)}-\overline{X}}{s}, \quad s^2=\frac{1}{n}\sum_{i=1}^n(X_i-\overline{X})^2.

The p-value is computed by Monte Carlo simulation.

Value

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

statistic

the value of the Frosini statistic.

p.value

the p-value for the test.

method

the character string "Frosini test for normality".

data.name

a character string giving the name(s) of the data.

Author(s)

Ilya Gavrilov and Ruslan Pusev

References

Frosini, B.V. (1987): On the distribution and power of a goodness-of-fit statistic with parametric and nonparametric applications, "Goodness-of-fit". (Ed. by Revesz P., Sarkadi K., Sen P.K.) — Amsterdam-Oxford-New York: North-Holland. — Pp. 133–154.

Examples

frosini.norm.test(rnorm(100))
frosini.norm.test(runif(100,-1,1))

Geary test for normality

Description

Performs Geary test for the composite hypothesis of normality, see Geary (1935).

Usage

geary.norm.test(x, nrepl=2000)

Arguments

x

a numeric vector of data values.

nrepl

the number of replications in Monte Carlo simulation.

Details

The Geary test for normality is based on the following statistic:

d=1ns∑i=1n∣Xi−X‾∣,d = \frac{1}{ns}\sum_{i=1}^n|X_i-\overline{X}|,

where

s2=1n∑i=1n(Xi−X‾)2.s^2=\frac{1}{n}\sum_{i=1}^n(X_i-\overline{X})^2.

The p-value is computed by Monte Carlo simulation.

Value

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

statistic

the value of the Geary statistic.

p.value

the p-value for the test.

method

the character string "Geary test for normality".

data.name

a character string giving the name(s) of the data.

Author(s)

Ilya Gavrilov and Ruslan Pusev

References

Geary, R. C. (1935): The ratio of the mean deviation to the standard deviation as a test of normality. — Biometrika, vol. 27, pp. 310–332.

Examples

geary.norm.test(rnorm(100))
geary.norm.test(runif(100,-1,1))

Hegazy–Green test for normality

Description

Performs Hegazy–Green test for the composite hypothesis of normality, see e.g. Hegazy and Green (1975).

Usage

hegazy1.norm.test(x, nrepl=2000)

Arguments

x

a numeric vector of data values.

nrepl

the number of replications in Monte Carlo simulation.

Details

The Hegazy–Green test for normality is based on the following statistic:

T1=1n∑i=1n∣Yi−Φ−1(in+1)∣,T_1 = \frac{1}{n}\sum_{i=1}^n{\left|Y_{i}-\Phi^{-1}{\left(\frac{i}{n+1}\right)}\right|},

where

Yi=X(i)−X‾s,s2=1n∑i=1n(Xi−X‾)2.Y_i=\frac{X_{(i)}-\overline{X}}{s}, \quad s^2=\frac{1}{n}\sum_{i=1}^n(X_i-\overline{X})^2.

The p-value is computed by Monte Carlo simulation.

Value

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

statistic

the value of the Hegazy–Green statistic.

p.value

the p-value for the test.

method

the character string "Hegazy-Green test for normality".

data.name

a character string giving the name(s) of the data.

Author(s)

Ilya Gavrilov and Ruslan Pusev

References

Hegazy, Y. A. S. and Green, J. R. (1975): Some new goodness-of-fit tests using order statistics. — Journal of the Royal Statistical Society. Series C (Applied Statistics), vol. 24, pp. 299–308.

Examples

hegazy1.norm.test(rnorm(100))
hegazy1.norm.test(runif(100,-1,1))

Hegazy–Green test for normality

Description

Performs Hegazy–Green test for the composite hypothesis of normality, see e.g. Hegazy and Green (1975).

Usage

hegazy2.norm.test(x, nrepl=2000)

Arguments

x

a numeric vector of data values.

nrepl

the number of replications in Monte Carlo simulation.

Details

The Hegazy–Green test for normality is based on the following statistic:

T2=1n∑i=1n(Yi−Φ−1(in+1))2.T_2 = \frac{1}{n}\sum_{i=1}^n{\left(Y_{i}-\Phi^{-1}{\left(\frac{i}{n+1}\right)}\right)^2}.

where

Yi=X(i)−X‾s,s2=1n∑i=1n(Xi−X‾)2.Y_i=\frac{X_{(i)}-\overline{X}}{s}, \quad s^2=\frac{1}{n}\sum_{i=1}^n(X_i-\overline{X})^2.

The p-value is computed by Monte Carlo simulation.

Value

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

statistic

the value of the Hegazy–Green statistic.

p.value

the p-value for the test.

method

the character string "Hegazy-Green test for normality".

data.name

a character string giving the name(s) of the data.

Author(s)

Gavrilov Ilya and Ruslan Pusev

References

Hegazy, Y. A. S. and Green, J. R. (1975): Some new goodness-of-fit tests using order statistics. — Journal of the Royal Statistical Society. Series C (Applied Statistics), vol. 24, pp. 299–308.

Examples

hegazy2.norm.test(rnorm(100))
hegazy2.norm.test(runif(100,-1,1))

Jarque–Bera test for normality

Description

Performs Jarque–Bera test for the composite hypothesis of normality, see Jarque and Bera (1987).

Usage

jb.norm.test(x, nrepl=2000)

Arguments

x

a numeric vector of data values.

nrepl

the number of replications in Monte Carlo simulation.

Details

The Jarque–Bera test for normality is based on the following statistic:

JB=n6((b1)2+(b2−3)24),JB = \frac{n}{6}\left((\sqrt{b_1})^2 + \frac{(b_2-3)^2}{4}\right),

where

b1=1n∑i=1n(Xi−X‾)31n(∑i=1n(Xi−X‾)2)3/2,b_1 = \frac{\frac{1}{n}\sum_{i=1}^n(X_i - \overline{X})^3}{\frac{1}{n}(\sum_{i=1}^n(X_i - \overline{X})^2)^{3/2}},

b2=1n∑i=1n(Xi−X‾)41n(∑i=1n(Xi−X‾)2)2.b_2 = \frac{\frac{1}{n}\sum_{i=1}^n(X_i - \overline{X})^4}{\frac{1}{n}(\sum_{i=1}^n(X_i - \overline{X})^2)^2}.

The p-value is computed by Monte Carlo simulation.

Value

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

statistic

the value of the Jarque–Bera statistic.

p.value

the p-value for the test.

method

the character string "Jarque-Bera test for normality".

data.name

a character string giving the name(s) of the data.

Author(s)

Ilya Gavrilov and Ruslan Pusev

References

Jarque, C. M. and Bera, A. K. (1987): A test for normality of observations and regression residuals. — International Statistical Review, vol. 55, pp. 163–172.

Examples

jb.norm.test(rnorm(100))
jb.norm.test(abs(runif(100,-2,5)))

Kurtosis test for normality

Description

Performs kurtosis test for the composite hypothesis of normality, see, e.g., Shapiro, Wilk and Chen (1968).

Usage

kurtosis.norm.test(x, nrepl=2000)

Arguments

x

a numeric vector of data values.

nrepl

the number of replications in Monte Carlo simulation.

Details

The kurtosis test for normality is based on the following statistic:

b2=1n∑i=1n(Xi−X‾)4(1n∑i=1n(Xi−X‾)2)2,b_2 = \frac{\frac{1}{n}\sum_{i=1}^n(X_i - \overline{X})^4}{\left(\frac{1}{n}\sum_{i=1}^n(X_i - \overline{X})^2\right)^2},

The p-value is computed by Monte Carlo simulation.

Value

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

statistic

the value of the test statistic.

p.value

the p-value for the test.

method

the character string "Kurtosis test for normality".

data.name

a character string giving the name(s) of the data.

Author(s)

Ilya Gavrilov and Ruslan Pusev

References

Shapiro, S. S., Wilk, M. B. and Chen, H. J. (1968): A comparative study of various tests for normality. — Journal of the American Statistical Association, vol. 63, pp. 1343–1372.

Examples

kurtosis.norm.test(rnorm(100))
kurtosis.norm.test(runif(100,-1,1))

Skewness test for normality

Description

Performs skewness test for the composite hypothesis of normality, see, e.g., Shapiro, Wilk and Chen (1968).

Usage

skewness.norm.test(x, nrepl=2000)

Arguments

x

a numeric vector of data values.

nrepl

the number of replications in Monte Carlo simulation.

Details

The skewness test for normality is based on the sample skewness:

b1=1n∑i=1n(Xi−X‾)3(1n∑i=1n(Xi−X‾)2)3/2,\sqrt{b_1} = \frac{\frac{1}{n}\sum_{i=1}^n(X_i - \overline{X})^3}{\left(\frac{1}{n}\sum_{i=1}^n(X_i - \overline{X})^2\right)^{3/2}},

The p-value is computed by Monte Carlo simulation.

Value

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

statistic

the value of the sample skewness.

p.value

the p-value for the test.

method

the character string "Skewness test for normality".

data.name

a character string giving the name(s) of the data.

Author(s)

Ilya Gavrilov and Ruslan Pusev

References

Shapiro, S. S., Wilk, M. B. and Chen, H. J. (1968): A comparative study of various tests for normality. — Journal of the American Statistical Association, vol. 63, pp. 1343–1372.

Examples

skewness.norm.test(rnorm(100))
skewness.norm.test(abs(runif(100,-2,5)))

Spiegelhalter test for normality

Description

Performs Spiegelhalter test for the composite hypothesis of normality, see Spiegelhalter (1977).

Usage

spiegelhalter.norm.test(x, nrepl=2000)

Arguments

x

a numeric vector of data values.

nrepl

the number of replications in Monte Carlo simulation.

Details

The Spiegelhalter test for normality is based on the following statistic:

T=((cnu)−(n−1)+g−(n−1))1/(n−1),T = \left( (c_nu)^{-(n-1)}+g^{-(n-1)} \right)^{1/(n-1)},

where

u=X(n)−X(1)s,g=∑i=1n∣Xi−X‾∣sn(n−1),cn=(n!)1/(n−1)2n,s2=1n−1∑i=1n(Xi−X‾)2.u=\frac{X_{(n)}-X_{(1)}}{s}, \quad g=\frac{\sum_{i=1}^n|X_i-\overline{X}|}{s\sqrt{n(n-1)}}, \quad c_n=\frac{(n!)^{1/(n-1)}}{2n}, \quad s^2=\frac{1}{n-1}\sum_{i=1}^n(X_i-\overline{X})^2.

The p-value is computed by Monte Carlo simulation.

Value

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

statistic

the value of the Geary statistic.

p.value

the p-value for the test.

method

the character string "Spiegelhalter test for normality".

data.name

a character string giving the name(s) of the data.

Author(s)

Ilya Gavrilov and Ruslan Pusev

References

Spiegelhalter, D. J. (1977): A test for normality against symmetric alternatives. — Biometrika, vol. 64, pp. 415–418.

Examples

spiegelhalter.norm.test(rnorm(100))
spiegelhalter.norm.test(rexp(100))

Weisberg–Bingham test for normality

Description

Performs Weisberg–Bingham test for the composite hypothesis of normality, see Weisberg and Bingham (1975).

Usage

wb.norm.test(x, nrepl=2000)

Arguments

x

a numeric vector of data values.

nrepl

the number of replications in Monte Carlo simulation.

Details

The Weisberg–Bingham test for normality is based on the following statistic:

WB=(∑i=1nmiX(i))2/∑i=1nmi2∑i=1n(Xi−X‾)2,WB = \frac{(\sum_{i=1}^nm_iX_{(i)})^2/\sum_{i=1}^nm_i^2}{\sum_{i=1}^n(X_i-\overline{X})^2},

where

mi=Φ−1(i−3/8n+1/4).m_i=\Phi^{-1}\left(\frac{i-3/8}{n+1/4}\right).

The p-value is computed by Monte Carlo simulation.

Value

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

statistic

the value of the Weisberg–Bingham statistic.

p.value

the p-value for the test.

method

the character string "Weisberg-Bingham test for normality".

data.name

a character string giving the name(s) of the data.

Author(s)

Ilya Gavrilov and Ruslan Pusev

References

Weisberg, S. and Bingham, C. (1975): An approximate analysis of variance test for non-normality suitable for machine calculation. — Technometrics, vol. 17, pp. 133–134.

Examples

wb.norm.test(rnorm(100))
wb.norm.test(runif(100,-1,1))