Hello,
I have data which looks like this:
Each row (observation) is a firm, and these variables represent the top 3 most important products (identified by a 8-digit code) for that firm, for example c711b is the most important product for the firm and c712b is the second most important product. In this example I restricted my data to include cases where there is a missing entry for the top product but no missing entry for second or third product, which doesnt make sense. So what I would like to do is reorder these.
So for example the last observation in the data only reports the third most important product but no prior ones so, instead I would like this entry to be in the first slot (so variable c711b instead of c713b). Similarly for the first observation I would like to shift the entries one column to the left. I would like to do this for all cases, but I also have other variables in the data and I dont wanna mess up the ordering of those variables, just these three, please let me know how I can implement this.
Thanks,
Jad
I have data which looks like this:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str9(c711b c712b c713b) "" "20231192" "20231243" "" "20290920" "" "" "16210140" "" "" "25110110" "" "" "23910119" "" "" "16101101" "" "" "" "23920212" end
So for example the last observation in the data only reports the third most important product but no prior ones so, instead I would like this entry to be in the first slot (so variable c711b instead of c713b). Similarly for the first observation I would like to shift the entries one column to the left. I would like to do this for all cases, but I also have other variables in the data and I dont wanna mess up the ordering of those variables, just these three, please let me know how I can implement this.
Thanks,
Jad

Comment