Dependence of the magnetization of superconducting yttrium and thallium compounds on oxygen content and high hydrostatic pressure