Given a dataframe and a list of adjustment sets identified with the adjustmentSets function, find the set that minimizes the number of missing values for the confounders.

minimize_missings(dat, meta, adjustment_sets, by_var)

Arguments

dat

A dataframe containing the variables of interest. A dataframe.

meta

A dataframe containing the metadata. A dataframe.

adjustment_sets

A list of adjustment sets. A character vector.

by_var

The variable name to group by. A string.

Value

An integer corresponding to the index of the adjustment set that minimizes the number of missing values.