Functions do not work when a variable is missing

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
iberkman
Posts: 2
Joined: Wed Jul 21, 2021 5:47 pm

Functions do not work when a variable is missing

Post by iberkman »

I am trying to get the sum of 6 variables but the SUM() function does not return anything when any of the columns contain a missing value.

On one of the images on the documentation, I saw that it was the same for the MEAN() function.
It is OK if it was working this way by skipping the missing values for VMEAN(), but why can't get the MEAN() when one of the vars is missing?

Considering that Jamovi uses a "dynamic spreadsheet", I expect it to run user added functions as any spreadsheet app would.

I am using version 2.0.
Is there a workaround of this issue, except exporting the data and edit it in another spreadsheet app?
User avatar
MAgojam
Posts: 421
Joined: Thu Jun 08, 2017 2:33 pm
Location: Parma (Italy)

Re: Functions do not work when a variable is missing

Post by MAgojam »

Hi, @iberkman.

Do you think that taking a look at the attached screenshot can help you?
tempsnip.png
tempsnip.png (49.01 KiB) Viewed 5771 times
Cheers,
Maurizio
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: Functions do not work when a variable is missing

Post by jonathon »

> why can't get the MEAN() when one of the vars is missing?

hi,

so this is a "statistics thing". in statistics, a missing value means "don't know". so if you take a mean of 3 numbers, and you "don't know" one of them, you also "don't know" the mean.

i appreciate people coming from a different background are sometimes caught out by this.

as maurizio shows, you can just use the ignore_missing=1 argument to achieve what you want.

cheers

jonathon
iberkman
Posts: 2
Joined: Wed Jul 21, 2021 5:47 pm

Re: Functions do not work when a variable is missing

Post by iberkman »

Thank you for your kind responses. İt has been quite useful. I understand the point of restrictions with missing values.

Thanks for the ignore_missing code.
I will use it responsiblely.
Post Reply