I have performed a Pearson correlations for need for cognition scale scores (NCS) against each of the 3 sub-scales for multifactorial memory questionnaire (MMQ-Contentment, MMQ-Ability & MMQ-Strategy) however if I calculate outliers for each of these variables independently based on 1.5*IQR, 20 out of my 220 participants are removed which seems excessive and possible over-conservative.
I have tried to detect multivariate outliers in jamovi but I am really struggling with the code! Can anyone please help?
I've tried to use https://towardsdatascience.com/mahalonobis-distance-and-outlier-detection-in-r-cb9c37576d7d for guidance but don't know what the equivalent of 'airquality' would be in my data... I tried the term 'nc1' but I'm receiving the error object 'nc1' not found which I think means this should be a pre-defined variable. Below is the code I've tried to use resulting in the above error.
nc1.data = nc1[c("NCS", "`MMQ-C`")]
nc1.center = colMeans(nc1.data)
nc1.cov = cov(nc1.data)
distance = mahalanobis(nc1.data, nc1.center, nc1.cov)
cutoff = qchisq(p=0.95, df = ncol(nc1.data))
nc1.data[distance > cutoff, ]
Help much appreciated!!