How do I confront the outliers from two different methods?

1 回表示 (過去 30 日間)
HelpAStudent
HelpAStudent 2022 年 5 月 17 日
コメント済み: Mathieu NOE 2022 年 5 月 17 日
Hi! I have used two different methods to remove outliers from a certain data set. Here they are below:
%Grubb's test
figure;
plot(Fetal_table.mean_value_of_short_term_variability) %Fetal_table is my table with all the features in it and mean_value_of_short_term_variability is the gaussian feature in which I want to delete the outliers
histogram(Fetal_table.mean_value_of_short_term_variability)
figure;
vec_out = isoutlier(Fetal_table.mean_value_of_short_term_variability,"grubbs");
figure;
plot(Fetal_table.mean_value_of_short_term_variability, "og"); hold on;
Fetal_table(vec_out,:)=[];
%Box plot rule
figure;
plot(Fetal_table.mean_value_of_short_term_variability) %Fetal_table is my table with all the features in it and mean_value_of_short_term_variability is the gaussian feature in which I want to delete the outliers
histogram(Fetal_table.mean_value_of_short_term_variability)
figure;
vec_out = isoutlier(Fetal_table.mean_value_of_short_term_variability,"quartile");
figure;
plot(Fetal_table.mean_value_of_short_term_variability, "og"); hold on;
Fetal_table(vec_out,:)=[];
How can I compare if the same outliers have been removed and if different ones have been removed, understand which ones and understand which method is the most effective?
  1 件のコメント
Mathieu NOE
Mathieu NOE 2022 年 5 月 17 日
hello
what do you mean by "compare" ? want just to plot the selected outliers ? visual check or more advanced computations ? below I simply overlay the data and the outliers - we could also make one single plot with both sets of outliers
also the variable name is quite long and make the code less readable as you repeat it quite often , why not make it simpler like :
data = Fetal_table.mean_value_of_short_term_variability;
%Grubb's test
figure;
plot(data) %Fetal_table is my table with all the features in it and mean_value_of_short_term_variability is the gaussian feature in which I want to delete the outliers
histogram(data)
figure;
vec_out = isoutlier(data,"grubbs");
data_out = Fetal_table(vec_out,:);
figure;
plot(data, "og"); hold on; plot(data_out, "or");
% data_out=[]; % optional
%Box plot rule
figure;
plot(data) %Fetal_table is my table with all the features in it and mean_value_of_short_term_variability is the gaussian feature in which I want to delete the outliers
histogram(data)
figure;
vec_out = isoutlier(data,"quartile");
data_out = Fetal_table(vec_out,:);
figure;
plot(data, "og"); hold on; plot(data_out, "ok");
% data_out=[]; % optional

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeDescriptive Statistics についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by