Good day,

I have two variables (among others): One variable is a binary variable 0 or 1 (sleepwake). The other variable (datetime) is date followed by time (in %tc format). There are 7 days worth of rows, at 15-sec intervals. I want to change the interval from 15 seconds to 1 minute, using the mean of sleepwake (which I will later change to 0 if sleepwake <=0.5 or 1 if sleepwake >0.5, but I know how to do this).

datetime sleepwake
24feb2017 18:01:30 0
24feb2017 18:01:45 0
24feb2017 18:02:00 0
24feb2017 18:02:15 1
24feb2017 18:02:30 1
24feb2017 18:02:45 1
24feb2017 18:03:00 0
24feb2017 18:03:15 0

datetime sleepwake
24feb2017 18:01:30 0.25
24feb2017 18:02:30 0.50

Please help me find a solution.

Thanks so much.