0
0
SciPydata~5 mins

Pearson correlation in SciPy - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the Pearson correlation coefficient measure?
It measures the strength and direction of a linear relationship between two variables.
Click to reveal answer
beginner
What is the range of values for the Pearson correlation coefficient?
The values range from -1 to 1, where 1 means perfect positive linear correlation, -1 means perfect negative linear correlation, and 0 means no linear correlation.
Click to reveal answer
beginner
How do you calculate Pearson correlation using scipy?
Use scipy.stats.pearsonr(x, y) where x and y are arrays of data. It returns the correlation coefficient and the p-value.
Click to reveal answer
intermediate
What does a p-value returned by scipy.stats.pearsonr indicate?
It indicates the probability that the observed correlation happened by chance. A small p-value (e.g., < 0.05) suggests the correlation is statistically significant.
Click to reveal answer
intermediate
Can Pearson correlation detect non-linear relationships?
No, Pearson correlation only measures linear relationships. Non-linear relationships may have a low or zero Pearson correlation even if variables are related.
Click to reveal answer
What does a Pearson correlation coefficient of 0.8 indicate?
AStrong positive linear relationship
BStrong negative linear relationship
CNo linear relationship
DPerfect negative linear relationship
Which scipy function calculates Pearson correlation?
Ascipy.stats.spearmanr
Bscipy.stats.kendalltau
Cscipy.stats.ttest_ind
Dscipy.stats.pearsonr
What does a p-value less than 0.05 mean in Pearson correlation test?
ANo correlation exists
BCorrelation is likely due to chance
CCorrelation is statistically significant
DData is not normally distributed
What is the Pearson correlation coefficient for no linear relationship?
A0
B-1
C0.5
D1
Can Pearson correlation detect a curved (non-linear) relationship?
AOnly if data is large
BNo, it only measures linear relationships
CYes, always
DOnly if variables are categorical
Explain how to use scipy to calculate Pearson correlation between two data arrays.
Think about the function name and what it returns.
You got /4 concepts.
    Describe what the Pearson correlation coefficient tells us about two variables.
    Focus on what the number means in terms of relationship.
    You got /4 concepts.