Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global varlist a b c d ...
- foreach x in $varlist {
- gen \`x'_new = \`x'
- replace \`x'_new = . if \`x' == 0
- }
- egen avg = rowmean(*_new)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement