NAG Library Function Document
nag_normal_scores_exact (g01dac) computes a set of Normal scores, i.e., the expected values of an ordered set of independent observations from a Normal distribution with mean and standard deviation .
||nag_normal_scores_exact (Integer n,
If a sample of
observations from any distribution (which may be denoted by
), is sorted into ascending order, the
th smallest value in the sample is often referred to as the
th ‘order statistic
’, sometimes denoted by
(see Kendall and Stuart (1969)
The order statistics therefore have the property
is the sample median.)
For samples originating from a known distribution, the distribution of each order statistic in a sample of given size may be determined. In particular, the expected values of the order statistics may be found by integration. If the sample arises from a Normal distribution, the expected values of the order statistics are referred to as the ‘Normal scores’. The Normal scores provide a set of reference values against which the order statistics of an actual data sample of the same size may be compared, to provide an indication of Normality for the sample
A plot of the data against the scores gives a normal probability plot.
Normal scores have other applications; for instance, they are sometimes used as alternatives to ranks in nonparametric testing procedures.
nag_normal_scores_exact (g01dac) computes the
th Normal score for a given sample size
denotes the complete beta function.
The function attempts to evaluate the scores so that the estimated error in each score is less than the value etol
specified by you. All integrations are performed in parallel and arranged so as to give good speed and reasonable accuracy.
Kendall M G and Stuart A (1969) The Advanced Theory of Statistics (Volume 1) (3rd Edition) Griffin
n – IntegerInput
, the size of the set.
pp[n] – doubleOutput
On exit: the Normal scores. contains the value , for .
etol – doubleInput
On entry: the maximum value for the estimated absolute error in the computed scores.
errest – double *Output
: a computed estimate of the maximum error in the computed scores (see Section 7
fail – NagError *Input/Output
The NAG error argument (see Section 3.6
in the Essential Introduction).
6 Error Indicators and Warnings
Dynamic memory allocation failed.
On entry, argument had an illegal value.
The function was unable to estimate the scores with estimated error less than etol
On entry, .
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG
On entry, .
Errors are introduced by evaluation of the functions
and errors in the numerical integration process. Errors are also introduced by the approximation of the true infinite range of integration by a finite range
are chosen so that this effect is of lower order than that of the other two factors. In order to estimate the maximum error the functions
are also integrated over the range
. nag_normal_scores_exact (g01dac) returns the estimated maximum error as
The time taken by nag_normal_scores_exact (g01dac) depends on etol
. For a given value of etol
the timing varies approximately linearly with n
The program below generates the Normal scores for samples of size , , , and prints the scores and the computed error estimates.
9.1 Program Text
Program Text (g01dace.c)
9.2 Program Data
9.3 Program Results
Program Results (g01dace.r)