I have a long dataset, see example in the attached sheet.
For each category in Column A, I want to be able to calculate a separate robust mean, which I then need to process further. There are lots of ways of doing this. I want to use the following procedure:
For each category in Column A, calculate the mean & SD.
If any of the original individual values is >Mean + 1.5 SD – replace the original value with the value of Mean + 1.5 SD. If any of the original individual values is less than M-1.5 SD, replace the original individual value with Mean -1.5 SD.
Repeat the process (calculating a new Mean and SD) 25 times. By that stage, the mean is a pretty good estimate of the robust mean.
Then calculate an Index Score for each Value in the ORIGINAL DATA SET to show how far it is from the Robust Mean using the formula (Value – Robust mean)/66.
If the absolute value of the Index Score exceeds 3.0, delete the entire row.
Move on to the next category, until all of the categories in Column A have been so processed.
Stop.
The eagle-eyed among you may recognise the general form of the data, as I’ve posted other problems related to the same dataset previously!!
I can do most of the above in Excel outside of VBA, but it’s very clunky. A nice VBA solution would be good to have, but, sadly, I’m not even up to the standard of Chapter 1 of "VBA Programming for Dummies".
Thanks for looking...
Bookmarks