get correlation matrix from principal component analysis in python
0
0
Entering edit mode
8.2 years ago

Hi Everyone!

I applied the pca in my dataset and return a matrix of maximum variance of the data. I'd like to convert this data result to a correlation matrix where each value of matrix is the p-value.

Is it possible to do it? Is there a paper or python package that shows how to do it?

Thank you very much.

pca correlation matrix python • 3.6k views
ADD COMMENT
0
Entering edit mode

The p-value of what? That the correlation (of what? A pairwise comparison of samples?) is different from zero? Why not just directly compute that rather than trying to convert PCA output into it?

ADD REPLY
0
Entering edit mode

My dataset has values about the differential gene expression. So, each column corresponds a specific gene and rows are the samples. I already applied pearson and spearman correlation, but I'd like to apply pca and get the correlation.

ADD REPLY
0
Entering edit mode

I'm not sure if I understand how you link 'pca' and 'correlation'...

ADD REPLY
0
Entering edit mode

I don't know if it is possible... Is there another algorithm to calculate correlation instead of spearman and pearson correlations where result in a correlation matrix?

ADD REPLY
1
Entering edit mode

Yes, there are other measures of correlation. However, why don't you state what you're actually trying to do (i.e., what type of data do you have and what type of question are you trying to answer with it?).

ADD REPLY
0
Entering edit mode

I'd like to generate a gene network correlation. I've already applied spearman and pearson correlation in the dataset, I may apply fisher correlation, however I didn't find any python implementation for it.

ADD REPLY
0
Entering edit mode

There's no "fisher correlation", that's just a transform on the pearson correlation (normally). You don't need a python implementation, it's a trivial function:

import numpy as np
def fisherTransform(r):
    return np.arctanh(r)
ADD REPLY

Login before adding your answer.

Traffic: 1670 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6