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
Quantile regression (QR) for fixed effect panel data : which command is more approriated ?Dear all, i'm working on may PhD thesis ( the impact of risk taking on firm performence) using a da…
Mediation analysis with Sem and OlsHi all, I am currently working on mediation analysis and effects decomposition. Since one of my main…
Past event absorbHi there, I need the stockprice of the last day from the year before the announcementdate I have …
import many files and generate an `id' variable as the file name.Dear All, Suppose that I have the following 3 files (in fact, about 4,000 similar files). The file n…
CEM: Stata vs RDear StataListers, I can't get why the analyzes below, performed in Stata / R, do not produce the s…
Subscribe to:
Post Comments (Atom)
0 Response to Stata extract year from date
Post a Comment