----- Forwarded message from morphmet_modera...@morphometrics.org ----- Date: Thu, 12 Jun 2014 06:45:46 -0700 From: morphmet_modera...@morphometrics.org Reply-To: morphmet_modera...@morphometrics.org Subject: Re: Comparing svd() and prcomp() output from R To: morphmet@morphometrics.org
----- Forwarded message from Stefan Schlager <zarquo...@gmail.com> ----- Date: Sun, 8 Jun 2014 08:29:16 -0400 From: Stefan Schlager <zarquo...@gmail.com> Reply-To: Stefan Schlager <zarquo...@gmail.com> Subject: Re: Fwd: Re: Comparing svd() and prcomp() output from R To: morphmet@morphometrics.org Hi Murat, to get the same results, you need to: a) center your data (as dennis slice pointed out) => gives identical PCs b) divide the squared singular values by (sample size -1) => gives identical eigenvalues Best Stefan On 07/06/14 06:16, morphmet wrote: > > > > -------- Original Message -------- > Subject: Re: Comparing svd() and prcomp() output from R > Date: Fri, 6 Jun 2014 16:26:20 -0400 > From: Dennis E. Slice <dsl...@morphometrics.org> > To: morphmet@morphometrics.org > > I take it you are comparing svd(x) and prcomp(x) where x is your data > matrix? prcomp() subtracts the mean. -ds > > On 6/6/14, 11:09 AM, morphmet_modera...@morphometrics.org wrote: >> >> ----- Forwarded message from "Maga, Murat" >> <ali.m...@seattlechildrens.org> ----- >> >> Date: Thu, 15 May 2014 18:54:15 -0400 >> From: "Maga, Murat" <ali.m...@seattlechildrens.org> >> Reply-To: "Maga, Murat" <ali.m...@seattlechildrens.org> >> Subject: Comparing svd() and prcomp() output from R >> To: "'morphmet@morphometrics.org'" <morphmet@morphometrics.org> >> >> Hi folks, >> >> This is really a R question, but perhaps someone can help me. >> >> When I run svd() and prcomp() functions on my procrustes aligned >> coordinates, I end up with an interesting situation, where the 1st >> component from the prcomp() is identical to the 2nd component from >> svd() and it keeps going with this shift. >> >> The first component from SVD has a large variance attached to it. If >> you remove that and recalculate the percentages, they are identical >> to the variances explained by prcomp. >> >> Any ideas what's happening? >> >> Thanks, >> M >> >> CONFIDENTIALITY NOTICE: This e-mail message, including any >> attachments, is for the sole use of the intended recipient(s) and may >> contain confidential and privileged information protected by law. Any >> unauthorized review, use, disclosure or distribution is prohibited. >> If you are not the intended recipient, please contact the sender by >> reply e-mail and destroy all copies of the original message. >> >> ----- End forwarded message ----- >> >> > > > > ----- End forwarded message ----- ----- End forwarded message -----
signature.asc
Description: PGP signature