You're right; average (mean) and median are just two of many ways to filter or reduce data. When you want to "cut the data roughly in half," you're looking for quantile-based filters or robust estimators that can withstand outliers or skewed distributions. Here are some popular alternatives:
Quantile-based filters (cutting data at a certain percentage)
Median (50th percentile, Q2): As you mentioned, it's the middle value that separates the lower half from the upper half.
Quartiles:
First quartile (Q1, 25th percentile): Cuts off the lowest 25% of data, keeping the top 75%.
Third quartile (Q3, 75th percentile): Cuts off the highest 25% of data, keeping the bottom 75%.
Deciles: Divide data into 10 equal parts (10%, 20%, ..., 90%):
D1 (10th percentile): Keeps the top 90%.
D9 (90th percentile): Keeps the bottom 90%.
Percentile filters: Choose any percentage, e.g., 20th percentile (keeps top 80%), 40th percentile (keeps top 60%), etc.
Robust estimators (resistant to outliers)
Trimmed mean (e.g., 10% trimmed mean): Remove 10% of data from both extremes (lower 5% and upper 5%) and calculate the mean of the remaining 90%. This reduces the impact of outliers.
Winsorized mean: Similar to trimmed mean, but instead of removing extremes, replace them with the nearest remaining value (e.g., 5th percentile value for lower extremes and 95th percentile for upper extremes).
Interquartile mean (IQM): Calculate the mean of the middle 50% of data (between Q1 and Q3). This discards the most extreme 25% on each side.
Other filters (not necessarily cutting data in half)
Geometric mean: Useful for skewed distributions of positive values (e.g., incomes, sizes). It's the nth root of the product of n values.
Harmonic mean: Suitable for rates, ratios, or speeds. It's the reciprocal of the average of reciprocals.
Huber mean (or Huber-White standard error): A robust mean estimator that reduces the impact of outliers by using a mixture of mean and median calculations.
Example: Cutting data roughly in half
Suppose you have a dataset of exam scores: [12, 23, 34, 45, 56, 67, 78, 89, 90, 99]
Median (50th percentile): 56 (separates lower 5 scores from upper 5 scores)
First quartile (Q1, 25th percentile): 34 (cuts off lowest 25% of data: [12, 23])
Third quartile (Q3, 75th percentile): 78 (cuts off highest 25% of data: [89, 90, 99])
40th percentile: ≈ 45 (keeps top 60% of scores: [45, 56, 67, 78, 89, 90, 99])
Trimmed mean (20%): Remove 2 lowest and 2 highest scores: [23, 34, 45, 56, 67, 78, 89], then calculate mean ≈ 56
Here's some Python code using numpy and scipy libraries to demonstrate these concepts:
Now, choose the filter that best suits your data and goals! If you want to "cut the data roughly in half," the median or 40-60 percentile range might be a good starting point. For more robustness against outliers, consider trimmed mean or interquartile mean. Happy filtering!