Jessica Minkue
2011-May-16 09:14 UTC
[R] help: Using hotelling for a confidence region for PCA scores
Hello everyone. In my last post I did not explained my problem quite well. I made a principal component analysis and took the 2 first principal components. I made a chart of my points based on the score of the 2 PC. I would like to add on this graph a 95% confidence region. To do this I used the ellipse function as follows: pcsref=PC$score[data[,1]==ref,1:2] #matrix containing the scores of the two PC SD=cov(pcsref[,1:2]) #covariance matrice of the two PC scores lines (ellipse(SD, centre=colMeans(pcsref), level=0.95),type="l", lty=5) But I want the confidence region calculated by the Hotelling T2 method and I'm not sure that ellipse function does it. Does anyone know how to do this? Thank you very much for your help and sorry for my english. [[alternative HTML version deleted]]
Greg Hirson
2011-May-16 17:23 UTC
[R] help: Using hotelling for a confidence region for PCA scores
Jessica, Take a look at the FactoMineR and SensoMineR packages: http://cran.r-project.org/web/packages/FactoMineR/ http://cran.r-project.org/web/packages/SensoMineR/ Best, Greg On 5/16/11 2:14 AM, Jessica Minkue wrote:> Hello everyone. > > In my last post I did not explained my problem quite well. I made a principal component analysis and took the 2 first principal components. I made âEUR<âEUR > > > ______________________________________________ > 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.-- Greg Hirson ghirson@ucdavis.edu Graduate Student Agricultural and Environmental Chemistry 1106 Robert Mondavi Institute North One Shields Avenue Davis, CA 95616 [[alternative HTML version deleted]]