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
cmclogit + margins + interactionsHello! I'm trying to use a McFadden's choice model using cmclogit with case- and alternative-specif…
Fix heteroskedasticity and autocorrelation with RE model in panel dataHello everyone, I am a newbie in using Stata, so hope you guys will explain everything clearly and i…
How can I create a lagged 4 year max variable?The relevant column in my dataset are "gvkey" (a group id), datadate (ex. YYYYMMDD = 20100531), and …
R-squared change statistics (R-squared delta) after using mi imputeHello! I am using Stata 14.1 on Windows (Citrix, so not sure which version). I am new to stata, but…
Greatest lower bound and other alternatives to Cronbach's alphaHello everyone, What are the stata commands for glb (greatest lower bound) for estimating internal …
Subscribe to:
Post Comments (Atom)
0 Response to Converting string to date without any missing values
Post a Comment