So I sat down and worked this through. I thought I would share the answer - I struggled to find a source which worked this through and the couple of upvotes suggest interest in the solution.
Firstly, lets set up a scenario:
1 dependent variable: Y
2 variables: X1 & X2
X1 & X2 are correlated
Both have a subset of observations where the data cannot exist (going to call this 'missing' for simplicity)
This is such that there exists 2 or more observations which X1 & X2 both cannot exist.
There are four combinations:
X1 & X2 are both avaliable
X1 is missing, X2 isn't
X2 is missing, X1 isn't
X1 and X2 are both missing
We could run four separate regressions to take each combination in turn. This would give us valid estimates. Not including observations where they have a 'missing' observation is not bad in any capacity, as the observations simply do not hold any information.
However, we want to run all four within one regression. To do this, we need to be aware of two things:
- We need to be able to generate four different intercepts depending on the four combinations above.
- Changing 'missings' to 0s will adjust the coefficient estimates of X1 and X2. Therefore, we need to be able to regulate the coefficient estimates so they are correct for situations where at least one of X1 and X2 are present.
To achieve both of the points above, 3 dummy variables (denoted by D1, D2 and D3 respectively) need to be used to avoid incorrect coefficients:
- D1 takes the value 1 if X1 is missing AND X2 is not (0 otherwise)
- D2 takes the value 1 if X2 is missing AND X1 is not (0 otherwise)
- D3 takes the value 1 if X1 and X2 are both NOT missing (0 otherwise)
We then need to interact D1 with X2 & D2 with X1. In total we have 5 additional independent variables, alongside the intercept, X1 and X2.
D1, D2 and D3 regulate the intercept depending on whether
a) X1 and X2 are not missing,
b) X1 and X2 are missing,
c) X1 is missing,
d) X2 is missing
The interactions, D1*X2 and D2*X1 regulate the coefficients for X1 and X2 such that:
a) If X1 is missing AND X2 is not, D1*X2 regulates the coefficient on X2, akin to running a regression of Y on just the intercept and X2
b) If X2 is missing AND X1 is not, D2*X1 regulates the coefficient on X1, akin to running a regression of Y on just the intercept and X1.
The inclusion of the 5 additional variables allow you to achieve the coefficient and intercept estimates for all four combinations within one regression.
Scaling the approach up to 3 or more variables
As the number of variables with missing values increase, the number of additional variables needed also increases. In the scenario of 3 variables, for example, assuming all six combinations of missing data can exist for 2 or more observations (so, for example, four observation are missing X1 and X2 but have X3 present; six observations are missing X2 and X3 but have X1 present; five observations are missing X1, X2 and X3) a total of 11 additional variables are needed to create the coefficient and intercept estimates.
It is easy to see that the approach gets more unweildy in scenarios of 4+ variables.