Causal Inference with Selection and Confounding Variables