Cheatsheet PCA
Cheatsheet PCA
and factoextra Scree plot PCA variables’ plot PCA individuals’ plot
The Example
This example uses data about Hollywood action
movies from 2015. Six quantitative variables with
movie ratings scrapped from Rotten Tomato and
Metacritic websites.
> head(movies2015)
Rotten Rotten Metacritic
Tomatoes Metacritic Audience Audience
Spectre 64 60 65 67
Furious 7 81 67 84 68
Terminator Genisys 25 38 59 63
San Andreas 50 43 56 55
Point Break 9 38 37 22
Variables
Dim.1 ctr cos2 Dim.2
Rotten.Tomatoes | 0.988 21.836 0.977 | -0.059
Metacritic | 0.931 19.389 0.867 | -0.330
Average.critics | 0.986 21.721 0.972 | -0.156 > fviz_pca_biplot(model, habillage = filmy2015$script.type) +
Rotten.Tomatoes.Audience | 0.943 19.885 0.890 | 0.135
theme(legend.position = "top")
Metacritic.Audience | 0.876 17.169 0.768 | 0.447
...
This cheatsheet presents functions from FactoMineR package (Francois Husson, Julie Josse, Sebastien Le, Jeremy Mazet, http://factominer.free.fr/) in version 1.35 CC BY Przemysław Biecek http://github.com/pbiecek
and factoextra package (Alboukadel Kassambara, Fabian Mundt, http://www.sthda.com/english/rpkgs/factoextra/) in version 1.0.4 https://creativecommons.org/licenses/by/4.0/