Nonparametric inference in the presence of biased sampling