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
Regression using variable given in decimal changeI'm doing ARIMA with several variables on a time series. Arima value decimalvar1 decimalvar2, ar(1) …
Which stata command can I use to conduct a randomization check?Hi all. As part of my dissertation, I conducted a between-subjects factorial experiment with two fac…
Multilevel data managementHello everyone, Im working with a dataset that includes 2 levels of data: individual level data and…
Help with the creation of a lagged standard deviation variableHello all, I am hoping for a bit of help with the generation of a new variable. I have some experie…
Survival analysis help, parametricHi there, I need help with my research on the duration of a strategy adopted by private equity firm…
Subscribe to:
Post Comments (Atom)
0 Response to Datepart/Clockpart
Post a Comment