"variable at_exp_share11 already defined" is always displayed when I run the command. But I can confirm that I have not created this variable before.

The specific procedures are as follows



. foreach lev in 9 1 {
2. bys pcode_st`lev': egen at_exp_share11=total(exp_share11)
3. gen exp_share_aggup=exp_share11/at_exp_share11
4. }

variable at_exp_share11 already defined

r(110);

Thank you in advance. I am happy to provide more information.

Zhang Ningning