How to recode values by groups in panel data by using Stata commands? For example, the score for id1 at wave 1 is 3, and I seek to let the score at wave 2 to 4 to be 3.
id wave score
1 1 3
1 2
1 3
1 4
2 1 1
2 2
2 3
2 4
3 1 2
3 2
3 3
3 4















Ideal:
id wave score
1 1 3
1 2 3
1 3 3
1 4 3
2 1 1
2 2 1
2 3 1
2 4 1
3 1 2
3 2 2
3 3 2
3 4 2