I'm using STATA/MP 13.0. I have an unbalanced panel data with 37 variables and 756 obs. set on 'Licit' and 'ID'. 'Licit' is the name of the procurement auction and 'ID' is the identifier of the bidding firm. I need to do the following:
1) Generate all possible pair combinations of 'ID', say 'J' combinations.
2) Identify, for every pair identified in 1), if both firms are present in the same 'Licit'. Note that the number of bidders in each Licit changes.
3) Run 'J' spearman correlation tests, between var1 and var2, only on the subset of observations that satisfy 2).
I leave an example table below for the purpose of clarity:
In this example I would do the correlation test (between Var1 and Var2) for pair 1,2 on the following observations:
Thank you very much.
Pablo
1) Generate all possible pair combinations of 'ID', say 'J' combinations.
2) Identify, for every pair identified in 1), if both firms are present in the same 'Licit'. Note that the number of bidders in each Licit changes.
3) Run 'J' spearman correlation tests, between var1 and var2, only on the subset of observations that satisfy 2).
I leave an example table below for the purpose of clarity:
Row | Licit | ID | Var1 | Var2 |
1 | 10/2010 | 2 | 0.3245 | 0.14578 |
2 | 10/2010 | 1 | 0.6521 | 0.4651 |
3 | 10/2010 | 3 | 0.7894 | 0.2514 |
4 | 10/2010 | 4 | 0.9548 | 0.3625 |
5 | 18/2012 | 3 | 0.3411 | 0.1136 |
6 | 18/2012 | 1 | 0.5987 | 0.4712 |
7 | 18/2012 | 2 | 0.6987 | 0.7321 |
8 | C/41 | 1 | 0.2584 | 0.1024 |
9 | C/41 | 2 | 0.2901 | 0.0012 |
10 | C/41 | 3 | 0.1324 | 0.6325 |
Row | Licit | ID | Var1 | Var2 |
1 | 10/2010 | 2 | 0.3245 | 0.14578 |
2 | 10/2010 | 1 | 0.6521 | 0.4651 |
6 | 18/2012 | 1 | 0.5987 | 0.4712 |
7 | 18/2012 | 2 | 0.6987 | 0.7321 |
8 | C/41 | 1 | 0.2584 | 0.1024 |
9 | C/41 | 2 | 0.2901 | 0.0012 |
Pablo
Comment