IMSL C Stat Library
tie_statistics
Compute tie statistics for a sample of observations.
Synopsis
#include <imsls.h>
float *imsls_f_tie_statistics (int n_observations, float x[], ..., 0)
The type double function is imsls_d_tie_statistics.
Required Arguments
int n_observations (Input)
Number of observations in x.
float x[] (Input)
Array of length n_observations containing the observations. x must be ordered monotonically increasing with all missing values removed.
Return Value
Array of length 4 containing the tie statistics.
where tj is the number of ties in the j-th group (rank) of ties, and is the number of tie groups in the sample.
Synopsis with Optional Arguments
#include <imsls.h>
float *imsls_f_tie_statistics (int n_observations, float x[],
IMSLS_FUZZ, float fuzz,
IMSLS_RETURN_USER, float ties[],
0)
Optional Arguments
IMSLS_FUZZ, float fuzz (Input)
Value used to determine ties. Observations i and j are tied if the successive differences x[k + 1] – x[k] between observations i and j, inclusive, are all less than fuzz. fuzz must be nonnegative.
Default: fuzz = 0.0
IMSLS_RETURN_USER, float ties[] (Output)
If specified ties[] returns the tie statistics. Storage for ties[] is provided by the user.
See Return Value.
Description
Function imsls_f_tie_statistics computes tie statistics for a monotonically increasing sample of observations. “Tie statistics” are statistics that may be used to correct a continuous distribution theory nonparametric test for tied observations in the data. Observations i and j are tied if the successive differences X(k + 1) - X(k), inclusive, are all less than fuzz. Note that if each of the monotonically increasing observations is equal to its predecessor plus a constant, if that constant is less than fuzz, then all observations are contained in one tie group. For example, if fuzz = 0.11, then the following observations are all in one tie group.
 
0.0, 0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00
Example
We want to compute tie statistics for a sample of length 7.
 
#include <imsls.h>
#include <stdlib.h>
 
int main()
{
float *ties=NULL;
int nobs = 7;
float fuzz = .001;
float x[] = {1.0, 1.0001, 1.0002, 2., 3., 3., 4.};
 
ties = imsls_f_tie_statistics(nobs, x,
IMSLS_FUZZ, fuzz,
0);
 
imsls_f_write_matrix("TIES\n", 1, 4, ties,
IMSLS_WRITE_FORMAT, "%5.2f",
0);
}
Output
 
TIES
0 1 2 3
4.00 2.50 84.00 6.00