Member-only story

How to calculate significance values of Pearson, Spearman and Phik correlation with Python

A simple code that quickly tabulates the significance in a table format for easy visualisation

Kuan Rong Chan, Ph.D.
Omics Diary
4 min readJan 25, 2022

--

How do you know the correlation is significant? Read on to find out

As elaborated in my previous blog entry, conducting Pearson, Spearman and Phik correlations can provide insights into the strength of correlation, and whether the pairwise correlations are linear, non-linear or not related at all. Here, we elaborate further on this topic, to examine how we can derive the significance value of correlation.

First, we load the required packages:

import numpy as np
import pandas as pd
import phik
import seaborn as sns
from phik import resources, report

I strongly recommend using JupyterLab or Jupyter Notebook, which is a web-based interactive development environment for storing and executing Python codes. You may visit here for specific instructions on how you can install them on your computer.

We will analyse a transcriptomics dataset published by Zak et al., PNAS, 2012. In this study, human subjects were given the MRKAd5/HIV vaccine, and the transcriptomic responses in peripheral blood mononuclear cells (PBMC) were measured at 6 hours, 1 day, 3 day and 7 days post-vaccination. I have uploaded the data…

--

--

Omics Diary
Omics Diary

Published in Omics Diary

A platform to share knowledge and information on how to use Python for systems vaccinology and omics analysis. Also covers interesting scientific literature related to infectious diseases and vaccines. Interested in contributing? Contact me to collaborate!

Kuan Rong Chan, Ph.D.
Kuan Rong Chan, Ph.D.

Written by Kuan Rong Chan, Ph.D.

Kuan Rong Chan, PhD, Senior Principal Research Scientist in Duke-NUS Medical School. Virologist | Data Scientist | Loves mahjong | Website: kuanrongchan.com

Responses (1)