It
sounds like you need to combine your date and time variables into datetime variables--e.g.,
NUMERIC DTvar (DATETIME17).
COMPUTE DTvar = DATEvar + TIMEvar.
And then use the CTIME.HRS function...
COMPUTE hours = CTIME.HOURS(EndDateTime-StartDateTime).
HTH.
matthewf wrote
Hello all.
I have a data set based on daily diary data, and would like to calculate time elapsed (in hours) since the participant's first assessment point. Participants complete about 4-6 assessments per day for a week (the number will vary depending on participant availability at time of survey).
In the dataset I have a time stamp (Hours:Minutes:Seconds), day number, and date (Day Date Month). The syntax examples I have found online use a single time point to subtract from (or be subtracted from) - for example, today's date and time. However, in my dataset, individuals start the study on different days and times, making the subtraction time point variable. Is it possible to arrange syntax to calculate this?
Kind regards,
Matt
--
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/).