Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SPSS Compute SUM question

9,444 views
Skip to first unread message

Juliana

unread,
Jul 12, 2011, 12:05:47 PM7/12/11
to
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).

When I run this, I get the following error message:
>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

unread,
Jul 12, 2011, 4:23:36 PM7/12/11
to

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

Jon Peck

unread,
Jul 12, 2011, 4:11:51 PM7/12/11
to
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

pseudo...@gmail.com

unread,
May 9, 2017, 8:04:44 AM5/9/17
to

pseudo...@gmail.com

unread,
May 9, 2017, 8:08:48 AM5/9/17
to
W dniu wtorek, 12 lipca 2011 18:05:47 UTC+2 użytkownik Juliana napisał:

hartjo...@gmail.com

unread,
Mar 14, 2019, 11:49:59 AM3/14/19
to
Thank you! I had gotten a data set from someone else and didn't even check. Easy solve.
0 new messages