I have hourly panel data and want to generate an hour of a day for further analysis. From stata help file and other sources, I learn that the hh stata function does this.
But I did not get success.
To be precise, to get the months of the year, I use the following code, and went well.
Code:
gen month_num =month(mdy(month, day, year))
Code:
gen hour_num =hh(mdyhms(month, day, year, hour))
But stata says invalid syntax.
Could anyone help me out, please?
Kindest regards,
Fissha
0 Response to Generating an hour of a day variable in stata
Post a Comment