Valence effect on the incorporation of tungsten implanted into lithium niobate