Arg Max

Discuss statistics related things
Post Reply
Plus
Posts: 2
Joined: Sat Jan 15, 2022 3:33 pm

Arg Max

Post by Plus »

Hello together,

I hope to find help here. I tried to type in the "arg max" function which is supposed to select the maximum of a number of variables and to display the maximum with the name of the variable and not the value itself. Unfortunately, it doesn't work in Jamovi. Does anyone know which function I have to use in Jamovi?
Thanks for your help.
User avatar
jonathon
Posts: 2609
Joined: Fri Jan 27, 2017 10:04 am

Re: Arg Max

Post by jonathon »

hi,

i don't think there's a straight-forward way to achieve that in jamovi. some nested IF statements is probably your best option -- but i appreciate it's not terrible elegant.
Screen Shot 2022-01-18 at 09.55.29.png
Screen Shot 2022-01-18 at 09.55.29.png (595.38 KiB) Viewed 1746 times
User avatar
mcfanda@gmail.com
Posts: 452
Joined: Thu Mar 23, 2017 9:24 pm

Re: Arg Max

Post by mcfanda@gmail.com »

Hi
you can try
=MATCH(MAX(A,B,C),A,B,C)
This will return the index of the variable containing the max (with 1=A,2=B,3=C, etc)
User avatar
jonathon
Posts: 2609
Joined: Fri Jan 27, 2017 10:04 am

Re: Arg Max

Post by jonathon »

oh, that's a good suggestion ... and then if you really wanted the 'A', 'B', 'C' thing, you could recode *that* variable into 1='A', 2='B', 3='C'

jonathon
Plus
Posts: 2
Joined: Sat Jan 15, 2022 3:33 pm

Re: Arg Max

Post by Plus »

Thanks a lot to both of you! That worked perfectly fine.
Post Reply