Determinants of cognitive function in childhood: A cohort study in a middle income context