Bayer-Group / pybalance

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

MatchingData class should handle data frame with single population #14

Closed sprivite closed 4 months ago

sprivite commented 10 months ago

Currently, MatchingData will complain if target population and pool population are not named and only a single population is present in the data frame. There are a lot of use cases for single populations though (granted, not in the scope of matching, but in the scope of observational research). So it would be nice if the library handled this case more gracefully and routines like plot_binary_features did something reasonable for single populations.

sprivite commented 4 months ago

So MatchingData itself doesn't care if it's just one population. All the plotting routines work, except for plot_binary_features. I think this is fine. The name of the routine is a bit misleading. It should be called plot_difference_binary_features. Then it's clear that it requires two populations at least. I have added a check to this routine. Later we will rename it.