Sensitivity analysis using weighted M-statistics