0
votes

I am currently using SPSS to process my data. eg. I have data like

V1 V2 V3

258 235

236 567

123 987

576 234

678 456

for the values of V3, I wanna compute the case of V1 minus the former case of V2 they are 236-235, 123-567, 576-987, 678-234

Because I have more than one million data , and I wanna do a loop compute

so how should I write in Syntax? Thank you!

1
I can't make sense of your question. Does not COMPUTE C12 = V1 - V2. do what you want, or are you asking something else? - Andy W
i think my question is obscured, - user3278216
C11 and C12 are value for variable V1, C21 and C22 are values for V2, the value for V3 is X, X = C12-C21, how can i write Syntax, because I have more than one million records, i wanna do a loop computation, thank you - user3278216

1 Answers

1
votes

Statistics automatically loops over the cases. You just need to write the compute statement. If you meant the previous case by "former case of V2", see the LAG function.