from 1 to 1440 in SPSS

5 pts.
Tags:
SPSS
First: How do i create a time serie in spss from 1 to 1440 (1440 rows)? Second: if this is to be done in a time format (00:01, 00:02, 00:03........23:59) how can I do that? THX

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi,

Below code can work for you task,

Input program.
Loop #i = 1 to 1440.
DO IF #i = 1.
Compute P1 = NUMBER(“00:00”,TIME5).
formats P1 (time5).
Else IF #i>1.
Compute P1 = NUMBER(“00:01”,TIME5) + LAG(P1).
End if.
End case.
End Loop.
End file.
End input program.
Exe.

This creates data from 0:00 to 23:59.

Also If you want 0:01 to 24:00 then change line

Compute P1 = NUMBER(“00:00”,TIME5).

to

Compute P1 = NUMBER(“00:01”,TIME5).

Let me know feedback on the same.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: