Dear Statalisters,
I have industry pair data, the example below shows that I have 2 row industries (Industry_row, 11A0, 11B0), and 5 column industries (Industry_column 1121, 11A0, 3122, 1129, 2111).
Industry_row Industry_column xvar
11A0 1121 2
11A0 11A0 1
11A0 3122 4
11B0 1129 2
11B0 2111 3
I want to add industry pair observations for the combinations that are not currently in the dataset and assign zero to xvars, that is I want to add
11A0 11B0 0
11A0 1129 0
11A0 2111 0
11B0 1121 0
11B0 11A0 0
11B0 3122 0
I need this for creating a square matrix of Industry_row* Industry_column , My real data has 70,000 records.
If you could help with some programming tips, that will be greatly appreciated.
Thanks,
Rochelle
Comment