Dear statalist,
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.
In the same procedure, I tried the following to get the hours
but in this case, the hour variable is without minutes and seconds. it is just hour 0......23.
But stata says invalid syntax.
Could anyone help me out, please?
Kindest regards,
Fissha
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
Comment