[R] linear correlation?

Setzer.Woodrow@epamail.epa.gov Setzer.Woodrow at epamail.epa.gov
Thu Mar 7 17:01:57 CET 2002


To follow up, consider the vector x3 <- c(3,2,1,108, 209, 303) with the
same units as before.
> cor(x1,x3)
[1] 0.9995864

Now express the first three values as microns instead of cm:
x4 <- x3
x4[1:3] <- 10000 * x4[1:3]

> cor(x1,x4)
[1] -0.7461934

Just changing the units changes the whole sense of the correlation.

R. Woodrow Setzer, Jr.                                            Phone:
(919) 541-0128
Experimental Toxicology Division                       Fax:  (919)
541-5394
Pharmacokinetics Branch
NHEERL MD-74; US EPA; RTP, NC 27711


                                                                                                                                    
                    Andrew Perrin                                                                                                   
                    <andrew_perrin at unc.e        To:     Joerg Maeder <maeder at atmos.umnw.ethz.ch>                                    
                    du>                         cc:     dechao wang <dechwang at yahoo.co.uk>, "'R-help at lists.R-project.org'"          
                    Sent by:                    <R-help at stat.math.ethz.ch>                                                          
                    owner-r-help at stat.ma        Subject:     Re: [R] linear correlation?                                            
                    th.ethz.ch                                                                                                      
                                                                                                                                    
                                                                                                                                    
                    03/07/02 09:45 AM                                                                                               
                    Please respond to                                                                                               
                    andrew_perrin                                                                                                   
                                                                                                                                    
                                                                                                                                    




On Thu, 7 Mar 2002, Joerg Maeder wrote:

> Hello
>
> dechao wang wrote:
> >
> > Hi, I have checked statistic textbooks about
> > correlations, but I am still not sure the correlation
> > analysis with different units, for example,
> >
> > x1<-c(1,  2,  3,   100, 200, 300)
> > x2<-c(1.1,2.8,3.3, 108, 209, 303)
> > the unit of the first 3 numbers is cm
> > the unit of the last 3 numbers is kg
> >
> > cor(x1,x2)=0.999655
> >
> > Can I explain the correlation coefficient as normal in
> > which all numbers have the same unit?
>
> No, that will give different results. The unit must be the same for
all
> values. Which unit isn't important, but it must be the same

OOPS - I apologize, I misread the question, I understood the OP to be
saying that x1 was in cm and x2 was in kg.

What on earth would a correlation mean between two vectors, each of
which
is made up of two entirely different measures? (These aren't just
different units, they're measures of entirely different phenomena.)


----------------------------------------------------------------------
Andrew J Perrin - andrew_perrin at unc.edu - http://www.unc.edu/~aperrin
 Assistant Professor of Sociology, U of North Carolina, Chapel Hill
      269 Hamilton Hall, CB#3210, Chapel Hill, NC 27599-3210 USA




-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
-.-.-.-
r-help mailing list -- Read
http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
_._._._




-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list