Xlstat principal component analysis12/14/2023 This would then result in three components.įrom here we could now go on to rotate our components if we wanted to. However, in combination with the correlation matrix further above we could conclude that indeed X1, X2 and X4 belong together since they are highly correlated, and that furthermore X3 and X5 must be separated from each other because they are not correlated. From the loadings table alone, we would certainly still find it difficult to guess that they are actually independent from each other. Interestingly though X3 and X5 also seem to be related. X3, X1 and X2 now seem to be related together. Looking at the correlation matrix, the relations make much more sense.įortunately, it's pretty easy to perform a PCA based on the correlation matrix by using the cor = TRUE parameter in the princomp function. For example (in absolute numbers) the variance between X1 and X3 is much higher than the variance between X1 and X2, although we know for sure that the relation should actually be inverse. Note how very different the result looks compared to the correlation matrix above. Let's quickly have a look at the variance matrix. Variances unlike correlations, however, depend strongly on the scale and units of the input data. princomp by default uses the variance matrix - not the correlation matrix - to compute the different components. From how we constructed the sample dataset, we would actually expect variables X1, X2 and X4 to belong together - not X1, X3 and X4! Did we maybe make a mistake somewhere? Unfortunately we did. Does this make sense? Something is fishy here. Component 1, 2 and 3 map to variables X3, X1 and X4. They are clearly independent from the rest. I wanted to reuse the same dataset later on for performing also cluster analysis, so I put a little bit of thought in how to create it.Ĭomponent 4 and 5 map to variables X2 and X5. For this purpose, I first created my own artificial dataset. I wanted to know a little more on Principal Component Analysis (PCA) in R.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |