How to remove leverage from data.

1 visualizzazione (ultimi 30 giorni)
David Craig
David Craig il 18 Gen 2012
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??

Risposte (1)

David Craig
David Craig il 18 Gen 2012
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??????

Community Treasure Hunt

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

Start Hunting!

Translated by