E-Book Content
https://www.facebook.com/groups/stats.ebooksandpapers/
https://www.facebook.com/groups/stats.ebooksandpapers/
Practical Guide to Principal Component Methods in R Alboukadel KASSAMBARA
https://www.facebook.com/groups/stats.ebooksandpapers/
ii Copyright ©2017 by Alboukadel Kassambara. All rights reserved. Published by STHDA (http://www.sthda.com), Alboukadel Kassambara Contact: Alboukadel Kassambara No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning, or otherwise, without the prior written permission of the Publisher. Requests to the Publisher for permission should be addressed to STHDA (http://www.sthda.com). Limit of Liability/Disclaimer of Warranty: While the publisher and author have used their best efforts in preparing this book, they make no representations or warranties with respect to the accuracy or completeness of the contents of this book and specifically disclaim any implied warranties of merchantability or fitness for a particular purpose. No warranty may be created or extended by sales representatives or written sales materials. Neither the Publisher nor the authors, contributors, or editors, assume any liability for any injury and/or damage to persons or property as a matter of products liability, negligence or otherwise, or from any use or operation of any methods, products, instructions, or ideas contained in the material herein. For general information contact Alboukadel Kassambara .
https://www.facebook.com/groups/stats.ebooksandpapers/
Contents 0.1 0.2 0.3 0.4 0.5 0.6 0.7
What you will learn . . . . . . . . . Key features of this book . . . . . . . How this book is organized . . . . . . Book website . . . . . . . . . . . . . Executing the R codes from the PDF Acknowledgment . . . . . . . . . . . Colophon . . . . . . . . . . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
About the author
I
v vi vii xii xii xii xiii xiv
Basics
1
1 Introduction to R 1.1 Installing R and RStudio . . . . . 1.2 Installing and loading R packages 1.3 Getting help with functions in R 1.4 Importing your data into R . . . 1.5 Demo data sets . . . . . . . . . . 1.6 Close your R/RStudio session . .
. . . . . .
2 2 2 3 4 5 5
2 Required R packages 2.1 FactoMineR & factoextra . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3 Main R functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6 6 6 8
II
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
Classical Methods
3 Principal Component Analysis 3.1 Introduction . . . . . . . . . . . 3.2 Basics . . . . . . . . . . . . . . 3.3 Computation . . . . . . . . . . 3.4 Visualization and Interpretation 3.5 Supplementary elements . . . . 3.6 Filtering results . . . . . . . . . 3.7 Exporting results . . . . . . . . 3.8 Summar