LoslegenKostenlos loslegen

Sensitivity to outliers

When we are analyzing the relationship of more than one variable, correlation is a great start. But how does correlation hold up against some more interesting datasets? How well does it hold up against outliers?

In this exercise, you will plot and compute the correlation for a dataset with an outlier and then remove it and see what changes. In the end, you want to see how correlation performs and come to a conclusion about when and where you should use it.

A sample dataset from the famous Anscombe's quartet has been imported for you as the df variable, along with the all the packages used previously in this chapter.

Diese Übung ist Teil des Kurses

Practicing Statistics Interview Questions in Python

Kurs anzeigen

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Display the scatter plot of X and Y
plt.scatter(____, ____)
plt.show()
Code bearbeiten und ausführen