Page 1 of 1

Can we specify the order of columns in a transformed outcome variable for relative risk and odds ratio calculation

Posted: Wed Jul 03, 2024 6:21 am
by divyanair
Hi I am using jamovi 2.5.6. current release. I have a variable "SEX" with two levels Male and Female. And a variable OUTCAT which is a transformed variable with two levels "Successful" and "Unsuccessful".
I would like to calculate the relative risk for having an unsuccessful outcome in males as compared to females. Ideally my 2X2 table should have males in row 1 and females in row 2. Unsuccessful in column 1 and Successful in column 2.
However, jamovi structures the 2X2 tables with Successful in column 1 and Unsuccessful in column 2. Since OUTCAT is a transformed variable I am not able to rearrange the order of the levels. The resulting relative ratio is mathematically correct for the way jamovi structures the table. However, it does not answer the research question of interest in my case.
Is there any workaround? I have attached the a subset of the dataset here.
RR_outcomes.omv
(6.03 KiB) Downloaded 1001 times

Re: Can we specify the order of columns in a transformed outcome variable for relative risk and odds ratio calculation

Posted: Wed Jul 03, 2024 8:01 am
by jonathon
i think the order of the levels is determined by the order of the recode conditions.

if you change your condition to be if $source >= 3, 'Unsuccessful' ... i think you'll get what you want.

cheers

Re: Can we specify the order of columns in a transformed outcome variable for relative risk and odds ratio calculation

Posted: Wed Jul 03, 2024 9:12 am
by divyanair
jonathon wrote: Wed Jul 03, 2024 8:01 am i think the order of the levels is determined by the order of the recode conditions.

if you change your condition to be if $source >= 3, 'Unsuccessful' ... i think you'll get what you want.

cheers
This works Jonathon, thanks!
Perhaps something that you could consider adding as a feature when feasible would be to allow the user to choose reference categories for the rows and columns for relative risk and odds ratio calculations in the contingency tables.

Re: Can we specify the order of columns in a transformed outcome variable for relative risk and odds ratio calculation

Posted: Thu Jul 04, 2024 1:38 am
by jonathon
yeah, that's not a bad idea.

jonathon