# PCA Loadings for Statistical Analysis

**URL:** <https://shapeworks.discourse.group/t/pca-loadings-for-statistical-analysis/174>\
**Category:** Uncategorized\
**Created:** [September 25, 2023, 1:14am UTC](https://shapeworks.discourse.group/t/pca-loadings-for-statistical-analysis/174 "2023-09-25T01:14:53Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![KristinBindas](https://avatars.discourse-cdn.com/v4/letter/k/65b543/32.png) [@KristinBindas](https://shapeworks.discourse.group/u/KristinBindas)\
**Post date:** [September 25, 2023, 1:14am UTC](https://shapeworks.discourse.group/t/pca-loadings-for-statistical-analysis/174/1 "2023-09-25T01:14:53Z")

</div>

Hi everyone. I have completed my construction of SSMs, looked at my statistically significant modes of variation, and now would like to export my PCA loadings in order to run analysis on them. When I go to the export screen, I don’t see any options to export PCA loadings specifically. I am wondering if anyone can offer any help on how to get these values?

---

<div class="post-metadata">

**Author:** ![amorris](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@amorris](https://shapeworks.discourse.group/u/amorris)\
**Post date:** [September 26, 2023, 10:23pm UTC](https://shapeworks.discourse.group/t/pca-loadings-for-statistical-analysis/174/2 "2023-09-26T22:23:54Z")

</div>

There’s some confusion about PCA terminology in general. This page is relevant:

> <https://stats.stackexchange.com/questions/143905/loadings-vs-eigenvectors-in-pca-when-to-use-one-or-another>

![image](https://global.discourse-cdn.com/free1/uploads/shapeworks/original/1X/38f0bf71982bee1734dbb5b849c59e620fe428cc.png)

The Studio export has:

Eigenvectors  
Eigenvalues  
PCA Component Scores

These three should be everything needed for further analysis.

---

<div class="post-metadata">

**Author:** ![KristinBindas](https://avatars.discourse-cdn.com/v4/letter/k/65b543/32.png) [@KristinBindas](https://shapeworks.discourse.group/u/KristinBindas)\
**Post date:** [October 3, 2023, 3:15pm UTC](https://shapeworks.discourse.group/t/pca-loadings-for-statistical-analysis/174/3 "2023-10-03T15:15:31Z")

</div>

Hi again,

Thanks for this info, however, I am still a little confused. Can I use PCA component scores between my two groups in an independent t-test?

Additionally, if I were to calculate the loadings for each mode, when I export the eigenvectors, there are many Eigenvectors in each mode. How would I go about calculating loadings with all of those values?

---

<div class="post-metadata">

**Author:** ![amorris](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@amorris](https://shapeworks.discourse.group/u/amorris)\
**Post date:** [October 6, 2023, 9:44pm UTC](https://shapeworks.discourse.group/t/pca-loadings-for-statistical-analysis/174/4 "2023-10-06T21:44:42Z")

</div>

Yes, you can use the PCA component scores for t-tests between groups, that is what we have done in the past to determine which modes of variation are significant between groups.

There will be one eigenvector for each mode of variation. If you have 4 shapes then there are 3 modes of variation, 3 eigenvectors and 3 eigenvalues.

If you export you will get:

eigenvectors0.eval  
eigenvectors1.eval  
eigenvectors2.eval

The dimension of the eigenvectors is generally 3 times the number of particles (e.g. 384 for 128 particles). This is x, y, z times the number of particles.

eigenvalues.eval

The eigenvalues.eval file contains one scalar value per eigenvector. If you multiply each eigenvector by its eigenvalue^2 (squared), you will have the PCA loadings.

Each shape’s correspondence points can be reconstructed by taking the mean particle positions and combining the eigenvectors, eigenvalues and pca component scores.

---

<div class="post-metadata">

**Author:** ![KristinBindas](https://avatars.discourse-cdn.com/v4/letter/k/65b543/32.png) [@KristinBindas](https://shapeworks.discourse.group/u/KristinBindas)\
**Post date:** [October 12, 2023, 5:42pm UTC](https://shapeworks.discourse.group/t/pca-loadings-for-statistical-analysis/174/5 "2023-10-12T17:42:05Z")

</div>

Thank you so much. One more question, in the PCA component scores I have columns labeled P0-P8, but only have 8 MoVs. is P0 the mean average shape? And if so, if there any worth is running a t test on it?

---

<div class="post-metadata">

**Author:** ![amorris](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@amorris](https://shapeworks.discourse.group/u/amorris)\
**Post date:** [October 18, 2023, 4:58pm UTC](https://shapeworks.discourse.group/t/pca-loadings-for-statistical-analysis/174/6 "2023-10-18T16:58:24Z")

</div>

P0 is the first mode of variation and should be capturing the highest amount of variation of any of the eigenvectors.

If you have P0-P8 then you have 9 modes of variation (I assume you have 10 samples?)

---

<div class="post-metadata">

**Author:** ![KristinBindas](https://avatars.discourse-cdn.com/v4/letter/k/65b543/32.png) [@KristinBindas](https://shapeworks.discourse.group/u/KristinBindas)\
**Post date:** [October 18, 2023, 6:31pm UTC](https://shapeworks.discourse.group/t/pca-loadings-for-statistical-analysis/174/7 "2023-10-18T18:31:33Z")

</div>

Hi there. I have 9 samples, so I don’t know why I have 9 modes.

---

<div class="post-metadata">

**Author:** ![amorris](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@amorris](https://shapeworks.discourse.group/u/amorris)\
**Post date:** [October 18, 2023, 6:38pm UTC](https://shapeworks.discourse.group/t/pca-loadings-for-statistical-analysis/174/8 "2023-10-18T18:38:49Z")

</div>

Hmm, let me check on this and get back to you.

---

<div class="post-metadata">

**Author:** ![amorris](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@amorris](https://shapeworks.discourse.group/u/amorris)\
**Post date:** [October 19, 2023, 12:24am UTC](https://shapeworks.discourse.group/t/pca-loadings-for-statistical-analysis/174/9 "2023-10-19T00:24:24Z")

</div>

You can ignore the last mode, the eigenvalue for it is 0 and it describes no variation. In future versions, we will drop this column.
