neWeight function

Expand the dataset and calculate ratio-of-mediator probability weights