STATA求助。如何求除本人外的其他人的均值。

2025-04-07 01:00:13
推荐回答(1个)
回答1:

若变量为money,数据如下:

  money

  1. 200

  2. 100

  3. 300


egen  x=sum(money)

replace x=x-money[_n]

replace x=x/_N


运行后,变量X即为所求