Giter Site home page Giter Site logo

Rotations for PCA? about ade4 HOT 4 CLOSED

r1-q avatar r1-q commented on August 22, 2024
Rotations for PCA?

from ade4.

Comments (4)

sdray avatar sdray commented on August 22, 2024 1

You can do the same with $li instead of $l1. The second contains the same information than $li but we a variance = 1 (variance equals the eigenvalue for $li). If you aims to draw biplot (superposition of row and columns), you should use $co and $l1 (correlation biplot) or $c1 and $li (distance biplot). If you use separate plots for row and columns, you can draw $li and $co.

from ade4.

sdray avatar sdray commented on August 22, 2024

Hi,
there is no function to do that in ade4. Varimax is a procedure of rotation allowing to perform such task. It is mainly used in psychometry and available in package psych or function varimax in package stats. If you want, you can apply on the outputs of ade4:

library(ade4)
irisX <- iris[,1:4] 
pca1 <- dudi.pca(irisX, scannf = FALSE)
vv < - varimax(as.matrix(pca1$co))
vv$loadings # rotated variables
as.matrix(pca1$l1)%*%vv$rotmat  # rotated individuals

This is equivalent to

psych::principal(irisX, rotate="varimax", nfactors=2, scores=TRUE)

Cheers

from ade4.

r1-q avatar r1-q commented on August 22, 2024

Thanks a lot Stephane! So, that is pretty cool - I wasn't aware of that stats::varimax function!

One last thing though: I usually only use the $li components of the dudi objects, which I believe are the coordinates of the individuals on the principal axes (I always use that with s.label... I hope I've got that right!) - what does the $l1 component refer to and why do we use that one specifically in combination with the rotation matrix?

Thanks a lot
Erwan

from ade4.

r1-q avatar r1-q commented on August 22, 2024

Thanks Stephane! That shed some light on the subject indeed

from ade4.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.