The impact of economic, social and cultural conditions on educational attainments