Both the thermoelectric power and the resistivity of the oxygen deficient YBa2Cu3O6+x samples were measured. The rare-earth-doped samples, such as Sm and Dy, whose magnetic moments in the +3 valence state are different, were studied. Then the power factor of the thermoelectric ability was calculated. The power factor of the Dy-doped samples is smaller than those of the other samples, especially at high temperature. This smallness of the power factor is the main reason why the Dy-doped samples have larger resistivity. We try to analyze the data by the theoretical expression under the variable range hopping conduction model. The expression of the thermoelectric power could be fit for the nondoped and Sm-doped samples, except at low temperature. In this situation, the thermoelectric power increases as temperature increases, and this temperature dependence is good for the thermoelectric materials at high temperature where the resistivity decreases with temperature increasing.