0
0
SciPydata~5 mins

Spearman correlation in SciPy - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is Spearman correlation?
Spearman correlation measures how well the relationship between two variables can be described using a monotonic function. It uses ranks instead of actual values.
Click to reveal answer
beginner
How does Spearman correlation differ from Pearson correlation?
Spearman correlation uses ranks and measures monotonic relationships, while Pearson correlation uses actual values and measures linear relationships.
Click to reveal answer
beginner
Which Python library and function can you use to calculate Spearman correlation?
You can use the scipy library and the function scipy.stats.spearmanr to calculate Spearman correlation.
Click to reveal answer
intermediate
What does the output of scipy.stats.spearmanr include?
It returns two values: the Spearman correlation coefficient (a number between -1 and 1) and the p-value that tests if the correlation is significant.
Click to reveal answer
intermediate
Why is Spearman correlation useful with non-linear data?
Because it uses ranks, Spearman correlation can detect monotonic relationships even if they are not straight lines, unlike Pearson correlation.
Click to reveal answer
What type of relationship does Spearman correlation measure?
AMonotonic relationship
BOnly linear relationship
CNo relationship
DExponential relationship
Which function calculates Spearman correlation in scipy?
Ascipy.stats.spearmanr
Bscipy.stats.kendalltau
Cscipy.stats.pearsonr
Dscipy.stats.linregress
What does a Spearman correlation coefficient of 1 mean?
APerfect negative monotonic relationship
BPerfect positive monotonic relationship
CPerfect linear relationship only
DNo relationship
Why might you choose Spearman over Pearson correlation?
AYou want to fit a regression line
BData is normally distributed
CYou want to measure variance
DData has outliers or is not linear
What does the p-value from scipy.stats.spearmanr indicate?
AStrength of correlation
BProbability correlation is zero
CSignificance of correlation
DDirection of correlation
Explain how to calculate and interpret Spearman correlation using scipy.
Think about ranking data and what the two outputs mean.
You got /5 concepts.
    Describe when and why you would use Spearman correlation instead of Pearson correlation.
    Consider the shape of data and sensitivity to outliers.
    You got /5 concepts.