Hi everyone,
I have a question regarding creating a binary variable based on the day of the week and time. I need weekends to include not only Saturday and Sunday, but all observations between Friday 18:00 and Monday 08:00. My variable looks as like 20feb2017 15:55:00 or as following (%tc):
Thanks in advance!
I have a question regarding creating a binary variable based on the day of the week and time. I need weekends to include not only Saturday and Sunday, but all observations between Friday 18:00 and Monday 08:00. My variable looks as like 20feb2017 15:55:00 or as following (%tc):
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input double dt 1.8547482e+12 1.7965611e+12 1804592580000 1.8311112e+12 1.8468864e+12 1.84464e+12 1.8052416e+12 1.7694534e+12 1.8159123e+12 1.797498e+12 1.8359775e+12 1.8318222e+12 1.8032253e+12 1.8594009e+12 1.7689362e+12 1.779471e+12 1.8214848e+12 1824460440000 1.7756064e+12 1.7777205e+12 1.776933e+12 1.8420858e+12 1.8354384e+12 1.8192783e+12 1.8146898e+12 1.773792e+12 1.8482271e+12 1.8458928e+12 1.8423936e+12 1769097420000 end format %tc dt

Comment