Hi, I'm extremely new to Stata (5 weeks) and am stuck with something my lecturer has asked us to do. I have to use a string variable recording a date to create a date formatted variable which I did as such:
generate Date_Variable = date(originaldatevariable, "MDY")
However I noticed that for all the dates before 1900 the date is recorded in the format Y-M-D as opposed to the rest which are M/D/Y. So all these observations come up as missing values in the new date variable. I have zero idea how to deal with this problem with the very limited knowledge I have as we hadn't even learned about dates before starting this assignment any help would be much appreciated.
I'm using Stata 16, and for the life of me can't find any ways to do this online that I understand.
Related Posts with Rearranging individual dates within a varlist
From string date "DD/MM/YYYY" to month and year variablesHi, How can I convert strings like "01/03/1997", e.i. of type "DD/MM/YYYY", to a new numeric variab…
Generate surrounding observations based on observations of another variableHi there, I am trying to create new observations of a variable based on the observations of other v…
Different models for different hypotheses?Dear all, I have been testing the hypotheses for my master thesis and I have run into a problem. For…
Pseudo R² for meqrlogit using mi estimateHey, I found the following code in this forum to get the pseudo R² for imputed data: Code: local …
PPML with unbalanced panel data, gaps in data, and data asymmetriesI wish to use ppml to estimate a structural gravity model for the years 2000-2016, for ~ 130 countri…
Subscribe to:
Post Comments (Atom)
0 Response to Rearranging individual dates within a varlist
Post a Comment