Hello all,
I wish to collapse(sum) all of the variables in 3 company-year observations with 3 company-year observations of another company in my dataset. I would like the second company to absorb the variable values of the first company for the particular years of interest. An example is listed below:
The value in the left hand column is the unique company identifier, which I believe will be needed for coding purposes. The right most column is one particular variable for explanatory purposes.
I would like the observations for company 1 in years 1994, 1995, 1996 to be absorbed by company 2's observations in 1994, 1995, and 1996. Again, although only one variable has been given as a check for anyone willing to help out, I would like all of the variables for each observation of company 1 to be combined with its corresponding company-year observation in company 2. Ideally, I would like the absorbed observations to be removed from the dataset in the process, as I will be doing a nearest neighbor match later in my data analysis.
Should be simple, but I'm new to Stata and want to get this right!
Thanks!
Erik
I wish to collapse(sum) all of the variables in 3 company-year observations with 3 company-year observations of another company in my dataset. I would like the second company to absorb the variable values of the first company for the particular years of interest. An example is listed below:
15349 | 1994 | Company 1 | 2726.6 |
15349 | 1995 | Company 1 | 2775 |
15349 | 1996 | Company 1 | 2730.4 |
10787 | 1994 | Company 2 | 2416.378 |
10787 | 1995 | Company 2 | 3381.461 |
10787 | 1996 | Company 2 | 3953.936 |
10787 | 1997 | Company 2 | 10447 |
10787 | 1998 | Company 2 | 16526.6 |
10787 | 1999 | Company 2 | 32361.6 |
10787 | 2000 | Company 2 | 40404.3 |
I would like the observations for company 1 in years 1994, 1995, 1996 to be absorbed by company 2's observations in 1994, 1995, and 1996. Again, although only one variable has been given as a check for anyone willing to help out, I would like all of the variables for each observation of company 1 to be combined with its corresponding company-year observation in company 2. Ideally, I would like the absorbed observations to be removed from the dataset in the process, as I will be doing a nearest neighbor match later in my data analysis.
Should be simple, but I'm new to Stata and want to get this right!
Thanks!
Erik
Comment