IBM Support

How do I create a sum of different variables in SPSS for Windows?

Question & Answer


Question

How do I create a sum of different variables in SPSS for Windows? For example, V1 V2 V3 V4 SUM 2 8 12 3 25

Answer

Use SUM function to sum variables in SPSS

e.g
Transform / Compute
Sum = SUM(v1,v2,v3,v4)

The Syntax for this would be:
COMPUTE sum = SUM(v1,v2,v3,v4) .
EXECUTE .

You can also do the following if you have more variables:
COMPUTE sum_all=SUM(v1 TO v102).
EXECUTE.

If you don't use the SUM function and instead just use:
SUM = V1 + V2 + V3 + V4

The resulting SUM variable will be a system missing value IF there are any system missings in any of the summed variables (v1, v2, v3 or v4)

[{"Product":{"code":"SSLVMB","label":"IBM SPSS Statistics"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Not Applicable","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"Not Applicable","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Historical Number

21789

Document Information

Modified date:
16 April 2020

UID

swg21476898