Checks whether AD is outside IPD in PC coordinates
Checks whether AD is outside IPD in PC coordinates
Checks whether AD is outside IPD in principal component (PC) coordinates
maicPCA(ipd, ad)
Arguments
ipd: a dataframe with n row and p column, where n is number of subjects in IPD set and p is the number of variables used in matching.
ad: a dataframe with 1 row and p column. The matching variables should be in the same order as that in ipd. The function does not check this.
Returns
Prints a message whether AD is inside or outside IPD PC coordinates. Also returns a ggplot object to be plotted. - pc.dplot: dot-plot of AD and IPD both in IPD's PC coordinates
pca.check: 0 = AD within the ranges of IPD's PC coordinates; 2 = otherwise
Details
When AD is within the IPD PC ranges, AD can still be outside the IPD convex hull in the original scale. On the other hand, if AD is outside the IPD PC ranges, in the original scale AD is for sure outside the IPD convex hull.
Examples
## Not run:## eAD[1,] is the scenario A in the reference paper,## i.e. when AD is perfectly within IPDa1 <- maicPCA(eIPD, eAD[1,2:3])a1 ## the dot plots of PC's for IPD and AD## eAD[3,] is the scenario C in the reference paper,## i.e. when AD is outside IPDa3 <- maicPCA(eIPD, eAD[3,2:3])a3 ## the dot plots of PC's for IPD and AD## End(Not run)
References
Glimm & Yau (2021). "Geometric approaches to assessing the numerical feasibility for conducting matching-adjusted indirect comparisons", Pharmaceutical Statistics, 21(5):974-987. doi:10.1002/pst.2210.