Bayer-Group / pybalance

A library for minimizing the effects of confounding covariates
BSD 3-Clause "New" or "Revised" License
11 stars 0 forks source link

Allow subsets of target to also be used #19

Closed sprivite closed 1 week ago

sprivite commented 1 week ago

Right now, all of pybalance is built against the idea of matching a pool to a target population. Essentially, we can only compute ATT. This is very restrictive and limits the use of pybalance. This issue is to remove the assumption that the target is special and allow subsets of both pool and target to be taken.

This requires an interface change. To preserve backwards compatibility, I suggest the following:

Allow the distance method in all balance calculators to take an optional second argument "target_subset":

beta.distance(pool_subset) --> beta.distance(pool_subset, target_subset)

if target_subset is not passed, then assume the whole target population.

In a later release, we will probably have to change the name of pool and target, since this is now misleading. But this will break backward compatibility and therefore should be delayed until 1.0.