R: Normal Scores distribution

NormalScore {SuppDists} | R Documentation

## Normal Scores distribution

### Description

Density, distribution function, quantile function, random generator and summary function for the normal scores test. A function to calculate expected values of normal order statistics is included.

### Usage

    dNormScore(x, c, N, U, log=FALSE)
    pNormScore(q, c, N, U, lower.tail=TRUE, log.p=FALSE)
    qNormScore(p, c, N, U, lower.tail=TRUE, log.p=FALSE)
    rNormScore(n, c, N, U)
    sNormScore(c, N, U)
    normOrder(N)

### Arguments

`x,q` | vector of non-negative quantities
`p` | vector of probabilities
`n` | number of values to generate. If n is a vector, length(n) values will be generated
`c` | vector number of treatments
`N` | vector total number of observations
`U` | vector sum of reciprocals of the number of the c sample sizes
`log, log.p` | logical vector; if TRUE, probabilities p are given as log(p)
`lower.tail` | logical vector; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]

### Details

This is the Kruskal-Wallis statistic with ranks replaced by the expected values of normal order statistics. There are c treatments with sample sizes nj, j=1 … c. The total sample size is N=Sum nj. The distribution depends on c, N, and U, where U=Sum (1/nj).

Let eN(k) be the expected value of the kth smallest observation in a sample of N independent normal variates. Rank all observations together, and let Rij denote the rank of observation Xij, i=1 … nj for treatment j=1 … c, then the normal scores test statistic is

x=(N-1)[1/Sum(1 … N)(eN(k)^2)]Sum(1 … c)[(Sj^2)/nj]

where Sj=Sum(1 … nj)(eN(Rij)).

See Lu and Smith (1979) for a thorough discussion and some exact tables for small r and n. The calculations made here use an incomplete beta approximation – the same one used for Kruskal-Wallis, only differing in the calculation of the variance of the statistic.

The expected values of the normal order statistics use a modification of M.Maechler's C version of the Fortran algorithm given by Royston (1982). Spot checking the values against Harter (1969) confirms the accuracy to 4 decimal places as claimed by Royston.

### Value

The output values conform to the output from other such functions in R. `dNormScore()` gives the density, `pNormScore()` the distribution function and `qNormScore()` its inverse. `rNormScore()` generates random numbers. `sNormScore()` produces a list containing parameters corresponding to the arguments – mean, median, mode, variance, sd, third cental moment, fourth central moment, Pearson's skewness, skewness, and kurtosis. `normOrder()` gives the expected values of the normal order statistics for a sample of size N.

### Author(s)

Bob Wheeler bwheelerg@gmail.com

### References

Harter, H.L. (1969). Order statistics and their use in testing and estimation, volume 2. U.S. Supp. of Doc.

Lu, H.T. and Smith, P.J. (1979) Distribution of normal scores statistic for nonparametric one-way analysis of variance. Jour. Am Stat. Assoc. 74. 715-722.

Royston, J.P. (1982). Expected normal order statistics (exact and approximate) AS 177. Applied Statistics. 31. 161-165.

### Examples

    #Assuming three treatments, each with a sample size of 5
    pNormScore(2, 3, 15, 0.6)
    pNormScore(c(0.11,1.5,5.6), 3, 15, 0.6) ## approximately 5% 50% and 95%
    sNormScore(3, 15, 0.6)
    plot(function(x)dNormScore(x,c=5, N=15, U=0.6),0,5)

[Package SuppDists version 1.1-9.4 Index]