maicMD {maicChecks} | R Documentation |
Checks if AD is within the convex hull of IPD using Mahalanobis distance
Description
Should only be used when all matching variables are normally distributed
Usage
maicMD(ipd, ad, n.ad = Inf)
Arguments
ipd |
a dataframe with n row and p coln, where n is number of subjects and p is the number of variables used in matching. |
ad |
a dataframe with 1 row and p coln. The matching variables should be in the same order as that in |
n.ad |
default is NULL assuming |
Details
When AD does not have the largest Mahalanobis distance, in the original scale AD can still be outside of the IPD convex hull. On the other hand, when AD does have the largest Mahalanobis distance, in the original scale, AD is for sure outside the IPD convex hull.
Value
Prints a message whether AD is furthest away from 0, i.e. IPD center in terms of Mahalanobis distance. Also returns ggplot object for plotting.
md.dplot |
dot-plot of AD and IPD in Mahalanobis distance |
md.check |
0 = AD has the largest Mahalanobis distance to the IPD center; 2 = otherwise |
Author(s)
Lillian Yau
References
Glimm & Yau (2021). Geometric approaches to assessing the numerical feasibility for conducting matching-adjusted indirect comparisons. arXiv 2108.01896.
Examples
## eAD[1,] is the scenario A in the reference paper,
## i.e. when AD is perfectly within IPD
md <- maicMD(eIPD, eAD[1,2:3])
md ## a dot-plot of IPD Mahalanobis distances along with AD in the same metric.