Learn R Programming

nearfar (version 1.3)

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

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

smahal(X)

Value

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

Arguments

X

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

Examples

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

Run the code above in your browser using DataLab