bw objects are numeric vectors carrying the estimand a set of balancing
weights targets. They are the weight vector stored on a balancing result
and returned by its weights() method.
bw is a sibling of propensity::psw: both inherit the causal_wts class,
so causalgenerics::is_causal_wt() and causalgenerics::estimand() work on
either.
Details
Constructors
bw()is the user-facing constructor. It coercesxto double before building the object.new_bw()is the low-level constructor for developers. It assumesxis already a double vector.as_bw()coerces an existing numeric vector to abwobject.
Queries
is_bw()tests whether an object is abwvector.causalgenerics::estimand()reads the target estimand.
Combining
Arithmetic preserves the class and estimand, so normalizing weights keeps the
metadata. Combining bw vectors with matching estimands preserves the class;
combining vectors with different estimands, or a bw with a
propensity::psw, warns and falls back to a plain double vector.