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
How to replace the age and exit at a certain ageDear All, Is there a way I can replace all age with the current age+1 till 2040 at one go and also …
Standardization of time in panel data with different treatmentsHi everybody I am working with panel data and investigating how employees experience the transfer f…
Generating risk-adjusted hospital admission rates using Empirical Bayes Means with melogitDear Statalisters, I am using -melogit- to compare hospital admission rates between 177 public hosp…
Generate variable (maybe needs a loop)I have the following data set: Parent Subsidiary Variable Value US UK revenue 10 US FRA revenue 15 …
When do I use GMM style instruments in a panel Vector Autoregression model?Dear all, I am applying a panel Vector Autoregression model using the command pvar from Abrigo and …
Subscribe to:
Post Comments (Atom)
0 Response to extract the year from an inconsistent string date variable
Post a Comment