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.
Related Posts with Change time interval of %tc format
merging datasets with interval dates and unbalanced panelHi stata users, I face a problem I try to find an "easy" way to merge two datasets, one having a var…
Xtlogit with weights workaroundHi, I'm trying to run a random effects logit models with weights. The syntax I was trying was xtol…
Multilevel Multinomial logistic regression with group-level variablesHello, I am trying Multilevel Multinomial logistic regression with gsem command. However, there's a …
Fixed effects Poisson unbalanced panel with Binary endogenous regressor: GMM moment evaluator programHi Everyone, I have a question. I'm writing a moment evaluator program to try and achieve consistent…
General QuestionHello, Kindly let me know why it is recommended to use OLS and Fixed effect model before using GMM. …
Subscribe to:
Post Comments (Atom)
0 Response to Change time interval of %tc format
Post a Comment