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
Nested foreach and forvalue for fixed effect analysis (using xtreg), with saving outputsHi, I am completely new to STATALIST, STATA and some "decent" econometrics, in general. Therefore, …
Vuong (1989) LR testsHi I am running a test whereby I sequentially add a group of fixed effects indicators (eg client fix…
Drop entire individual if number of outliers exceeds threshold levelHello everyone, for a dataset that contains many countries, I have generated a tag that shows me ou…
Descriptive statistics for two categoriesHey statistic pros, I try to make a descriptive statistic for my logistic regression. It should be …
putting the legend to the bottom layer How to do that? Array …
Subscribe to:
Post Comments (Atom)
0 Response to [HELP] Creating new variables by splitting another variable
Post a Comment