Hello everyone,

I have dataset like this,

ID value1 value2 value3 ....
1 10 20 30
1 20 20 30
1 40 20 30
2 10 50 80
2 30 50 80
3 40 30 90
3 50 30 90
. . . .
. . . .
. . . .

As you can see, only the value of var1 is different, and the values of var2 and var3 are all the same.
I want to make my data file like this.

ID value1 value2 value3 ....
1 70 20 30
2 40 50 80
3 90 30 90

value1 is the sum of value1 per ID, and value2 and value3 are fixed values.


I tried to use the duplicates and the egen function, but it did not work and I have no idea anymore.
Is there anyone you can give me a hint about?

Thanks in advance.

HS Jang from South Korea