Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interpretation of p-values from pval.sparccboot #17

Closed
hoangtt1989 opened this issue May 2, 2017 · 3 comments
Closed

Interpretation of p-values from pval.sparccboot #17

hoangtt1989 opened this issue May 2, 2017 · 3 comments

Comments

@hoangtt1989
Copy link

After running pval.sparccboot on a sparccboot object, the pvals output is a vector which seems to contain the p values for either the upper or lower triangular part of the SparCC correlation matrix. My question is how do we determine which entries of the correlation matrix correspond to the entries given by pvals, so we can determine the significant correlations.

@zdk123
Copy link
Owner

zdk123 commented May 2, 2017

The values are the upper triangle. You can recover the symmetric matrix with something like

X <- diag(p) 
X[upper.tri(X, diag=FALSE)] <- p.vals
X <- X + t(X)

@zdk123 zdk123 closed this as completed May 2, 2017
@iuh-z
Copy link

iuh-z commented Mar 11, 2020

Hi, zdk123! After running the sparccboot and pval.sparccboot on the 26 taxa, I got a vector containing 325 of p.value. How can I match the p.value to the correlation of the 26 taxa? Could I get a 26*26 matrix for the p.value?

@cramjaco
Copy link

cramjaco commented Apr 1, 2020

Just to clarify. In the example above. p would be a vector of ones the length of the number of taxa you are comparing. So in @iuh-z 's example, you could say p <- rep(1, 26), and then run @zdk123 's example code and then you'd have the right sized matrix. Then you'd want to copy over the rownames and the columnnames from your original data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants