Discussion:
SPSS Compute SUM question
(too old to reply)
Juliana
2011-07-12 16:05:47 UTC
Permalink
I have three variables and am trying to get a sum.
Here is the syntax (which we used in 2005):

COMPUTE s_regatt=SUM.3(regactb1, regactb2, regactb3).
Error # 4310 in column 52. Text: )
The numeric argument required for the function specified was not supplied.
Execution of this command stops.
My question is: why is this not working? Is it because I'm using
version 18.0 and this syntax is perhaps too old?
What does the ".3" do in this case?

Thanks for your help!
Rich Ulrich
2011-07-12 20:23:36 UTC
Permalink
On Tue, 12 Jul 2011 09:05:47 -0700 (PDT), Juliana
Post by Juliana
I have three variables and am trying to get a sum.
COMPUTE s_regatt=SUM.3(regactb1, regactb2, regactb3).
Error # 4310 in column 52. Text: )
The numeric argument required for the function specified was not supplied.
Execution of this command stops.
My question is: why is this not working? Is it because I'm using
version 18.0 and this syntax is perhaps too old?
What does the ".3" do in this case?
The ".3" indicates that at least 3 of the following arguments
have to be not-missing for the sum to be used. Since there
are only 3 variables listed, it means that all 3 must be there.
SUM( ) without ".n" will return SYSMIS if any of the components
are missing, so in this case, it could be omitted without changing
any meaning.

As to the Error -- Hard to say. I do not see a function that
*requires* a numeric argument, to be not-supplied before the ")".
I would re-type the line; I would make sure that I don't have
a macro-name like "regactb1", 2 or 3.
--
Rich Ulrich
p***@gmail.com
2017-05-09 12:04:42 UTC
Permalink
Post by Juliana
I have three variables and am trying to get a sum.
COMPUTE s_regatt=SUM.3(regactb1, regactb2, regactb3).
Error # 4310 in column 52. Text: )
The numeric argument required for the function specified was not supplied.
Execution of this command stops.
My question is: why is this not working? Is it because I'm using
version 18.0 and this syntax is perhaps too old?
What does the ".3" do in this case?
Thanks for your help!
p***@gmail.com
2017-05-09 12:08:46 UTC
Permalink
Post by Juliana
I have three variables and am trying to get a sum.
COMPUTE s_regatt=SUM.3(regactb1, regactb2, regactb3).
Error # 4310 in column 52. Text: )
The numeric argument required for the function specified was not supplied.
Execution of this command stops.
My question is: why is this not working? Is it because I'm using
version 18.0 and this syntax is perhaps too old?
What does the ".3" do in this case?
Thanks for your help!
h***@gmail.com
2019-03-14 15:49:57 UTC
Permalink
The syntax is perfectly valid in V18 or later, but the error message indicates that one of your variables is not numeric, i.e., it's a string.
The .3 indicates that the sum should be returned as missing if there are not three valid values, which in this case means no missing values.
HTH,
Jon Peck
Thank you! I had gotten a data set from someone else and didn't even check. Easy solve.
Loading...