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
LRTEST poisson vs negative binomial loopHello everyone, im testing over dispersion in a count variable. I'm using Hilbe's book "Negative bin…
How can I do matching in case control study?Hello. I am doing my master´s degree Project, and it is about cost bacteria resistance disease (mor…
Decomposing String Variable While Retaining Adjacent Column ValueI am trying to convert some data retaining the information from a string variable and replacing the …
Choosing a model for unbalanced panel data with some time invariant independent variablesDear all, I have a question that I have been struggling with for some time now even after reading m…
Graphing in a nested loopHi. I am trying to graph across two variables using a nested loop. My first variable refers to disea…
Subscribe to:
Post Comments (Atom)
0 Response to Stata extract year from date
Post a Comment