Anharmonic vibrations of apex oxygen atom in YBa2Cu3O7-δ and doping effects on the out-of-plane electrical resistivity