8
$\begingroup$

I am wondering how to integrate restricted cubic splines (such as in the rms package) in the imputation models within R mice imputation package.

Context: I am doing biomedical research and have access to a dataset consisting of patient characteristics and data about the patient's disease progression, next to outcomes after medical care (e.g. one year survival). The goal is to build a prediction model based on the patient characteristics and disease progression in order to predict occurrence of certain outcomes. Alas, some patients do not have full information on all the variables. As such I've decided to use multiple imputation techniques to estimate (multiple times) what these missing values would be.

Problem: When using multiple imputation there's this 'rule' called congeniality. This means imputation requires the statistical model used for the final analysis (i.e. the prediction model I want to study) should also be included in the imputation model (preferably with additional information added to it). This also means taking into account possible non-linear associations. As I do not know whether certain predictors have non-linear associations with others, I'd like the imputation models to be able to fit restricted cubic splines. However, I do not really grasp how to do this in mice. I would therefore like help in creating imputation models allowing for rcs, suitable for mice.


On a sidenote to any moderators: I thought this question was suited for Crossvalidated as imputation and splines are specific 'statistical' subjects. However, due to the focus on the programming nature of this 'how to' question I wouldn't mind the question being migrated if you think it is more suitable elsewhere. Following this doubt, I also posted this question on StackOverflow (https://stackoverflow.com/questions/45674088/how-to-use-restricted-cubic-splines-with-the-r-mice-imputation-package)

$\endgroup$
  • 2
    $\begingroup$ If you do not get any helpful responses I would try e-mailing the package maintainer and then posting an answer to your question here. I do not think you will get much additional help on R-help as they may thing it too statistical. $\endgroup$ – mdewey Aug 14 '17 at 14:17
  • 1
    $\begingroup$ @mdewey thanks for the tip; I'll try and come back if there's anything to show $\endgroup$ – IWS Aug 14 '17 at 14:48
  • 2
    $\begingroup$ I added a bounty; but, as I noted, I think this is unnecessarily limited. That is,a bigger question is how do deal with missing data with splines. Maybe the perturb package would be good. $\endgroup$ – Peter Flom - Reinstate Monica Sep 4 '17 at 11:56
  • 1
    $\begingroup$ @PeterFlom Thanks for placing the bounty. I will admit asking for specific functionality within the mice package is limiting. I will look into the perturb package to see what I can learn from it. As you suggested in the bounty text, and in your question here: stats.stackexchange.com/questions/301017/…, having a general answer whether non-linear associations during imputation add to the handling of missing data, is of great interest. $\endgroup$ – IWS Sep 4 '17 at 12:08
4
+200
$\begingroup$

You are right that the imputation model needs to be as rich or richer than the outcome model. The fact that imputation based on full maximum likelihood estimation and imputation done by mice assume linearity everywhere was a prime reason I wrote the R Hmisc package aregImpute function, which creates imputation models automatically using rich additive restricted cubic spline models. So linearity is not assumed for multiple imputation. The default approach in aregImpute is predictive mean matching, which I generally prefer over more parametric approaches (splines are still used; PMM is less parametric on the left hand side of models).

Like mice, aregImpute uses chained equations. Unlike mice, it uses bootstrap draws instead of approximate (assuming multivariate normality) Bayesian posterior draws.

$\endgroup$
  • 1
    $\begingroup$ I've accepted this answer because @frank-harrel appropriately addresses handling possible non-linear associations during imputation in the general setting. For those interested, I was already working on imputation models (e.g. PMM, linear regression, logistic regression) which are compatible with R's mice-package and allow restricted cubic splines. I will post these as an answer here for completeness sake later on, but these models will be untested. So, for those with a similar problem, do look at and use aregImpute. $\endgroup$ – IWS Sep 6 '17 at 8:18
  • 1
    $\begingroup$ @IWS that would be a nice contribution, and you can keep testing it (including showing identical results with mice when zero knots (linearity) are used) that would be nice part of an R package. While doing this you might compare mice and aregImpute code to see where mice is a bit slow and could be speeded up. $\endgroup$ – Frank Harrell Sep 6 '17 at 13:00

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.