# (How) can I validly impute data when I am using them to build derivative variables which I then use in spline regression?

As a minimal example of what I'm dealing with, let's say I have 4 continuous variables, $\textbf{x}_1$ through $\textbf{x}_4$. I'm ultimately performing a cubic spline regression with the dependent variable being the difference between the last two variables, $\textbf{x}_5 =\textbf{x}_2 - \textbf{x}_1$, and the predictor being the difference between the first two variables, $\textbf{x}_6 =\textbf{x}_4 - \textbf{x}_3$. My primary interest is in whether these derivative variables relate to each other in a manner fitting the S-shaped curve of prospect theory, which is a nonlinear curve of a somewhat specific, asymmetric form. The alternative hypothesis is that the two relate linearly. My go-to test so far has been to take the derivative variables, fit both a spline and a linear regression model, and compare their AICs; a lower number for the spline model means I'm right (I'm also testing separately to make sure that the predicted losses are larger than the predicted gains using the spline model but I think you can forget about that if you're not into prospect theory).

I have data missing almost completely at random (survey questions that just weren't asked), but there's a whole lot of missingness and my model right now has very little support at extreme values of the predictor, so I'm really interested in multiple imputation to up my efficiency (I'm using R and the mice package by the way). Any way I do it, however, I'm worried that I'm stacking the deck in favor of (or perhaps against) the linear model; doesn't the technique impute datapoints based on its likely values given its variable's linear correlations with other variables? And even if I could specify an alternate, "theoretically informed" functional form, like an S-shaped relationship, then aren't I tainting the results I ultimately get which tell us whether there's evidence of such a relationship as opposed to another one?

I'd also prefer for other reasons to impute the original data rather than just take the differences I'm interested in and just impute those, but then I'm worried that I'm violating the dictum that you include all your analysis terms in your imputation. Heck, I'm worried I'm violating that dictum already if I just impute the differences - the cubic spline model, after all, takes the one predictor variable and turns it into a number of predictor vectors that it then uses in a multivariate OLS regression.

So I have two separable questions, the answers of which will allow me to answer my one real question of "can I do this and if so how":

1. Does indiscriminate multiple imputation (where you just impute and then use everything) bias the relationships between imputed variables toward linearity as opposed to nonlinearity, or otherwise rest on some assumption about how the variables relate if in fact they do relate at all? I know that such bias would be impossible if you simply didn't use the DV in the imputation, but I believe that that's not allowed (gotta use everything in the imputation that you use in the model). Even if you only use the non-imputed DV observations in your subsequent regression model, the imputed values of the IVs would be based on the IV's apparent relationships with the DV as picked up by the MI process, which, I believe/fear, would have been treated by the algorithm as linear, thereby "linearizing" what might actually be a nonlinear relationship.
2. Should the "use everything in the imputation that you use in the model" rule be interpreted literally, such that the exact vectors used in the model must be directly imputed? Or is it admissible to use transformations and combinations of the imputed variables as predictors, calculated after the imputation?

Edit: I may have found the answer here, in the comments to another answer: https://stats.stackexchange.com/a/46801/125170 (if so, sorry for the duplicate question of sorts). Namely, from Stef van Buuren: "$\dots$ the imputation method must adequately capture all features in the data in which you might be interested later on. So if you want to include quadratic terms or B-splines into your complete-data analysis, then the imputation model should be set up in such a way that those features are preserved in the imputed data (Note: this may actually be difficult to achieve, but that's a topic on its own)." I'm pretty clear on passive imputation in MICE, so I can see at least how I would begin to go about including the source terms in my imputation model while keeping their calculated relationships intact, but I'm still not 100% clear on it: if I want to fit a cubic spline model, I have to compute all the separate vectors that the spline function spits out given the one predictor vector, save those output vectors as variables, and then use them to help "linearly" impute the DVs? I can see how that would allow a naturally linear relationship to emerge as a special case, but I guess I'm still hoping there's a way to impute the simpler terms and then use derivative variables calculated between the imputation and the model.