filter nominal variables

General help and assistance with jamovi. Bug reports can be made at our issues page: https://github.com/jamovi/jamovi/issues . (If you're unsure feel free to discuss it here)

by David » Wed Jun 13, 2018 10:29 am

Hi, I have a variable with 16 different nominal text values (levels) and N=400, and I'm trying to filter out all but four levels. I've tried FILTER(var, var == 'level1' or var == 'level2' or var == 'level3' or var == 'level4') as per the recent blog post by Jonathon but it isn't working as expected. Any ideas?

David
David
 
Posts: 30
Joined: Wed Jun 13, 2018 10:18 am

by jonathon » Wed Jun 13, 2018 10:42 am

hi,

can you attach an .omv file?

with thanks
User avatar
jonathon
 
Posts: 1059
Joined: Fri Jan 27, 2017 10:04 am

by David » Wed Jun 13, 2018 1:09 pm

Sure, attached.
thanks.
david
Attachments
aflsmall_finalists.omv
(2.83 KiB) Downloaded 125 times
David
 
Posts: 30
Joined: Wed Jun 13, 2018 10:18 am

by jonathon » Wed Jun 13, 2018 11:18 pm

hi,

so there's two ways you can filters. either using the filters, or the computed variables. for the filters you can just use:

afl.finalists == 'Melbourne' or afl.finalists == 'Sydney' or afl.finalists == 'Adelaide' or afl.finalists == 'Brisbane'

but if you want to 'compute' a new column containing only these values, you'd use your formula:

FILTER(afl.finalists,afl.finalists == 'Melbourne' or afl.finalists == 'Sydney' or afl.finalists == 'Adelaide' or afl.finalists == 'Brisbane')

makes sense?

jonathon
User avatar
jonathon
 
Posts: 1059
Joined: Fri Jan 27, 2017 10:04 am

by David » Thu Jun 14, 2018 5:27 am

That works. Thanks for the quick response.
David
 
Posts: 30
Joined: Wed Jun 13, 2018 10:18 am


Return to Help