You can certainly do whatever math you want in a pixel shader, but you can't change what pixel is being defined at that point in the pipeline. The math I posted for the vertex shader would work in a pixel shader if you have the right data, but the pixel being processed has already been defined.
If I understand you correctly, you are in a vertex shader that likely has a world space position as input and you are trying to output the appropriate position. To do this you will need to do something like the following: