Quantifying And Mitigating Selection Bias In Probability And Nonprobability Samples