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
Using bayesstats summary on pooled multiple chain data.Dear Statalisters, Is there a way to summarize amalgamated data from multiple chains with bayesstats…
Hausman testI want to investigate if I have to use a random effects or fixed effects model. Therefore I run the …
Counting observations over duplicate datesHi all, I'm an economics student in college, doing my best to learn STATA. I've browsed the forum a…
MGARCH DVECH for panel dataDear all, I am trying to estimate Diagonal VECH GARCH(1,1) model for a panel of 600 firms (ID) and …
convergent validityHow would I calculate the convergent validity of two diagnostic tests where both outcome measures ar…
Subscribe to:
Post Comments (Atom)
0 Response to extract the year from an inconsistent string date variable
Post a Comment