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
PANEL DATA & UNIT ROOTS TESTI would like to inquire about some referred arguments in PANEL DATA, is it mandatory to proceed with…
Model for non-linear regression (?)Hey everyone, I really appreciate the support here in this forum. The more I learn about statistic …
percentage change from baseline, Mixed modelI have a mixed effect model with unequal repeated measures rangr from time 1 to time 20. All subject…
Sensitivity testHello fellow stata users! I am in the midst of writing my bachelor thesis and I'm doing a cross-sec…
Calculate standard deviation if I have the confidence interval of an average, the sample size, the average is it possible to go …
Subscribe to:
Post Comments (Atom)
0 Response to Converting R date into STATA date
Post a Comment