My data has a date variable, and I want to extract year, month, date information from it:
date
03jun1960 00:00:00
06jun1960 00:00:00
07jun1960 00:00:00
08jun1960 00:00:00
09jun1960 00:00:00
10jun1960 00:00:00
13jun1960 00:00:00
So I use:
gen year = year(date)
But generate missing values only.
How to solve this?
Related Posts with Stata extract year from date
difficult to find the problem in MLE codingHello everyone, this is the code i am writing to estimate MLE estimates. while writing this program …
Creating a Dummy variable (Time variant )Dear All,
1. I want to create a Dummy Variable ( Health Status of Indivuduals) which is either yes …
T-Test Using Three GroupsI am trying to do t-test where I have three groups (AIC, GIC, Others) - accordingly I created a vari…
Using the coefplot command to plot odds ratios with p-values in multiple imputation estimations – potential bug to fix!Dear Ben Jann,
I was trying to plot odds ratios of mixed-effects logistic models of the association…
Clustering with imputationI am using a dataset that uses a school-based sampling design, and thus I want to cluster with schoo…
Subscribe to:
Post Comments (Atom)
0 Response to Stata extract year from date
Post a Comment