Dear All, I have this dataset:
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input float id int year float pre_rmspe
1 2011 2.1479816
1 2012 2.1479816
1 2013 2.1479816
1 2014 2.1479816
1 2015 2.1479816
1 2016 2.1479816
2 2011 1.1751639
2 2012 1.1751639
2 2013 1.1751639
2 2014 1.1751639
2 2015 1.1751639
2 2016 1.1751639
3 2011  23.91138
3 2012  23.91138
3 2013  23.91138
3 2014  23.91138
3 2015  23.91138
3 2016  23.91138
end
I wish to generate a variable `wanted', which values are all equal to the value of 23.91138 (id=3)? Is there one-line command for this? Thanks.