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 count the number of observations at the min and max value?Given the data set, Find the average education level in the sample. What are the lowest and highest …
Evaluating a policy *expansion* using Difference in DifferenceDear All: I am writing to ask for a Difference-in-Difference question. Usually in a standard DiD s…
Comparing median at 2 pointsDear Stata users, I am wondering, is it possible to compare the median of continuous variable (V1-s…
How do I interpret interaction effects in a log-level regression model?My model: log(y)=β0 + β1x1 + β2log(x2) + β3x1log(x2). The x1 variable is endogenous and I instrume…
"Decode" Command on Numeric Variables - Grave IssuesHello, I am appending several rounds/datasets from different demographic and health surveys. The va…
Subscribe to:
Post Comments (Atom)
0 Response to Help---convert numbers to time & generate a "date time" variable
Post a Comment