Effacer les filtres
Effacer les filtres

Is the calculation of the median including outliers?

17 vues (au cours des 30 derniers jours)
hmhuang
hmhuang le 13 Fév 2022
Réponse apportée : Voss le 13 Fév 2022
In MATLAB's box plot, is the calculation of the median including outliers? or just including only data between upper whiskers and lower whiskers?
  1 commentaire
hmhuang
hmhuang le 13 Fév 2022
If outliers are not considered, how to include outliers inside whiskers so that they are involved in the calculation of the median?

Connectez-vous pour commenter.

Réponse acceptée

Voss
Voss le 13 Fév 2022
Let's do a test to try to figure it out:
rng(2);
data = randn(1,10);
figure();
plot(data)
med = median(data);
med_no_outlier = median(data(data > min(data)));
figure();
yline(med,'--g');
hold on
yline(med_no_outlier,'--m');
boxplot(data);
The median line from boxplot() matches the median calculated using all the data, so it looks like boxplot() uses all the data to compute the median.

Plus de réponses (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by