Good day all. This is to thank all those who have helped in fixing this problem. Starting with a text book was indeed a problem, however, that gave me a clue of what I was looking for. This, with your contributions added to other materials I got on the net, put me on the right track. Thank you so much. Warmest regards Ogbos
On 31 January 2010 14:07, S Ellison <s.elli...@lgc.co.uk> wrote: > I doubt you will get a useful answer as to why you cannot reporduce an > example from a book - especially one you didn't cite! > > R has prcomp and princomp in the base package, and as others have > pointed out, pca is implementd in other packages. We used ade4 a lot; it > has quite nice default graphics. > > If you want to calculate principal components manually, you probably > need to look at eigen() and remember a) in PCA, the vectors are usually > given in order of decreasing eigenvalue and b) eigenvectors are not > generally unique, especially as to sign. Different PCA applciations may > give you eigenvalues of differing sign. > > Also, eigenvector solutions are not the only way of obtaining > eigenvalues; efficient solutions for a limited number of PC's also > exist, particularly the NIPALS algorithm > > > read your text book to the point where it mentions the eigenvectors of > the ccorrelation (or covariance) matrix > >>> ogbos okike <ogbos.ok...@gmail.com> 01/30/10 7:09 PM >>> > Hi, > I am learning how to do principal component analysis in R. However, > since I > am family with only a few built-in functions like prcomp, sd, cor, I > started > manually with examples in text books while trying to use the few > functions I > know to manipulate what they have in the text. From the example in the > text > I obtained a data set. Using cor and cov, I calculated the correlation > and > covariance of the data frame. I equally calculated standardized data as > they > did. They plotted a graph of the standardized X against Y, X against Z > and Z > against Y. I tried to plot the same graph in R but could not fit the > First > Principal Component as they did. > I will be glad if anybody would be good enough as to guide me on how to > fit > this first (and probably second, third) principal component (s). As a > begginer, I would appreciate any additional information on how to > proceed > with pca in R. > Thank you. > Ogbos > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org 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. > > > ******************************************************************* > This email and any attachments are confidential. Any u...{{dropped:12}} ______________________________________________ R-help@r-project.org 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.