I'm trying to create a column of fake identifiers and I'm stuck.
I'm using Excel 2010. I would like to create a column of fake identifiers (1, 2, 3 etc.) based on an "auxiliary matrix". The auxiliary matrix tells me the unique observations and how many times they are repeated.
The auxiliary matrix has two columns and will look like the following. (The actual auxiliary that I have is much larger making it impossible to create manually.)
C1-- C2
3 -- 4
2 -- 6
4 -- 2
The first row of the auxiliary matrix tells me the first 12 observations (3*4) have 4 unique identifiers and each unique observation repeats 3 times before the next unique identifier.
The second row tells me that the next 12 observations (2*6) have 6 unique identifiers and each of them repeats 2 times before the next identifier.
Based on the auxiliary given the final output should be a column like
1
1
1
2
2
2
3
3
3
.
.
.
11
11
11
11
12
12
12
12
This means that given the auxiliary matrix my final output column should have 12 unique identifiers (4+6+2) and a total of 32 rows (3*4+2*6+4*2).
I also have access to Stata so if anyone has any idea how to accomplish this in Stata it would be great.