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 !
[RESOLVED] Calculate mean with missing values
[RESOLVED] Calculate mean with missing values
- Attachments
-
- Classeur2.omv
- (1.37 KiB) Downloaded 881 times
Re: Calculate mean with missing values
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
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
Re: Calculate mean with missing values
Hi Jonathon,
Thanks for your quick answer. I am looking forward to test this improvement !
Best,
Thanks for your quick answer. I am looking forward to test this improvement !
Best,
Re: Calculate mean with missing values
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
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
Re: Calculate mean with missing values
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,
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,
-
- Posts: 1
- Joined: Wed Jan 09, 2019 11:59 pm
Re: [RESOLVED] Calculate mean with missing values
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?
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?
Re: [RESOLVED] Calculate mean with missing values
hmm, seems to work here. could you double-check? this is what i get:
cheers
jonathon
cheers
jonathon
-
- Posts: 1
- Joined: Fri Jun 28, 2019 10:32 am
Re: [RESOLVED] Calculate mean with missing values
"ignore_missing" comes really handy, thanks!
I was wondering if there is any way to calculate a mean on several columns when missing values don't exceed a certain number? For example, when taking the mean of 10 columns, I'd like to calculate the mean when there are missing values in only 2 or fewer of the columns.
I was wondering if there is any way to calculate a mean on several columns when missing values don't exceed a certain number? For example, when taking the mean of 10 columns, I'd like to calculate the mean when there are missing values in only 2 or fewer of the columns.
Re: [RESOLVED] Calculate mean with missing values
hey,
there's not an easy way to do it, but you can do it with the IF and IFMISS functions. for example if you have the columns A, B, C, D you could create a computed column called `N Missing` with the formula:
IFMISS(A, 1, 0) + IFMISS(B, 1, 0) + IFMISS(C, 1, 0) + IFMISS(D, 1, 0)
and then a mean computed column with the formula:
IF(`N Missing` <= 2, MEAN(A, B, C, D, ignore_missing=1))
(or you could combine these two formulas into one, but it becomes harder to read).
cheers
there's not an easy way to do it, but you can do it with the IF and IFMISS functions. for example if you have the columns A, B, C, D you could create a computed column called `N Missing` with the formula:
IFMISS(A, 1, 0) + IFMISS(B, 1, 0) + IFMISS(C, 1, 0) + IFMISS(D, 1, 0)
and then a mean computed column with the formula:
IF(`N Missing` <= 2, MEAN(A, B, C, D, ignore_missing=1))
(or you could combine these two formulas into one, but it becomes harder to read).
cheers
-
- Posts: 1
- Joined: Mon Jun 08, 2020 8:24 pm
Re: Calculate mean with missing values
I am teaching my stats class remotely using jamovi (thank you!). However, we have been trying to use ignore_missing with the latest version and it is not always returning a score using the specified number of items. For example, for a 6 items scale, we specified that only 1 item could be missing. In some cases where there are several items missing, there is still a scale score. Are we pushing the limits of jamovi?