Dear Stata supporters,

I am currently working on my master thesis and therefore want to use STATA. However, currently I hit a wall with my progress. Unfortunately I am not experienced enough to solve this problem by myself, neither after searching through this forum. Hopefully someone can help me out.

Currently my data is listed as follow:

Year Country VarX
1999 1 9
1999 2 99
1999 3 999
2000 1 8
2000 2 88
2000 3 888

Originally for more than 4500 observations. However, I would like to make pairs for country per year. Which should look as follow:

Year Country Country VarX VarX
1999 1 2 9 99
1999 1 3 9 999
1999 2 1 99 9
1999 2 3 99 999
1999 3 1 999 9
1999 3 2 999 99
2000 1 2 8 88
2000 1 3 8 888
And everything that comes after...

How can I make this happen? can someone help me out.