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
correlation matrix set-up helpI'm trying to create a correlation matrix using the 'correlate var1 var2 var3...' command. I've got…
scatter marker label needs "%"I've been looking around the web and here on statalist looking for a solution, but haven't seen solu…
boottest following gsem mediation model test non-linear hypothesisI'm estimating a mediation model using gsem: I post a toy version below. I want to use boottest to g…
Hausman-Taylor estimator for binary dependent variableHi all, I am a business student who has had some introductory econometirc courses and has some basi…
Calculating distance between points and major roadsGood afternoon- Is there any way in Stata to calculate distance between points with coordinates and…
Subscribe to:
Post Comments (Atom)
0 Response to [HELP] Creating new variables by splitting another variable
Post a Comment