tau34sq.normtest {lmomco} | R Documentation |
The Tau34-squared Test: A Normality Test based on L-skew and L-kurtosis and an Elliptical Rejection Region on an L-moment Ratio Diagram
Description
This function performs highly intriguing test for normality using L-skew () and L-kurtosis (
) computed from an input vector of data. The test is simultaneously focused on L-skew and L-kurtosis. Harri and Coble (2011) presented two types of normality tests based on these two L-moment ratios. Their first test is dubbed the
test. Those authors however conclude that a second test dubbed the
test “in particular shows consistently high power against [sic] symmetric distributions and also against [sic] skewed distributions and is a powerful test that can be applied against a variety of distributions.”
A sample-size transformed quantity of the sample L-skew () is
which has an approximate Standard Normal distribution. A sample-sized transformation of the sample L-kurtosis () is
which also has an approximate Standard Normal distribution. A superior approximation for the variate of the Standard Normal distribution however is
and is highly preferred for the algorithms in tau34sq.normtest
.
The test (not implemented in
tau34sq.normtest
) by Harri and Coble (2011) can be constructed from the and
statistics as shown, and a square rejection region constructed on an L-moment ratio diagram of L-skew versus L-kurtosis. However, the preferred method is the “Tau34-squared” test
that can be developed by expressing an ellipse on the L-moment ratio diagram of L-skew versus L-kurtosis. The
test statistic is defined as
which is approximately distributed as a distribution with two degrees of freedom. The
also is the expression of the ellipical region on the L-moment ratio diagram of L-skew versus L-kurtosis.
Usage
tau34sq.normtest(x, alpha=0.05, pvalue.only=FALSE, getlist=TRUE,
useHoskingZt4=TRUE, verbose=FALSE, digits=4)
Arguments
x |
A vector of values. |
alpha |
The |
pvalue.only |
Only return the p-value of the test and superceeds the |
getlist |
Return a list of salient parts of the computations. |
useHoskingZt4 |
J.R.M. Hosking provided a better approximation |
verbose |
Print a nice summary of the test. |
digits |
How many digits to report in the summary. |
Value
An R list
is returned if getlist
argument is true. The list contents are
SampleTau3 |
The sample L-skew. |
SampleTau4 |
The sample L-kurtosis. |
Ztau3 |
The Z-value of |
Ztau4 |
The Z-value of |
Tau34sq |
The |
ChiSq.2df |
The Chi-squared distribution nonexceedance probability. |
pvalue |
The p-value of the test (original notation for package). |
p.value |
The p-value of the test (updated to align with many other hypothesis test styles). |
isSig |
A logical on whether the p-value is “statistically significant” based on the |
source |
The source of the parameters: “tau34sq.normtest”. |
Author(s)
W.H. Asquith
References
Harri, A., and Coble, K.H., 2011, Normality testing—Two new tests using L-moments: Journal of Applied Statistics, v. 38, no. 7, pp. 1369–1379.
See Also
Examples
HarriCoble <- tau34sq.normtest(rnorm(20), verbose=TRUE)
## Not run:
# If this basic algorithm is run repeatedly with different arguments,
# then the first three rows of table 1 in Harri and Coble (2011) can
# basically be repeated. Testing by WHA indicates that even better
# empirical alphas will be computed compared to those reported in that table 1.
# R --vanilla --silent --args n 20 s 100 < t34.R
# Below is file t34.R
library(batch) # for command line argument parsing
a <- 0.05; n <- 50; s <- 5E5 # defaults
parseCommandArgs() # it will echo out those arguments on command line
sims <- sapply(1:s, function(i) {
return(tau34sq.normtest(rnorm(n),
pvalue.only=TRUE)) })
p <- length(sims[sims <= a])
print("RESULTS(Alpha, SampleSize, EmpiricalAlpha)")
print(c(a, n, p/s))
## End(Not run)