Dear allstat,
 
I want to write a Do Loop in SPSS that will perform the calculation below 100 times:
 
COMPUTE D1twt=Sum(CTIME.MINUTES(D1f1 - D1s1), CTIME.MINUTES(D1f2 - D1s2), CTIME.MINUTES(D1f3 - D1s3), CTIME.MINUTES(D1f4 - D1s4)).
EXECUTE.
 
The variables names are D1twt, D1f1, D1s1, D1f2, D1s2, D1f3, D1s3, D1f4 and D1s4.
 
For the first run it should create a variable call D1twt using D1f1, D1s1, D1f2, D1s2, D1f3, D1s3, D1f4 and D1s4.
For the second run it should create a variable call D2twt using D2f1, D2s1, D2f2, D2s2, D2f3, D2s3, D2f4 and D2s4.
And so on….
 
Any help will be appreciated
 
Kind regards
*******************************************************************************
Dr Simon T Kometa
Research Computing Specialist
N U I T, Newcastle University
Claremont Tower, Claremont Road NE1 7RU
 
 
You may leave the list at any time by sending the command

SIGNOFF allstat

to [log in to unmask], leaving the subject line blank.