Page 1 of 1

Functions do not work when a variable is missing

Posted: Wed Jul 21, 2021 6:21 pm
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?

Re: Functions do not work when a variable is missing

Posted: Wed Jul 21, 2021 8:45 pm
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 6098 times
Cheers,
Maurizio

Re: Functions do not work when a variable is missing

Posted: Thu Jul 22, 2021 11:10 pm
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

Re: Functions do not work when a variable is missing

Posted: Fri Jul 23, 2021 4:39 am
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.