Page 1 of 1

Second filter with !=NA does not work

Posted: Fri Apr 07, 2023 7:56 am
by jachmovi
Hi everyone,

I have a problem filtering missing values. To show you, I made an example data spreadsheet in jamovi. In this data set I have two variables, A and B with some missing values. If I filter them like this, it works:

Filter 1: A !=NA
Filter 2: B !=2
Bildschirm­foto 2023-04-07 um 09.12.17.png
Bildschirm­foto 2023-04-07 um 09.12.17.png (15.89 KiB) Viewed 2339 times
But what I want to do is filter missing values of variable A in the first filter and missing values of variable B in the second filter, like this:

Filter 1: A !=NA
Filter 2: B !=NA

But then filter 2 is not working.

Bildschirm­foto 2023-04-07 um 09.12.50.png
Bildschirm­foto 2023-04-07 um 09.12.50.png (16.99 KiB) Viewed 2339 times
Can someone explain to me why that is and how I could fix it?

Of course, there is the option to put the first filter like this:
Filter 1: A !=NA
and B !=NA

Then it works!
Bildschirm­foto 2023-04-07 um 09.54.59.png
Bildschirm­foto 2023-04-07 um 09.54.59.png (15.71 KiB) Viewed 2339 times
But because I have a more complex case in real life, where I need the option to put the filter on and off seperataly, this sadly isn't an option for me.

Thank you very much for your help and any ideas on how to fix this.

Re: Second filter with !=NA does not work

Posted: Fri Apr 07, 2023 5:03 pm
by MAgojam
Hey @jachmovi,
maybe this tip (screenshot) could help you.

It is a listwise filter for the missing with the variables of interest.
Quick and easy to add or remove variables.
ScreenShot_20230407190118.jpeg
ScreenShot_20230407190118.jpeg (178.31 KiB) Viewed 2326 times
Cheers,
Maurizio

Re: Second filter with !=NA does not work

Posted: Fri Apr 07, 2023 6:16 pm
by jachmovi
Hey Maurizio,
thank you so much, this helps a lot! 
So instead of 
Filter 1: A != NA
Filter 2: B != NA
I just wrote
Filter 1: IF (A)
Filter 2: IF (B)
and it works just as I wanted it to.
I still don't get why the first way doesn't work, but the problem is solved.
Thanks again, you saved my day!

Re: Second filter with !=NA does not work

Posted: Sat Apr 08, 2023 3:35 am
by reason180
It seems to me that there's something wrong with how jamovi handles filtering that references NA. Below, the top screenshot shows an improper result when NA is referenced, but the bottom screenshot shows a correct result when a different approach is taken--one that does not reference NA.

Re: Second filter with !=NA does not work

Posted: Sat Apr 08, 2023 10:50 am
by jonathon
if you could create an issue over at https://github.com/jamovi/jamovi/issues that would be great.

with thanks

Re: Second filter with !=NA does not work

Posted: Sat Apr 08, 2023 11:58 am
by jachmovi
Thank you @reason180, for replicating this issue and showing another alternative way to get the desired outcome.

@jonathon I have created the issue as wanted.

Best