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
Displaying Percent and Rawpercent Statistics as columns using table with multiple subgroupsHi all, Not sure if I've describe the problem properly in the title, but I've been trying to learn …
variable RR already defined variable Lower not found error during Mantel–Haenszel estimate of the rate ratioHello everyone, I hope you're all doing fine. Firstly, I wanted to express how grateful am I for you…
Highlight lines on spaghetti plotHello, I am working with the following dataset. Code: * Example generated by -dataex-. To install:…
Interpreting MCA predict rowscoresDear Stata users, I have a question regarding the interpretation of the variable created from using…
Keep multiple observations in a variableDear Statalist I have a dataset that include 179 countries. However, i only want to keep 51 of them…
Subscribe to:
Post Comments (Atom)
0 Response to Datepart/Clockpart
Post a Comment