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

Discuss statistics related things
Post Reply
divyanair
Posts: 3
Joined: Wed Jun 05, 2024 5:26 am

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

Post 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
User avatar
jonathon
Posts: 2840
Joined: Fri Jan 27, 2017 10:04 am

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

Post 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
divyanair
Posts: 3
Joined: Wed Jun 05, 2024 5:26 am

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

Post 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.
User avatar
jonathon
Posts: 2840
Joined: Fri Jan 27, 2017 10:04 am

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

Post by jonathon »

yeah, that's not a bad idea.

jonathon
Post Reply