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
Print conditional statementI wrote this code to get Stata to print a conditional statement: Code: if p_value < alpha /// …
The trace plot creation after data imputationHello, I struggle with creating trace plots after data imputation. Imputation code has the followi…
Descriptive Statistics per Country - STATA to Work-OutputHi, I have started to work on my data do-file for my thesis I managed to run the commands I need a…
PCA for repeated measuresHello Statalist contributors, I am looking for a solution to a problem that seems unanswered on thi…
Help regarding panel categorical data analysis in Stata I am recently researching crises and the usefulness of different models in predicting them. It woul…
Subscribe to:
Post Comments (Atom)
0 Response to Datepart/Clockpart
Post a Comment