Functions for estimation and inference of selection in