Hi Everybody!
I have a data set with the variable "startdate_ms", which describes the moment when participants started filling out an online survey. They start on March 27th, 8:41 AM and finish on the 5th of April 7:20 PM.
I would like to calculate the hours it took from inviting people to the survey to the time that they started it. We sent out survey invitations on March 27th, 8:00 AM, so the shortest amount of time recorded would be 41minutes.
I think it would be best to just create a variable that is set to March 27th, 8:00 AM for all observations and then calcuate the difference in time between the newly created variable and the "startdate_ms", but I don't know how.
Can somebody help me please? Thanks a lot!
Best,
Arto
I have a data set with the variable "startdate_ms", which describes the moment when participants started filling out an online survey. They start on March 27th, 8:41 AM and finish on the 5th of April 7:20 PM.
I would like to calculate the hours it took from inviting people to the survey to the time that they started it. We sent out survey invitations on March 27th, 8:00 AM, so the shortest amount of time recorded would be 41minutes.
I think it would be best to just create a variable that is set to March 27th, 8:00 AM for all observations and then calcuate the difference in time between the newly created variable and the "startdate_ms", but I don't know how.
Can somebody help me please? Thanks a lot!
Best,
Arto
Code:
* Example generated by -dataex-. For more info, type help dataex clear input double startdate_ms 1963989706000.0002 1963989709000.0002 1963989803999.9998 1963989915000 1963989927999.9998 1963989983999.9998 1963990012000 1963990026000 1963990066000 1963990125000 1963990125000 1963990260000.0002 1963990266000.0002 1963990279000.0002 1963990327000 1963990365000.0002 1963990370000 1963990387999.9998 1963990402000 1963990418000 1963990454999.9998 1963990493000 1963990524000.0002 1963990575999.9998 1963990585000 1963990655000 1963990685000.0002 1.9639907e+12 1963990711000 1963990722000 1963990739000.0002 1963990749000 1963990750999.9998 1963990771000.0002 1963990811000 1963990862000 1963990879000.0002 1963990903999.9998 1963990934000 1963990967000 1963991002000 1963991005999.9998 1963991034000 1963991051000.0002 1963991175000.0002 1963991185000 1963991212000.0002 1963991349000 1963991362000 1.9639914e+12 1963991405000 1963991446000.0002 1963991446000.0002 1963991449999.9998 1963991530000.0002 1963991575000 1963991616000.0002 1963991726999.9998 1963991773000 1963991878000 1963991925000.0002 1963991933999.9998 1963991992000.0002 1963992002000 1963992008000.0002 1963992206000 1963992256999.9998 1963992285000.0002 1963992287000 1963992312999.9998 1963992522999.9998 1963992560000.0002 1963992715000 1963992884000 1963992887000 1963992890000 1963992904999.9998 1963992939999.9998 1963992984000 1963993035000 1963993054999.9998 1963993135999.9998 1963993208000.0002 1963993277000 1963993304000 1963993342999.9998 1963993382000 1963993401000 1963993447000.0002 1963993457000 1963993495999.9998 1963993630999.9998 1963993815999.9998 1963993872000.0002 1963993931999.9998 1963993966000.0002 1963994141000.0002 1963994264000 1963994379000 1963994477999.9998 end format %tcnn/dd/ccYY_hh:MM startdate_ms
Comment