How to remove leverage from data.

1 次查看(过去 30 天)
David Craig
David Craig 2012-1-18
Hi, I am comparing two data sets and examining some statistics using 'regstats'.
My code goes something like,
Stats = regstats(data1,data1,'linear')
qqplot(Stats.r)
The plot shows some outliers in the residuals, anyone know how I can remove them??

回答(1 个)

David Craig
David Craig 2012-1-18
Have made some progress, I can find the outliers but not remove them,
Stats = regstats(data1,data1,'linear')
qqplot(Stats.r)
mu=mean(Stats.r)
sigma=std(Stats.r)
[n,m]=size(Stats.r)
outliers=abs(Stats.r - mu(ones(n,1),:)) > 3*sigma(ones(n,1),:);
nout=sum(outliers)
Stats.r(any(outliers),:)=[]
qqplot(Stats.r)
Anyone got any ideas??????

类别

Help CenterFile Exchange 中查找有关 Model Building and Assessment 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by