[RESOLVED] Calculate mean with missing values

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)

by Naïde » Thu Oct 04, 2018 2:54 pm

Hello,

I was wondering if there was any way to calculate a mean on several columns despite missing values ?
I attached a small simple example file.
In fact, when I add a computed variable and enter the mean formula, the mean is calculated only when all the columns have a value. When there is one missing value in a column, the mean is not calculated. When there is a missing value, I would like to calculate the mean on the others values, "ignoring" the missing one. Is it possible ?
Thanks for the help !
Attachments
Classeur2.omv
(1.37 KiB) Downloaded 76 times
Naïde
 
Posts: 4
Joined: Thu Oct 04, 2018 2:37 pm

by jonathon » Thu Oct 04, 2018 10:13 pm

ni naide,

no, sorry, this isn't possible at this time. we're just looking at the best way to provide it now.

we'll hopefully be able to come back to you soon.

with thanks

jonathon
User avatar
jonathon
 
Posts: 815
Joined: Fri Jan 27, 2017 10:04 am

by Naïde » Fri Oct 05, 2018 9:28 am

Hi Jonathon,

Thanks for your quick answer. I am looking forward to test this improvement !
Best,
Naïde
 
Posts: 4
Joined: Thu Oct 04, 2018 2:37 pm

by jonathon » Sun Oct 07, 2018 10:57 pm

hi naide,

we've added an ignore_missing argument to the MEAN and the SUM now.

you can go: MEAN(A, B, C, D, ignore_missing=1)

you'll need the 0.9.5.2 or newer

jonathon
User avatar
jonathon
 
Posts: 815
Joined: Fri Jan 27, 2017 10:04 am

by Naïde » Mon Oct 08, 2018 9:46 am

Hi Jonathon,

I've just tried the ignore_missing argument and it works perfectly, thanks a lot !!!!!
And thanks for the amazing work you're doing on this software !

Best,
Naïde
 
Posts: 4
Joined: Thu Oct 04, 2018 2:37 pm

by WorkScientist » Thu Feb 21, 2019 3:53 pm

I'm testing out the ignore_missing=1 functionality, and it seems that it works to average two vectors' values (ignoring missing) for missing values on the second vector, but not first. For example (where . indicates a missing value),
X Y MEAN(X,Y,missing=1)
2 . .
3 5 4
. 3 3

Possibly I'm missing a command in the function. Assist, please and thanks? :)
WorkScientist
 
Posts: 1
Joined: Wed Jan 09, 2019 11:59 pm

by jonathon » Fri Feb 22, 2019 1:37 am

hmm, seems to work here. could you double-check? this is what i get:

Screen Shot 2019-02-22 at 12.35.37.png
Screen Shot 2019-02-22 at 12.35.37.png (450.99 KiB) Viewed 559 times


cheers

jonathon
User avatar
jonathon
 
Posts: 815
Joined: Fri Jan 27, 2017 10:04 am


Return to Help