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
Graph label while using "ciplot" commandDear All, Here is my data. It is in wide form (survey data). For instance I will use Vitamin D vari…
To convert 'blue digit ' column into 'black digit' column (string to normal variable)Hi. I am using a data set which contains more than 600,000 observations on household expenditure. T…
How to divide column totals with an output that includes 95%CIDear all, I have a dataset with two continuous variables. I had calculated the total of each column …
stcurve showing wrong analysis (follow-up) timeHi Statalist, I am running a survival analysis to find the difference in occurence of an event betw…
Time seriesI use ID as a symbol for the company I use, each company has more than 1 event with different dates.…
Subscribe to:
Post Comments (Atom)
0 Response to extract the year from an inconsistent string date variable
Post a Comment