Hello,
I probably have a very simple query but I can't work out how to solve it
I have a variable entitled 'y_m_delivery' which is a numeric variable example 199906, I want to create a new variable taking out the month out so that I am only left with the year i.e remove the 06 so it leaves 1999. I have tried
gen year = year (y_m_delivery)
but this does not work
Any help gratefully received
thanks
Related Posts with Extracting the year from a variable in stata
Interpreting regression coefficients in terms of standard deviationHi! I feel it's more of an econometrics/statistics question, but I would also want to learn how I c…
Offset() option in Poisson/negative binomial regressionHello everyone, I am working on count data and have the follow-up time in days. Do I need to log-tr…
delete observations conditionallyDear All, I find this question here (https://bbs.pinggu.org/forum.php?mod...=1#pid57289524). The dat…
ItsaDear I am new using time series analises in stata, so need some help. I am try to use the ITSA comma…
How to write a heckman selection model whose second stage is a finite mixture modelDear statalist: I want to do a heckman seclection model whose second stage is a fmm by joint maximu…
Subscribe to:
Post Comments (Atom)
0 Response to Extracting the year from a variable in stata
Post a Comment