I have 2 data sets: $A$ and $B$. The variables are common to both data sets with the exception of two, which are both missing in A. Let's call those two additional variables: $b_1$ and $b_2$. We can call the other variables $X = \{x_1, x_2, \dots , x_n\}$.

I would like to use $X$ to impute the corresponding $b_2$ variable for $A$, which we can call $a_2^*$. I would then like to use $b_2, a_2^*$ and $X$ to impute the corresponding variable in dataset $A$, which we can call $a_1^*$.

Two additional caveats to note:

  1. The support of $b_2$ is a limited, discrete set of integers. I would like for $a_2$ to share those characteristics in that $a_2$ also takes on integer values and does not exceed the minimum or maximium of $b_2$.

  2. $b_1$ is distributed log-normally in theory, and in practice, is continuous and greater than zero but top-coded.

I had two potential solutions but cannot reason through the trade-offs or whether both are wrong altogether.

APPROACH I. To get $a_2^*$:

  1. regress $b_2$ on $X$ in dataset $B$.
  2. Get the fitted values.
  3. Predict $a_2^*$ using the $X$ in dataset $A$.
  4. Round $a_2^*$ accordingly so that is takes on the appropriate domain.

I would then get $a_1^*$ in a similar way:

  1. regress $\log(b_1)$ on $b_2$ and $X$ in dataset $B$.
  2. Get fitted values.
  3. Predict $\log(a_1^*)$ using the $X$ and $a_2^*$ in dataset $A$.


  1. Divide the $X$ into "bins" such that the bins are the same in both data sets. For example, if $X$ is year of birth and country of birth, form thinly divided country-year combinations that overlap in both datasets. This could be: a) dividing the birth year into 5-year ranges for each country; b) divide the countries into regions and combine the regions; c) or, if the data are sufficiently rich, use each cross pair of country and birth year.

  2. Estimate the average value within each bin of $b_2$ and round to the nearest integer within the doamin. $a_2^*$ is the average of the $b_2$s corresponding with the $X$ variables in dataset $A$. Repeat the same procedure for $a_1^*$ using $b_1$ and adding $b_2$ to the mix, but no need to round.


In general, I would do something close to your approach I, with some minor tweaks. Assuming that you want eventually to estimate some population parameters on the imputed data, I would use multiple imputation to obtain correct confidence intervals and P-values.

Rounding is generally not recommended, unless you use "adaptive rounding". Variable a2 can better be imputed by predictive mean matching, which always provides imputed values that are observed. Variable a1 can be imputed by normal imputation of the logged data. If you are an R user, this can be done very quickly with mice.

| cite | improve this answer | |
  • $\begingroup$ You have changed the description of your approach I, and my comment no longer applies. $\endgroup$ – Stef van Buuren Apr 21 '13 at 19:53

This may not be the exact answer but it does answer what you are looking for. There is a StatMatch package in R that does the parametric and non-parametric matching based on the common variables which is what you may want to look upon. To use the non-parametric approach you have to define the donation class (usually categorical variables like race, gender, marital status, education)and matching variables (continuous). These approaches are also discussed in details in their book Statistical Matching Practice Methodology. Alternatively, you can also use propensity score to match the two datasets. R has Matching package for this. If you are using Stata, there is user written function called psmatch2. There is also discussion here and here on this topic.

| cite | improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.