get_sbws_for_study: Study-level SBW weights: closed-form first, QP fallback if...

View source: R/weights.R

get_sbws_for_studyR Documentation

Study-level SBW weights: closed-form first, QP fallback if needed

Description

Tries the unconstrained closed-form solve first for each arm (get_weights_for_group_neg()); if the result is nonnegative within floating-point tolerance, zeroes out negligible negative dust and returns it directly. Otherwise falls back to the nonnegative-QP solve (get_weights_for_group_nonneg()).

Usage

get_sbws_for_study(X_subset, A)

Arguments

X_subset

Covariate data frame for the full study sample.

A

Treatment indicator (0/1) for the full study sample.

Value

A list with w (numeric vector of weights, one per row of X_subset), n_clipped, and max_abs_clipped (both 0 if the closed-form solve was used).


sbwadjust documentation built on Oct. 10, 2026, 5:08 p.m.