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
Create a table comparing output from diffrent regression modelsHello All, A frequent problem I have in Stata is that I have to run different regression models (fo…
Matching to identify a sub-sample of individuals that share similar characteristicsHi all, As opposed to using PSMTACH2 to calculate the propensity scores to identify treatment and c…
Odds ratio or hazard riskhi all, how can i calculate odds ratio or hazard risk with a contingency table. for example: tabulat…
XTSET and TTSET Error MessageHello, I have a panel dataset which is evenly balanced but when I run xtset (or ttset) command to s…
Question on How to Make a Panel Table Output with Categorical RegressionHi, I am new to Stata and this forum. I have a question which I spent lots of time on but did not fi…
Subscribe to:
Post Comments (Atom)
0 Response to Converting R date into STATA date
Post a Comment