This function is used by generate_constraints()
to standardize
covariate vectors to become balance constraints.
The function divides the covariate values by the treated or average group
standard deviation (across strata).
stand(z, x, denom_variance = "treated", treated = 1, autogen_missing = 50)
a factor with the i
th entry equal to the treatment of unit i
.
a covariate vector with i
th entry equal to the
covariate value of unit i
. This should have the same order of units and
length as z
.
character stating what variance to use in the standardization:
either the default "treated", meaning the standardization will use the
treated variance (across all strata), where the treated group is declared in
the treated
argument, or "pooled", meaning
the standardization will use the average of the variances of each treatment group.
which treatment value should be considered the treated units. This
must be one of the values of z
.
whether to automatically generate missingness constraint
and how heavily to prioritize it. Should be a numeric
or NULL
value. NULL
indicates that
a constraint to balance the rate of missingness (denoted by NA
in x
) should not be automatically generated. Note that this is not
recommended unless the user has already accounted for missing values.
If not NULL
, autogen_missing
should be a numeric stating how heavily
to prioritize generated missingness constraints over covariate constraint.
The default is 50.
A list with two components:
a balance constraint for the standardized covariate values of all unites.
a corresponding balance constraint for the rate of missingness if
autogen_missing
not NULL
, otherwise NULL
.