Data ps_data;
Set ps_data;
If Rx=1 then ps_weight=1/ps;
Else ps_weight =1/(1-ps);
Run;