Large differences in mortality rates across those with different levels of education are a well-established fact. This association between mortality and education may partly be explained by confounding factors, including intelligence. Intelligence may also be affected by education so that it becomes a mediating factor in the causal chain. In this paper we estimate the impact of education on mortality using inverse probability weighted (IPW) estimator, using either intelligence as a selection variable or as a mediating variable. We develop an IPW estimator to analyse the mediating effect in the context of survival models. Our estimates are based on administrative data, on men born in 1944-1947 who were examined for military service in the Netherlands between 1961-1965, linked to national death records. For these men we distinguish four education levels and we make pairwise comparisons. From the empirical analyses we conclude that the mortality differences observed by education are only attributable to education effects for high educated individuals. For low educated individuals the observed mortality gain is mainly attributable to differences in intelligence.