0

I am using Stata 14 and have a dataset which contains a large group of variables:

court_date1 court_date2 court_date3

I would like to change part of each variable name while keeping the number at the end:

court_event1 court_event2 court_event3

Is there a way to do so as a group using the wildcard (*)? They are numbered consecutively, but are not listed consecutively in the dataset.

1 Answer 1

2
rename (*date*) (*event*) 

works with just the names you give. If that catches too much, then

rename (court_date*) (court_event*) 

See help rename groups, including the dryrun option.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.