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
Panel spatialHello I'm interesting to road a panel spatial with n=399 and t=12. In the stata 15 I use to do that…
Chi-square test for equality of regression coefficients with panel dataHello, I am using panel data, with firm data where I analyze 13 determinants of ownership by invest…
working with household survey dataI have a data-set which was captured for different houshold within a community it has 40,923 members…
how to display frequencies and percentages to whole numbers only in STATA SE/15.1Hi, 'm working with a data set of 58 variables and 795 observations. Most of the variables are categ…
DiD - sample attrition, what if I impute missing data?Hello, I am estimating a treatment using differences-in-differences. The subjects in my treatment s…
Subscribe to:
Post Comments (Atom)
0 Response to Stata extract year from date
Post a Comment