# Is this Simpson's Paradox on the Titanic data set?

With the well known "Survival of passengers on the Titanic" data set I get a strange behaviour by plotting the fare vs. the age (see below). Without a constraint on Pclass the correlation is positive. In contrast for all Pclasses the correlations seems to be negative.

I assume that's a form of "Simpson's Paradox". But I am not sure. How can this behaviour best explained for this special case?

# df is a pandas dataframe with the titanic data set
# see https://www.kaggle.com/c/titanic

import seaborn as sns
sns.jointplot("Age", "Fare", df, kind='reg')


sns.lmplot("Age", "Fare", df, col="Pclass")


• Looks to me like the linear fit is so poor that the direction is almost irrelevant. Dec 4, 2015 at 18:25