smahal: Compute rank-based Mahalanobis distance matrix between each...

Description Usage Arguments Value Examples

Description

This function computes the rank-based Mahalanobis distance matrix between each pair of observations in the data set. Called by matches (and ultimately opt_nearfar) function to set up a distance matrix used to create pair matches.

Usage

1
smahal(X)

Arguments

X

A matrix of observed confounders with n rows (observations) and p columns (variables)

Value

Returns the rank-based Mahalanobis distance matrix between every pair of observations

Examples

1
smahal(mtcars[1:4, 2:3])

Example output

Loading required package: nbpMatching
Notice:
Formerly the gendistance() function scaled the Mahalanobis distances into large
integers, as required by the nonbimatch() function. Starting in version 1.5.0,
gendistance() will return unscaled distances. This facilitates comparison to an
appropriate F distribution for multivariate normal data. Any required scaling
will happen invisibly within nonbimatch(). This notice will be removed in a
future version of nbpMatching.
         [,1]     [,2]     [,3]     [,4]
[1,] 0.000000 0.000000 2.431837 4.050000
[2,] 0.000000 0.000000 2.431837 4.050000
[3,] 2.431837 2.431837 0.000000 5.763674
[4,] 4.050000 4.050000 5.763674 0.000000

nearfar documentation built on May 2, 2019, 3:29 p.m.