Dear statalisters,
I have the following variable in my data:
startdate: type : long. Format %12.0g
when i open the data, the content appears as 03oct2001.
gen startyear=year(startdate) , this gives me correct year.
my question is when do we know if we can apply date function such as year, quarter etc. to a variable . I read the menu (http://www.stata.com/manuals13/ddatetime.pdf), but not completely understand it.
thanks,
Rochelle
I have the following variable in my data:
startdate: type : long. Format %12.0g
when i open the data, the content appears as 03oct2001.
gen startyear=year(startdate) , this gives me correct year.
my question is when do we know if we can apply date function such as year, quarter etc. to a variable . I read the menu (http://www.stata.com/manuals13/ddatetime.pdf), but not completely understand it.
thanks,
Rochelle
Comment