I'm trying to use IFMISS and VMEAN to impute missing values in a transformation but IFMISS is giving a missing value when the source is missing, rather than the desired value. I've checked it with IFMISS($source,0,1) and it doesn't work with that either.
The source variable is an ordinal integer.
Please tell me what I'm doing wrong. I'm using jamovi 1.0.4.0
Cheers,
Wake
Am I missing something with IFMISS?
Am I missing something with IFMISS?
- Attachments
-
- ifmiss.jpg (116.78 KiB) Viewed 5509 times
Re: Am I missing something with IFMISS?
ah yes, you're right (the issue is actually to do with the V functions in transformed variables - VMEAN($source) is (incorrectly) returning a missing value. it works with computed variables.
working on a fix.
cheers and thanks for reporting.
jonathon
working on a fix.
cheers and thanks for reporting.
jonathon
Re: Am I missing something with IFMISS?
hmm, this is actually a tricky one ...
in most cases, the current behaviour is the correct one. if you're transforming a variable, and the source is a missing value, you typically want the result to be a missing value.
if one considers a series of recode conditions, for example, you don't want a missing value to be recoded to the 'else' value - you want it to come through as a missing value.
however, this seems to be an exception to that rule ... i'll have to think about the best way to handle it.
jonathon
in most cases, the current behaviour is the correct one. if you're transforming a variable, and the source is a missing value, you typically want the result to be a missing value.
if one considers a series of recode conditions, for example, you don't want a missing value to be recoded to the 'else' value - you want it to come through as a missing value.
however, this seems to be an exception to that rule ... i'll have to think about the best way to handle it.
jonathon
Re: Am I missing something with IFMISS?
The problem seems to primarily be with IFMISS, rather than VMEAN.
IFMISS appears to work when using "Compute" but not when using "Transform".
Apart from instances like this where transform doesn't appear to work I feel that the compute function is redundant and could be removed altogether. Transformations can be calculations as well as arbitrary recodes.
Cheers,
Wake
IFMISS appears to work when using "Compute" but not when using "Transform".
Apart from instances like this where transform doesn't appear to work I feel that the compute function is redundant and could be removed altogether. Transformations can be calculations as well as arbitrary recodes.
Cheers,
Wake
Re: Am I missing something with IFMISS?
still thinking about this, but, this is actually the way you're *supposed* to recoding missing values:
cheers
jonathon
cheers
jonathon
Re: Am I missing something with IFMISS?
after thinking about this for a while, i think the current behaviour is probably the best one.
i could change it so it will transform missing values, but it ends up breaking a lot of other use-cases. i think the solution here is to use `if $source == NA`.
i notice, we do actually recommend this in our docs: https://blog.jamovi.org/2018/10/23/tran ... ables.html
it might be worth us adding a note about why this IFMISS strategy doesn't work.
thanks for bringing this up though.
jonathon
i could change it so it will transform missing values, but it ends up breaking a lot of other use-cases. i think the solution here is to use `if $source == NA`.
i notice, we do actually recommend this in our docs: https://blog.jamovi.org/2018/10/23/tran ... ables.html
it might be worth us adding a note about why this IFMISS strategy doesn't work.
thanks for bringing this up though.
jonathon
Re: Am I missing something with IFMISS?
I'm very happy to use if $source == NA instead of IFMISS. It just didn't occur to me to try it.
If IFMISS doesn't work in transform then it would be great if it either didn't appear in the list of available transformations or if it could enter if $source == NA into the function window when selected.
Best wishes,
Wakefield
If IFMISS doesn't work in transform then it would be great if it either didn't appear in the list of available transformations or if it could enter if $source == NA into the function window when selected.
Best wishes,
Wakefield
Re: Am I missing something with IFMISS?
so it *does* work in the transforms, it's just that when the $source value is NA, the result is always NA unless there's an explicit if $source == NA condition. so one could still use IFMISS in transforms, say like this:
if $source > VMEAN(IFMISS($source, 1.0, $source)) use ...
so it can still be useful in transforms
jonathon
if $source > VMEAN(IFMISS($source, 1.0, $source)) use ...
so it can still be useful in transforms
jonathon