Interquartile Mean
Pyth, 11 10 bytes
.O><lQS*4Ql.OsPtc4S*4
Test suite.
How it works
It quadruplicates the input list to ensure that the data count is divisible by 4.
It still needs sorting, because *4
applies to the whole list instead of to each individual element.
Then, it splits the list into four equal parts, then takes away the first and the last part.
The remaining list is flattened and the average is taken.
MATL, 12 11 bytes
4Y"G"6L)]Ym
Input is a horizontal vector, with the format
[1, 3, 4, 5, 6, 6, 7, 7, 8, 8, 9, 38]
or
[1 3 4 5 6 6 7 7 8 8 9 38]
Try it online!
Explanation
4Y" % Input horizontal vector implicitly. Repeat each element 4 times (run-length
% decoding). The resulting array is still sorted.
G" % Push input, for each: repeat as many times as the input size
6L) % Remove first and last elements, by applying the index "2:end-1"
] % End for each
Ym % Compute mean. Display implicitly
Python 3, 50 bytes
lambda n:sum(sorted(n*4)[len(n):-len(n)])/len(n)/2
Ideone it!
How it works
It is a translation of my answer in Pyth.