As titled, my friend and I are taking the advanced quantitative course, and we run into a dataset where we are asked to run the Mahalanobis Distance (MD) after creating a moderation interval. That became a long journey of running the MD and eliminating outliers one at a time. Is there a loop function that could simplify the process? The process we did is as follows:
- Add the MD values to the dataset
- Use a table to show the outliers that is above the cutoff point
- Eliminate the largest outlier in the table.
- Rerun MD
Any help would be greatly appreciated. TIA!