Description Usage Arguments Value
View source: R/weighted_mahal.R
Computes weighted Mahalanobis distance, using Choleski decomp.
1 2 3 4 5 6 7 8 | weighted_mahal(
x_mat,
cov_x,
weight_vec = NULL,
treat_vec = NULL,
sqrt_mahal = TRUE,
partial_index = NULL
)
|
x_mat |
Numeric matrix (adjust non-numeric columns prior), already rank-adjusted if desired. |
cov_x |
Covariance of x, calculated potentially with ranks. |
weight_vec |
Vector of weights corresponding to columns of x_mat, giving weights relative to normal Mahalanobis. |
treat_vec |
optionally specify which units are treated. |
sqrt_mahal |
Logical, default TRUE; whether to use regular Mahalanobis. |
partial_index |
How to partition the full matrix. |
returns a matrix of pairwise distances; the relevant indexing depends on treat_vec
and partial_index
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.