Is it possible to rename a variable using regex?
Let's say I have a variable:
g wth_t1_xxx = .
Is it possible to rename this variable using a regular expression so that it would be wth_xxx_t1? I'm looking for a pattern to capture the content between the underscores and move to the end, while taking the content at the end and move it to the middle.
Related Posts with Rename using regex?
Multi-column heading in outreg2Hi everyone, Using outreg2, is it possible to create a column heading that spans several columns of…
How to repeat the same difference-in-differences analysisHello, I am now trying to repeat the same difference-in-differences analysis with changing treatmen…
Outreg2 providing one-sided p-valuesDear Stata users, I have a question regarding the one-sided p-value in outreg2, which I use to expo…
Random dummy variable with restrictionsI have a panel dataset and want to create a random dummy variable with mean 0.2 that marks a random …
Regression output - Bug?Hi everyone, I am trying to run some old code (version 14.2) using a new Stata version (15.1) on a …
Subscribe to:
Post Comments (Atom)
0 Response to Rename using regex?
Post a Comment