Consider the following data (I put the data as a table in the bottom of this question.)
These data are in two groups, blue and orange. In each group there is a positive relationship, while pooling across groups, there is a negative relationship. So there is Simpson's paradox. (In my application, the two groups blue and orange are school districts and the dots are schools, but that is not important for the question.)
If I run an OLS regression using all the data I get these estimates,
ppSpend = 9.481481 + -2.962963*pctPoor
Now if I average the data up to the group-level (points weighted equally) I get this scatterplot
If I run an OLS regression using the group averages (so this is the "between model") I get
ppSpend_GroupMean = 10.14286 + -4.285714*pctPoor_GroupMean
Finally, here is the data if I demean both the dependent and independent variables by group (plotting the points at different sizes so that they can be seen):
If I run an OLS regression on this "demeaned" model ("within model") I get
ppSpend_Demeaned = 0 + 10*pctPoor_Demeaned
Here's my question: is there an interpretable weight A such that
Total Slope = A*(Between Slope) + (1-A)*(Within Slope) ?
In my example,
-2.962963 = A*(-4.285714) + (1-A)*(10)
Of course the specific number in my example is 0.907407, but I would like to know if there's some general expression for that number from interpretable things calculated from the data.
Data used in the example (as csv):
group,pctPoor,ppSpend
1,0,8
1,.1,9
1,.2,10
1,.3,11
2,.7,5
2,.8,6
2,.9,7
2,1,8