Hi all,
I currently have dates in the format eg 2007-05-23. I need to change this into quarter and year variables but don't know how. I am unsure as to whether I need to convert it from string first; and if so how do i do this?
my lecturer gave us a vague pointer of:
* Simplify date into year/quarter*
drop if date==.format %tdNN/DD/CCYY date
gen quarter= quarter(date)
I have tried this, and many variations of this but nothing has worked.
PLEASE HELP IM SO CONFUSED!
Many thanks,
Harriet
I currently have dates in the format eg 2007-05-23. I need to change this into quarter and year variables but don't know how. I am unsure as to whether I need to convert it from string first; and if so how do i do this?
my lecturer gave us a vague pointer of:
* Simplify date into year/quarter*
drop if date==.format %tdNN/DD/CCYY date
gen quarter= quarter(date)
I have tried this, and many variations of this but nothing has worked.
PLEASE HELP IM SO CONFUSED!
Many thanks,
Harriet
Comment