I end up with something like...
Code:
rename my_variable my_variable_x egen my_variable = mean(my_variable_x), by(group) drop my_variable_x
I'm looking for single-line code. This should be doable with Stata's concept of local macros, I guess?
Specialized on Data processing, Data management Implementation plan, Data Collection tools - electronic and paper base, Data cleaning specifications, Data extraction, Data transformation, Data load, Analytical Datasets, and Data analysis. BJ Data Tech Solutions teaches on design and developing Electronic Data Collection Tools using CSPro, and STATA commands for data manipulation. Setting up Data Management systems using modern data technologies such as Relational Databases, C#, PHP and Android.
rename my_variable my_variable_x egen my_variable = mean(my_variable_x), by(group) drop my_variable_x
0 Response to egen MY_VAR = mean(MY_VAR), by(group)
Post a Comment