A comparative study of the complex conductivity and the scattering behavior of Pr-doped and oxygen deficient YBa2Cu3O7 thin films with varying Pr or oxygen content is performed using terahertz coherent time-domain spectroscopy in combination with de-resistivity measurements. Both Pr doping and removal of oxygen decrease the hole concentration in the CuO2 planes. The specific conductivity behavior measured from 300 to 8 K shows two phase transitions: the superconducting transition at the critical temperature and a transition that can be explained by a suppression of the spin wave (spinon) density below the spin gap temperature. The nearly identical scattering behavior observed for both types of doping is discussed in the framework of P.W. Anderson's theory.