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
Making "dataex" command work to export lines of code to statalistHello, I can get dataex to work when all I need to do is get state to make a list of values, but I …
graphing a change with xtlineHello, I have issues with the command to generate a graph which will show a change of my variable o…
Discrete choice, eaalogit command, nlcom command and the probability of a given attribute non-attendace patternI'm using the eaalogit command by A. R. Hole ("A discrete choice model with endogenous attribute att…
can we order the variables after -egen- ? Code: egen progsvness=rowmean(techAdvt prodAdvt) order progsvness,a(prodAdvt) the cod…
Ellip (ellipse) issuesGreetings - my first post, so apologies for being ignorant of conventions, any directions/instructio…
Subscribe to:
Post Comments (Atom)
0 Response to Extracting the year from a variable in stata
Post a Comment