## Description

Includes various nonparametric tests: rank correlation,
runs (randomness), and differences between series. Also
"loess" regression a la William Cleveland.

## Functions

### spearman_rho ()

int
spearman_rho (`const int *list`

,
`const DATASET *dset`

,
`gretlopt opt`

,
`PRN *prn`

);

Calculates and prints Spearman's rank correlation coefficient for the two
variables specified in the `list`

.

#### Returns

0 on successful completion, 1 on error.

### kendall_tau ()

int
kendall_tau (`const int *list`

,
`const DATASET *dset`

,
`gretlopt opt`

,
`PRN *prn`

);

Calculates and prints Kendall's rank correlation tau statistic for
the two variables specified in `list`

.

#### Returns

0 on successful completion, 1 on error.

### lockes_test ()

double
lockes_test (`const double *x`

,
`int t1`

,
`int t2`

);

Performs Charles Locke's nonparametric test for whether an
empirical distribution (namely, that of `x`

over the range
`t1`

to `t2`

) is gamma. See C. Locke, "A Test for the Composite
Hypothesis that a Population has a Gamma Distribution,"
Commun. Statis.-Theor. Meth. A5(4), 351-364 (1976). Also
see Shapiro and Chen, Journal of Quality Technology 33(1),
Jan 2001.

#### Returns

the z value for test, or NADBL on error.

### runs_test ()

int
runs_test (`int v`

,
`const DATASET *dset`

,
`gretlopt opt`

,
`PRN *prn`

);

Performs, and prints the results of, the runs test for randomness
for the variable specified by `v`

. The normal approximation
is that given in Gary Smith, Statistical Reasoning, 2e, p. 674.

#### Returns

0 on successful completion, non-zero on error.

### diff_test ()

int
diff_test (`const int *list`

,
`const DATASET *dset`

,
`gretlopt opt`

,
`PRN *prn`

);

Performs, and prints the results of, a non-parametric
test for a difference between two variables or groups.
The specific test performed depends on `opt`

.

#### Returns

0 on successful completion, non-zero on error.

### sort_pairs_by_x ()

int
sort_pairs_by_x (`gretl_matrix *x`

,
`gretl_matrix *y`

,
`int **order`

,
`char **labels`

);

Orders the elements of `x`

and `y`

by increasing value
of `x`

. Optionally, returns in `order`

an array of
integers representing the order in which the original
observations appear in the sorted vectors. Also
optionally sorts an accomanying array of observation
labels.

#### Returns

0 on successful completion, non-zero on error.

### loess_fit ()

gretl_matrix *
loess_fit (`const gretl_matrix *x`

,
`const gretl_matrix *y`

,
`int d`

,
`double q`

,
`gretlopt opt`

,
`int *err`

);

Computes loess estimates based on William Cleveland, "Robust Locally
Weighted Regression and Smoothing Scatterplots", Journal of the
American Statistical Association, Vol. 74 (1979), pp. 829-836.
Typically one expects that `d`

= 1 and `q`

is in the neighborhood
of 0.5.

The x,y pairs must be pre-sorted by increasing value of `x`

; an
error is flagged if this is not the case. See also
`sort_pairs_by_x()`

.

#### Returns

allocated vector containing the loess fitted values, or
`NULL`

on failure.