Hello everyone, I need some help in composing a code for replacing missing values with the value of a specific year-observation. I have data structured in the following way:

id company year dum1
1 comp1 2013 1
1 comp1 2014 .
1 comp1 2015 .
1 comp1 2016 .
1 comp1 2017 .
1 comp1 2018 .
1 comp1 2019 .
2 comp2 2013 0
2 comp2 2014 .
2 comp2 2015 .
2 comp2 2016 .
2 comp2 2017 .
2 comp2 2018 .
2 comp2 2019 .
3 comp3 2013 .
3 comp3 2014 .
3 comp3 2015 .
3 comp3 2016 .
3 comp3 2017 .
3 comp3 2018 .
3 comp3 2019 .


I would like to replace missings in variable dum1 with the values of year 2013 observations so that for company 1 all subsequent years-obs. will have 1 as value, for company 2 will have 0 as value, for company 3 will have . as value.

How can I do it?

Many thanks!