not computing correctly

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)
Post Reply
statsdontlie
Posts: 3
Joined: Mon Aug 07, 2023 11:31 am

not computing correctly

Post by statsdontlie »

In my study i have baseline and 3 follow-up timepoints (4month, 6-month, 12-month). I have participants who don't have a score for every follow-up timepoint. But i want to say 'Yes' if any of the follow-ups have a <= -3 change from baseline. And 'No' if any have >-3 instead. But somehow the code is producing Yes/No for only participants that have data across all timepoints. For example, in ROW7, there is a participant with just the 4month score but they have a >-3 score from baseline, which should produce 'No' but the column is empty. I tried many different codes but cannot understand what I am doing wrong. Please help!

Here is my current code: IF(4month - baseline <= -3 or 6month - baseline <= -3 or 12month - baseline <= -3, 'Yes', IF(4month - baseline > -3 or 6month - baseline > -3 or 12month- baseline > -3, 'No', 'No'))

Edit: I tried ignore_missing=1 but it doesn't seem to work in IF() functions (see photo below)
Attachments
screenshot2.png
screenshot2.png (11.23 KiB) Viewed 2757 times
screenshot.png
screenshot.png (61.74 KiB) Viewed 2794 times
Last edited by statsdontlie on Tue Aug 08, 2023 5:38 am, edited 2 times in total.
Bobafett
Posts: 76
Joined: Thu Jul 18, 2019 11:33 am

Re: not computing correctly

Post by Bobafett »

I think the problem is that your code is expecting data to be present (either above or below a set value) - however, as these cases have an absence of a value, your code doesn't take this into account and so the outcome is left blank. Try including a reference to 'ignore_missing' or such like in your code and this might then include those with some blank columns.
statsdontlie
Posts: 3
Joined: Mon Aug 07, 2023 11:31 am

Re: not computing correctly

Post by statsdontlie »

Bobafett wrote: Mon Aug 07, 2023 1:18 pm I think the problem is that your code is expecting data to be present (either above or below a set value) - however, as these cases have an absence of a value, your code doesn't take this into account and so the outcome is left blank. Try including a reference to 'ignore_missing' or such like in your code and this might then include those with some blank columns.
Hello, I've tried that too but it seems to only work outside of IF() functions. I've updated a screenshot of the error message it gave me when I tried to do that.
User avatar
MAgojam
Posts: 422
Joined: Thu Jun 08, 2017 2:33 pm
Location: Parma (Italy)

Re: not computing correctly

Post by MAgojam »

Hey @statsdontlie,
would you like to take a look at the screenshot, i put a suggestion that might be what you are looking for to compute your new variable.
ScreenShot_20230808154340.jpeg
ScreenShot_20230808154340.jpeg (203.17 KiB) Viewed 2740 times
Cheers,
Maurizio Agosti
https://www.jamovi.org/about.html
statsdontlie
Posts: 3
Joined: Mon Aug 07, 2023 11:31 am

Re: not computing correctly

Post by statsdontlie »

MAgojam wrote: Tue Aug 08, 2023 1:51 pm Hey @statsdontlie,
would you like to take a look at the screenshot, i put a suggestion that might be what you are looking for to compute your new variable.
ScreenShot_20230808154340.jpeg

Cheers,
Maurizio Agosti
https://www.jamovi.org/about.html
Amazing! Thank you so much that worked!!
Post Reply