Hello Statalist--
I have an appended dataset that has a variable named 'filename' which tracks the original file name for each observation.
The filenames are structured in the following manner: 'medicaid_co_0219.csv', where the first two digits of '0219' (i.e. 02) is the month and the final two digits (i.e. 19) is the corresponding year.
I would like to create two variables: one for month and one for year but have no idea how to go about it. Ideally the year should be reflected in four digits (so instead of showing up as 19, it would show up as 2019), but if this is not possible no worries because that is an easy fix. My priority is creating those two new variables.
Any help is greatly appreciated.
Related Posts with [HELP] Creating new variables by splitting another variable
Generalized Difference-in-Differences with a moderator variable - repeated time values within panelHello Statalists! I'm currently calculating a generalized DiD model and I'm unsure if my approach is…
Parameter constraints in MLE estimation for SFAHello, I'm using the following commands after which I would like to set up constraints for the param…
R squared after fixed effects estimation with mi estimate, post:Dear all, I’m using a multiple imputation with the command mi estimate, post: xtreg wage $xlist , fe…
Hausman Endogenity TestHi, I have a reverse causation system. Y1 = f(Y2, X) and Y2 =g(Y1, Z). Using IV both reverse casuat…
Identify a number which is not present in a numbers' listHello everyone, I have a variable called stratum which is supposed to carry numbers from 1 to 10. S…
Subscribe to:
Post Comments (Atom)
0 Response to [HELP] Creating new variables by splitting another variable
Post a Comment