I'm trying to merge data from a yearly questionnaire to form a panel.
The date follows the following format:
- cp08a_m
- cp09b_m
- cp10c_m
Meanwhile, the questions' name follow the follow pattern:
- cp08a001
- cp08a002
- cp09b001
- cp09b002
So far, I've tried this:
Code:
forval n = 1/10 { use "$path\Originales\Personality`n'.dta", clear tsunab year : c*_m rename `year' date replace date = 2007+`n' tsunab q : c*(###) rename `q' P(###) save "$path\Modifiees\Personality`n'_m.dta", replace clear }
Thank!
0 Response to Uses using wildcard to rename varlists in a loop
Post a Comment