Hello,
I have been trying to convert a string variable first_date into a date format with multiple methods and failing.
When using the command
gen first_date = date(start_date, "DMY")
format first_date %tddd/mm/CCYY
the majority of observations are missing values. Those that are converted are done so wrongly, for instance 9/0/2014 instead of 9/10/2014. I have noticed that the missing values are generated for all dates with double-digit days, for instance 11/25/2014 is a missing value in the date format.
I have checked that the string variable does not have any mistakes in it, and it was imported from an Excel file, in which it was in date format.
Thanks in advance for your help!
Related Posts with Converting string to date without any missing values
How to compare nested clogit with robust or clustered standard errorsStata/MP 14.2. No access to internet. My data is longitudinal, with 128 individuals and around 700 …
Can my survivor function even look like this?The graph of my survivor function looks like this. I was wondering is that even reasonable? I learne…
Probit regression in StataHi, I don't know if anyone can help with this: I need to run a probit regression for binary variab…
xpose/sxpose keep a variable observations to assign as labels to new variablesDear Statalisters, I am trying to solve the following problem: assign the observations of a variable…
having problem in recodingDear Statalist, I am facing problem in decoding string variable. For example, the following command…
Subscribe to:
Post Comments (Atom)
0 Response to Converting string to date without any missing values
Post a Comment