| .weighted_quantile | R Documentation |
q_hat(u) = inf{y : F_w(y) >= u} for the weighted empirical CDF F_w,
the natural SBW-weighted analogue of stats::quantile(type = 1).
.weighted_quantile(y, w, probs)
y |
Numeric outcome vector for one arm. |
w |
Nonnegative weights, same length as |
probs |
Vector of probabilities in (0, 1). |
Normalizes by sum(w), not length(y). By construction (the balancing
QP's intercept equality constraint), SBW weights for an arm sum to that
arm's size – but only up to solver precision, since the nonneg-QP
fallback's clipping of negative numerical dust can nudge the sum a hair
away from it. Dividing by sum(w) keeps F_w a valid CDF (F_w(Inf) = 1
exactly) regardless, and avoids having to track which arm's size applies
to whatever w subset was passed in.
Numeric vector of estimated quantiles, one per element of probs.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.