Hi, guys!
I want to generate new variable or scalar to
record
the mean of var1-var6 by group: country
I want to write:
foreach v of varlist var1-var6{
bys country:egen m`i'=mean(`v')

or some command like
foreach v of varlist var1-var6{
bys country: sum
return list
gen ...

but I could write neither correctly to solve my problem.

Could anyone give me a hand?
Thanks so much!