The incidence of obscuration in active galactic nuclei