gabboshow
gabboshow

Reputation: 5579

deriving variables used in the first component of PCA

I'm sorry for asking this kind of question (probably the answer is obvious, but of course I don't know it) :)

I'm using pca function in matlab. is there a way to know from which variables the first score is calculated?

Thanks!

Upvotes: 1

Views: 234

Answers (1)

chappjc
chappjc

Reputation: 30589

For [coeff,scores] = pca(X);, the weights of each variable for the first principal component are,

coeff(:,1)

Every variable goes into the computation of every principal component (hence, coeff is a square matrix), but the final contribution of some variables can be very small. To find the big contributors, find(coeff(:,1)>THRESH).

Upvotes: 1

Related Questions