Dear all,
It's a pleasure to exchange good ideas with you through the forum. It's really helpful!
Recently, I am trying to figure out two problems related to date and time using STATA 14.0MP. First, currently, all the hours in my dataset are shown as "1,2, ....24" since I used "reshape" to deal with them. And I want to replace 1 with 00:00:00, 24 with 23:00:00. I tried the "replace" but it doesn't work since it always hints me with "type mismatch". Second, I have another three columns showing the date data (year, month, day). I also want to generate a new variable and it looks like 2010-01-01 00:00:00. I tried "generate datetime=clock("Year-Month-Date Time", "YMD hms") but it still doesn't work.
If someone can help me with the two problems, I will be really grateful. Thank you in advance!
Best,
Mengrou
Related Posts with Help---convert numbers to time & generate a "date time" variable
not getting the cd command rightHi everyone, I know this is a simple issue - but I simply can't get the cd command to work and I do…
New version of cprdlinkutil on SSCThanks as always to Kit Baum, a new version of the cprdlinkutil package is now available for downloa…
T-Test with foreach (for 4 Variables)Hey listers, I want to do a t-test for 4 variables (buy1,sell1, buy2, sell2) (they all match certain…
Adding variable from one STATA data set to anotherDear Statalist users, Good day to you firstly. I have 2 STATA datasets, where I'd like to transfer …
'codebook' throws error with complicated missings and large samplesI'm attempting to summarize and review a new dataset using 'codebook' and am encountering an error. …
Subscribe to:
Post Comments (Atom)
0 Response to Help---convert numbers to time & generate a "date time" variable
Post a Comment