Hi everyone
In my dataset I have a time variable. It is in format: %tcDay_Mon_DD_HH:MM:SS_CCYY (this is variable “Date”). Storage type float.
According to the ddatetime.pdf I should be able to extract for example year from that variable.
I have tried both:
gen RegYear = clockpart(Date, “year”) and
gen RegYear = datepart(Date, "year")
But both generates an error message (for clockpart): unknown function clockpart() r(133);
What am I doing wrong?
All the best!
Related Posts with Datepart/Clockpart
How to track how long does it take when running a "do file" or a command?Normally I have some codes taking much time and I left the machine running by itself. But it should …
regression discontinuity- panel dataHi, I am new to rd design and analysis. I am working with a household panel data with the following …
standard and generalized versions of the nonlinear Heckman two-step approachHello everyone, for my Master's thesis, I am trying to build a gravity model following the approach…
Comparing the code of reg and reghdfe in a panel data ?I have two sets of code as below, I am wondering what are the differences between these two sets of …
Why reg conusmes more time than reghdfe in running regression on panel data?I have two codes below Code: reg dep_var indep_var i.unit i.period and Code: reghdfe dep_var ind…
Subscribe to:
Post Comments (Atom)
0 Response to Datepart/Clockpart
Post a Comment