-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reasoning behind proportion adjustment in check.patterns of ampute #449
Comments
@lederb I tend to agree with you. @stefvanbuuren @RianneSchouten Lines 541 to 547 in d60fe55
Edit: the above doesn't lead to the likely intended behaviour |
@prockenschaub
at least for me it would make sense if I e.g. have 3 partitions, the first one of 20% in my example without amputations, then two partitions for 40% and 40% each with a proportion of 0.5 (my example) amputed samples? additionally I also was suprised that so far I couldn't find any adjustment of the weight matrix based on which patterns get removed. only the assertion of Lines 315 to 318 in d60fe55
because if I remove some allOnes-pattern rows from the pattern matrix shouldn't those be also removed from the weights matrix? but maybe I simply didn't see the consideration of this yet |
@lederb agreed. I realised that only after submitting the comment, have edited above. To take your example above, the final data should have a proportion of rows with missing data of Regarding the weights, I am not entirely sure. They appear to be handled in the |
@prockenschaub |
You are right, I think. As far as I can tell, the following code randomly assigns a latent missing pattern for each row based on the cleaned patterns and frequencies (i.e., those left when excluding the rows with all 1's). Lines 389 to 392 in d60fe55
For your example above, # X1 X2 X3
# 1 1 1
# 0 1 1
# 1 1 0
and the cleaned # X1 X2 X3
# 0 1 1
# 1 1 0
Lines 402 to 408 in d60fe55
In this function there is then a mismatch between The intended behaviour should be to use |
@RianneSchouten can you drop in? |
Isn't it that the row with ones is redundant? Then it should be excluded from all calculations. |
@gerkovink yes I'd think so too but also that first of all the adjustment of `prop <- prop.one' is for me at least a bit weird if I'd call it using e.g. and second, if the patterns are sliced by removing rows of 1s the weights should probably be too in the same manner. nevertheless, since this is rather an edge case I'll try to port the algorithm for now as is and change it later on if there is some consensus that the current behavior isn't intended just wanted to point you at it, if it actually is unintended behaviour and therefore could require changes |
Dear all,
I will have a look today or tomorrow and give you my opinion/suggestions.
Kind regards,
Rianne
Op do 2 dec. 2021 om 10:38 schreef lederb ***@***.***>:
… @gerkovink <https://github.com/gerkovink> yes I'd think so too but also
that first of all the adjustment of `prop <- prop.one' is for me at least a
bit weird
if I'd call it using e.g. prop = 0.9 but my patterns contain for whatever
reason a 1's row with corresponding frequency of e.g. 0.01, I at least
would expect some proportion of amputed rows closer to 0.9 than 0.01
and second, if the patterns are sliced by removing rows of 1s the weights
should probably be too in the same manner.
or maybe I'm misunderstanding the algorithm somehow then this issue is of
course irrelevant
nevertheless, since this is rather an edge case I'll try to port the
algorithm for now as is and change it later on if there is some consensus
that the current behavior isn't intended
just wanted point you at it, if it actually is unintended behaviour and
therefore could require changes
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#449 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFKCU675SCSKGIDLZQMOQBTUO447VANCNFSM5JB7HJ7A>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
@lederb @prockenschaub thank you for your interest in Honestly, I do not remember anymore why we decided to set Regarding the I will make the necessary changes tomorrow and make a pull request. Thank you both for reaching out, and please do not hesitate to let us know if you encounter other issues. |
Thanks @RianneSchouten |
Closing because it's now merged. |
Hi and sorry for bothering you,
But I'm currently going over the ampute R code as part of a university project and at the moment I'm a bit confused when it comes to the adjustment of the proportion if there are patterns containing only 1's (e.g. no expected amputation for this pattern, if I understood it correctly).
mice/R/ampute.R
Lines 529 to 564 in d60fe55
According to the current implementation if I have e.g.
`
Thus, I'm getting a result where the proportion of amputed rows is close to 0.2.
`
But currently I'm simply not understanding, why the proportion is reduced to 0.2 and not kept at 0.5 which would be like ignoring the patterns of ones and only applying the second and third pattern using frequencies of [0.4/0.8, 0.4/0.8].
I'd really appreciate any hint on why the approach was chosen to set the missingness proportion to the sum of frequencies of the patterns which have only 1's in the pattern?
Sorry for bothering :-)
The text was updated successfully, but these errors were encountered: