smahal: Calculates robust, rank based, Mahalanobis distance matrix.

Description Usage Arguments Details Value References Examples

View source: R/smahal.R

Description

This is a variation of a common function in the literature of matching. It takes as input a numeric data matrix of n rows and outputs a n by n matrix of pairwise distance of points. The distances satisfy triangle inequality.

Usage

1
smahal(X)

Arguments

X

A numeric data matrix.

Details

A call to this function will create a distance matrix which can be used as an input of the main function makeblocks. For more specialized use see the examples of makeblocks.

The robust Mahalanobis distance uses ranks of covariates rather than the covariates themselves, but the variances of the ranks are not adjusted for ties, so ties do not make a variable more important.

The returned matrix is the (entry wise) squared root of the rank based Mahalanobis distance matrix.

Any positive linear combination of outputs of multiple calls to this function gives a valid distance matrix.

Value

A n by n matrix of pairwise distances of the units.

References

Rosenbaum, P. R. (2010). Design of Observational Studies. New York: Springer.

Examples

1
# See examples of 'makeblocks'.

blockingChallenge documentation built on Sept. 22, 2018, 1:05 a.m.