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
Panel data: the share of inter and intra variabilities in total variabilities for each variableHello. I have panel data. How could we calculate the share of inter and intra variabilities in total…
Calculate ratio by dateDear All, I'm trying to compute a ratio based on a date (def_date) in the dataset. I try to give a …
Cross sectional dependence/ xtpcseDear Members, I would like to know how do deal with cross sectional dependences. I have started doi…
Accuracy of a new test using the diagti and sf(0) adjusted 95% CII have used the immediate command in STATA to calculate the accuracy and predictive values for a new…
Using gsem with ordered categorical mediatorsHi, I want to run a mediation analysis looking at the direct and indirect effect of adolescent pers…
Subscribe to:
Post Comments (Atom)
0 Response to Converting string to date without any missing values
Post a Comment