# Welch t-test using the median and MAD

Can the Welch t-test be used with the median and MAD instead of mean and variance? I think outliers are causing problems and the median places less weight on extreme outliers.

I'm using this to test if one piece of code is faster than another. I think some of the outliers don't represent a true measurement but some kind of pausing of the process.

• No. Even in principle the MAD isn't an estimator of the SD. (And on dimensional grounds alone it isn't an estimator of variance for measured variables.) And the reasons don't stop there. There'll be a better answer but it depends on your telling us more about your data. If the data are execution times then working on a logarithmic or even reciprocal scale may make sense. Can you show your data or a plot of them? Commented Dec 10, 2018 at 11:46
• This is a for a general purpose algorithm to determine if one piece of code runs faster than another. There is no data available. Commented Dec 10, 2018 at 13:54
• You presumably looked at data at least loosely to know that outliers are something to worry about. Note that the point about reciprocals of times is that they are in essence speeds, e.g. twice as long means half the speed. Commented Dec 10, 2018 at 14:24
• If there is no data then there is nothing to test Commented Dec 10, 2018 at 18:01
• It's in principle possible to construct a test if you make some assumptions (e.g. if you assume that your data are drawn from normal distributions, you should be able to derive an approximate test in this fashion; under specific types of moderate non-normality it might continue to have reasonable properties. A similar question has been asked before, that you might find helpful: T-test using only summary data in a box plot. Commented Dec 11, 2018 at 4:17