Hi everyone, I would like to ask some help in order to extract year from a string variable (year of incorporation) that is structured in this way: 12/9/1998.
I tried to encode the variable (year of incorporation), change the format in %td and then use the code year(year of incorporation) but Stata returns me a year that does not match with the one in the date. For example, for 12/9/1998 it returns 1970.
How can I solve the problem?
Thanks!
Related Posts with Extract Year from a string variable
Problem with directoryHi Stata Community, I've used maptile many times before, but recently bought a new computer. All th…
Issue with PMG estimatorHi, I'm new to Stata. I have a panel data which contains 6 sub-groups. There are two inputs GDP (L…
Generating Dummy variables based on Monthly periodHello everyone i am really new to stata and i have an econometrics paper due in a couple days and i …
Cross Classified Model using Panel DataHello, I'm trying to run a cross classified model using panel data and I was hoping to get some hel…
Generating Dummy variables based on Monthly periodHello everyone i am really new to stata and i have an econometrics paper due in a couple days and i …
Subscribe to:
Post Comments (Atom)
0 Response to Extract Year from a string variable
Post a Comment