[R] Difference between prcomp and cmdscale

Mark Difford mark_difford at yahoo.co.uk
Thu Jun 14 15:48:34 CEST 2007


Hi Michael,

Doubtless Professor Ripley did; but it helps to put your back into it.  Long
ago Gower (1966) drew attention to the links between PCA and classical
scaling.  It took me a few seconds to find this:

http://www.garfield.library.upenn.edu/classics1980/A1980JJ08200001.pdf

Of course, I knew about Gower.  But I knew about Gower because I had done
the _basic_ research on these methods.  And that was my point.  In a later
paper Gower argued that classical scaling extended, and was more powerful
than, PCA.

However, classical scaling operates on [a matrix of] similarities between
observations/individuals/rows, whereas PCA operates on [a matrix of]
similarities between variables/descriptors/columns.  This means that in
classical scaling the axes cannot be interpreted; often one does  a PCA to
get at these.

HTH, bestR,
Mark.


michael watson (IAH-C) wrote:
> 
> Hi Mark
> 
> I think Brian Ripley answered this most effectively and succinctly.  I
> did actually do quite a bit of googling and searching of the R help
> before posting, and whilst there is quite a lot on each topic
> individually, I failed to find articles that compare and contrast PCA
> and MDS.  If you know of any, of course I would be happy to read them.
> 
> Many thanks
> Mick
> 
> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Mark Difford
> Sent: 14 June 2007 12:49
> To: r-help at stat.math.ethz.ch
> Subject: Re: [R] Difference between prcomp and cmdscale
> 
> 
> Michael,
> 
> Why should that confuse you?  Have you tried reading some of the
> literature
> on these methods?  There's plenty about them on the Net (Wiki's often a
> goodish place to start)---and even in R, if you're prepared to look ;).
> 
> BestR,
> Mark.
> 
> 
> michael watson (IAH-C) wrote:
>> 
>> I'm looking for someone to explain the difference between these
>> procedures.  The function prcomp() does principal components anaylsis,
>> and the function cmdscale() does classical multi-dimensional scaling
>> (also called principal coordinates analysis).
>> 
>> My confusion stems from the fact that they give very similar results:
>> 
>> my.d <- matrix(rnorm(50), ncol=5)
>> rownames(my.d) <- paste("c", 1:10, sep="")
>> # prcomp
>> prc <- prcomp(my.d)
>> # cmdscale
>> mds <- cmdscale(dist(my.d))
>> cor(prc$x[,1], mds[,1]) # produces 1 or -1
>> cor(prc$x[,2], mds[,2]) # produces 1 or -1
>> 
>> Presumably, under the defaults for these commands in R, they carry out
>> the same (or very similar) procedures?
>> 
>> Thanks
>> Mick
>> 
>> The information contained in this message may be\ confiden...{{dropped}}
> 
> ______________________________________________
> R-help at 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
> and provide commented, minimal, self-contained, reproducible code.
> 
> 

-- 
View this message in context: http://www.nabble.com/Difference-between-prcomp-and-cmdscale-tf3920408.html#a11120608
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list