The effective neutron—proton interaction in rare-earth nuclei