verify_inputs_EMD: Verify the inputs to the earthmover's distance problem

Description Usage Arguments Value

View source: R/generate_qs.R

Description

Check that the ratio, strata, and treated indicator provided to generate_qs() are in the correct forms and that the desired ratio is feasible across the population.

Usage

1
verify_inputs_EMD(ratio, st, z, treated = 1)

Arguments

ratio

a numeric or vector specifying the desired ratio of controls to 'treated' in each stratum. If there is one control group and all treated units should be included, this can be a numeric. Otherwise, this should be a vector with one entry per treatment group, in the same order as the levels of z, including the treated level. If NULL, q_s should be specified.

st

a stratum vector with the ith entry equal to the stratum of unit i. This should have the same order of units and length as z.

z

a factor with the ith entry equal to the treatment of unit i.

treated

which treatment value should be considered the treated units. This must be one of the values of z.

Value

No return value. If there is a problem with the inputs to generate_qs(), an error is raised.


natstrat documentation built on Oct. 15, 2021, 5:12 p.m.