Selection and educational attainment : Why some children are left behind? Evidence from a middle-income country.