Suppose you are interested in how an introduction of some X causes a change in some metric Y in a population. Normally, you would random sample an experiment and control group, introduce the X into the experiment group, and after a while, could measure the difference in Y, compute a confidence interval ect, and determine if X probably caused a change in Y.
However, suppose the sampling wasn't done randomly. As such, you realize that before the experiment took place, C had a different average value of y then E. How do you adjust the statistics to compute if X had a significant change in y. Would you just minus the bias in y before the experiment from the result value of y after the experiment? I'm interested in how this would be derived statistically if correct. Thanks for the time.