amices / mice

Multivariate Imputation by Chained Equations
https://amices.org/mice/
GNU General Public License v2.0
442 stars 107 forks source link

Parabolic minimum/maximum in impute.quadratic #66

Closed SaremS closed 6 years ago

SaremS commented 6 years ago

Hi,

we are currently doing a group presentation on Polynomial Combination and are quite certain that in line 100 of mice.impute.quadratic the term should be y.min <- -b1 / (2 b2) instead of y.min <- -b1 / 2 b2.

Kind regards, Sarem

gerkovink commented 6 years ago

Hi Sarem,

Thanks for noticing. This issue has been fixed in pull request #64 (commit c814486). In the meantime, if you'd like to run the updated mice.impute.quadratic(), you can instruct R with devtools::install_github("gerkovink/mice") to install an updated version of mice that is ahead of stefvanbuuren/mice on this issue. Don't forget to revert back to stefvanbuuren/mice via devtools::install_github("stefvanbuuren/mice") for future compatibility.

All the best,

Gerko

SaremS commented 6 years ago

Hi Gerko,

thanks for your reply. Have been running some simulations now with your branch and it seems that passive imputation is busted now

method_passive_mice <- c("norm", "~I(x^2)", "")imputed_passive_mice <- mice(data = data_missing, m = n_impute, method = method_passive_mice) Gave us highly unrealistic results (both slopes and their standard errors almost 0, which is completely off compared to the other models' results)

Kind regards (and thanks of course for maintaining mice for everyone), Sarem

2018-01-23 8:51 GMT+01:00 Gerko Vink notifications@github.com:

Hi Sarem,

Thanks for noticing. This issue has been fixed in pull request #64 https://github.com/stefvanbuuren/mice/pull/64. In the meantime, if you'd like to run the updated mice.impute.quadratic(), you can instruct R with devtools::install_github("gerkovink/mice") to install an updated version of mice that is ahead of stefvanbuuren/mice on this issue. Don't forget to revert back to stefvanbuuren/mice via devtools::install_github(" stefvanbuuren/mice").

All the best,

Gerko

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/stefvanbuuren/mice/issues/66#issuecomment-359704998, or mute the thread https://github.com/notifications/unsubscribe-auth/ATvgTD3wYbKJsUG3yV-m7fh4U01uLXDJks5tNY-IgaJpZM4RmQt_ .

gerkovink commented 6 years ago

Hi Sarem,

Can you give me more information on your data? Everything seems in order on my end; so unless you can provide me with a minimal working example, I may not be able to reproduce the case you deem unrealistic.

Just in case: is the missingness in your data ignorable? If not, that might explain the results.

Just in case 2: are you using norm to impute a quadratic relation? You should use quadratic

All the best,

Gerko

SaremS commented 6 years ago

Hi Gerko,

apologies, that strange behaviour was due to a programming error that I made. One last issue that we are struggling with: We did an R simulation to show the superiority of Polynomial Combination against Transform, then Impute using the same imputation method that you are describing in your 2013 paper about P.C. Only difference is that we want to vary the beta_1/beta_2 slopes of the data generating process with every iteration to get a little closer to real world examples where population slopes likely won't be 1 and 1. What we find is that the further the beta_2 slope is away from 0, the larger the gap between full data slopes and imputed slopes will become. We have tried to scale the variable using z-transformation but that does not seem to fix the issue for us.

If you find the time for some quick advice here, that would be really helpful to us.

Thanks a lot, Sarem

2018-01-24 23:00 GMT+01:00 Gerko Vink notifications@github.com:

Hi Sarem,

Can you give me more information on your data? Everything seems in order on my end; so unless you can provide me with a minimal working example, I may not be able to reproduce the case you deem unrealistic.

Just in case: is the missingness in your data ignorable? If not, that might explain the results.

All the best,

Gerko

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/stefvanbuuren/mice/issues/66#issuecomment-360288129, or mute the thread https://github.com/notifications/unsubscribe-auth/ATvgTDF6PmwNydwoBTxARFn6trYnKhCMks5tN6fwgaJpZM4RmQt_ .