Re: [R] how to test robustness of correlation

From: Berton Gunter <gunter.berton_at_gene.com>
Date: Fri 27 Jan 2006 - 04:32:59 EST


Gabor:

Contrary to popular belief, rank-based procedures are **not** resistant.

Example:

> x<-c(1:10,100);y<-c(1:10+rnorm(10,sd=.25),-100)
> cor(x,y)
[1] -0.9816899 ## awful

> cor(x,y,method='spearman')

[1] 0.5 ## better

> require(MASS)

Loading required package: MASS
[1] TRUE
> cov.rob(cbind(x,y),cor=TRUE)

## ... bunch of output omitted

$cor

          x y
x 1.0000000 0.9977734 ## best
y 0.9977734 1.0000000

## Look at the plot to see.

"The business of the statistician is to catalyze the scientific learning process." - George E. P. Box    

> -----Original Message-----
> From: r-help-bounces@stat.math.ethz.ch
> [mailto:r-help-bounces@stat.math.ethz.ch] On Behalf Of Gabor
> Grothendieck
> Sent: Thursday, January 26, 2006 9:05 AM
> To: yang.x.qiu@gsk.com
> Cc: r-help@stat.math.ethz.ch
> Subject: Re: [R] how to test robustness of correlation
>
> The cor function can do spearman correlation using
> method = "spearman" .
>
> On 1/25/06, yang.x.qiu@gsk.com <yang.x.qiu@gsk.com> wrote:
> > Hi, there:
> >
> > As you all know, correlation is not a very robust
> procedure. Sometimes
> > correlation could be driven by a few outliers. There are a
> few ways to
> > improve the robustness of correlation (pearson
> correlation), either by
> > outlier removal procedure, or resampling technique.
> >
> > I am wondering if there is any R package or R code that
> have incorporated
> > outlier removal or resampling procedure in calculating correlation
> > coefficient.
> >
> > Your help is greatly appreciated.
> >
> > Thanks.
> > Yang
> >
> > Yang Qiu
> > Integrated Data Analysis
> > Cheminformatics@RTP
> > GlaxoSmithKline
> > [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help@stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
> >
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Jan 27 04:43:20 2006

This archive was generated by hypermail 2.1.8 : Fri 27 Jan 2006 - 08:13:06 EST