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
How to interpret Difference-in-Differences and Difference-in-Difference-in-Differences estimation based on indicator variables?Hi all, I am doing an empirical analysis with difference-in-differences (DD) together with differen…
Using parallel command with competing risk modelDear Statalisters, I would like to use parallel command with stcrreg. However, I cannot access to s…
Calculate annual changes via loopsGood morning I would like to report a series of annual variations using a loop. This is my initial s…
Angle Distribution of Loading Subspaces in PCAAngle Distribution of Loading Subspaces in PCA Hi, Are there any codes in Stata to do Angle Distrib…
density calculationDear all, I have a data structure as below and based on the structure I want to calculate five vari…
Subscribe to:
Post Comments (Atom)
0 Response to Help---convert numbers to time & generate a "date time" variable
Post a Comment