Hi everyone,
I am having troubles extracting the year from my dateset. Some observations have the formal d/m/y, while others have only the year.
I tried the following
encode Acquirordateofincorporation, gen(Age)
generate AcquirorAge = yofd(Age)
gen AGE=(2021-AcquirorAge)
I also tried gen Year=real(substr(Acquirordateofincorporation)), but it doesnt work.
Any help would be highly valuable.
Thank You!
Iulia
Related Posts with extract the year from an inconsistent string date variable
Wondering if ppmlhdfe command already removes autocorrelation? Knowing that it already fixes heteroscedasticity.Hello, I am considering using ppmlhdfe command for my gravity model analysis. Found out that it has …
Regression: Percentage vs nominal returnsWhat are potential explanations for getting insignificant results when regressing the dependent vari…
Difference in DifferenceHi I have a conceptual doubt. I am running a Difference In Difference at the individual level and t…
store graphs in temporary filesHello everyone, I would like to know if there is a command I can use in order to store/save one or …
event study codesDear all I am conducting research regarding an event study on stocks. There are 3 codes to use in s…
Subscribe to:
Post Comments (Atom)
0 Response to extract the year from an inconsistent string date variable
Post a Comment