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
Dropping observation under conditionsDear expers, my data: Code: * Example generated by -dataex-. To install: ssc install dataex clear …
Nested loop over observations and varlistHello everyone! I am trying to do something which, upon reading manuals and forum entries, seems per…
Drop variable if varlabel contains certain expressionHey Statalisters, I am trying to drop all variables that have the expression "Domestic Currency" in…
density plothello. I am not familiar with the density plot and I have a simple question. I have information abou…
How to treat differing likert scalesHi all, I am using panel data from British Election Survey to perform a fixed effect OLS regression …
Subscribe to:
Post Comments (Atom)
0 Response to Rearranging individual dates within a varlist
Post a Comment