Look up AGGREGATE. Pay attention to the SUM function and the ADDVARIABLES mode.
Ubos wrote
How can I calculate the total of a variable in SPSS using syntax? For example, calculating for each observation the variable Y as the sum of the column X (SEE EXAMPLE BELOW)
XY
102
202
312
412
Thank you very much indeed for all contributors.
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/"When all else fails, RTFM."
PLEASE NOTE THE FOLLOWING:
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (
https://listserv.uga.edu/).