Hello,
I am trying to truncate times to only the hour using floor so that I can merge all data for that hour. However, using the code below, the times are off by seconds/minutes
gen mergehour= floor(time/3600000)*3600000
format mergehour %tc
time mergehour
04may2015 08:10:00 04may2015 08:00:10
15may2019 13:59:00 15may2019 12:59:27
I can't figure out why this would happen, any suggestions?
Thanks
Related Posts with Binning times in hours, rounding error?
Wald exogeneity test with -biprobit-Dear Statalisters Is there an in-built command/option with -biprobit- which shows the result for Wal…
Factor variable and interaction in syntax commandHi, I am trying to add interaction terms into a simple new command. Something simple like this: C…
Problem in labels with splitvallabels Hi all, I am having problems in labelling graph with splitvallabels and catplot, I suspect that the…
Egen with an if statementHi, I have a long dataset with multiple observations per patient id. I’m trying to generate a medic…
Coding participants with metabolic syndromeHi there, I would like to categorize participants in a dataset that I am using by whether or not th…
Subscribe to:
Post Comments (Atom)
0 Response to Binning times in hours, rounding error?
Post a Comment