Hi,
I am trying to convert R dates into STATA dates but unable to do so.
For example, the R date in POSIXct format is 1231084800 this is number of seconds from 1970-01-01 00:00. The actual date in MDY format is "Jan 4th, 2009"
I followed the process described here - https://www.stata.com/manuals/ddatet...ersoftware.pdf
generate double statatime = rtime - tC(01jan1970 00:00)
format statatime %tC
But STATA gives the answer as "14jan1950 05:58:04" which is wrong.
How to I get the correct date and how can I fetch month, year, day values from the date?
Thanks!
Related Posts with Converting R date into STATA date
upside down bar graphHi, Can someone please tell what code in STATA can I use to make this upside down bar chart. I coul…
r(134) too many valuesDear Statalist, I've run my regressions and now I would like to confirm my results on a panel of fi…
When to reject H0 fisher-type unit root testWhat to do when the P-value of chi-squared is significant but normal inverse Z is not? …
Mixed model syntax and output questionHello -- I am trying to fit a mixed effect linear model to some data. For context, I have 4 raters …
Time Series and Fixed Effects Estimation ProblemsI am a beginner in Stata and I am having some trouble when undertaking regressions in Stata. For so…
Subscribe to:
Post Comments (Atom)
0 Response to Converting R date into STATA date
Post a Comment