Estimating differences between two distributions


I have two data-sets, with say x and y variables each. I want to estimate how much the relation, if at all, between x and y varies between the two data-sets. More precisely, I wish to know if the dataset #2 lies systematically below or above the relation obtained from dataset #1.

One of the (model-dependent) possibilities I am considering is to first fit dataset # 1 by assuming some model between x and y and obtain a relation say y = f(x). To check if dataset #2 follows the same relation ship or not, I wish to calculate quantities (say) \sum d_i = \sum y_i - f(x_i) for each (x,y) pair in dataset #2 and see if I this sum is significantly shifted from 0.

To make it meaningful though, I wish to divide each d_i by one standard deviation in the fit-curve at corresponding x_i’s.

I know how to represent exclusion regions around fit in roofit, but don’t know if I can access width of the region (equiv. to standard deviation error on the fit curve) at some x. Is there a way to do so?

Does there exist a more model independent way of obtaining this estimation?

Thanks in advance,