Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: summation of values within one column in a panel dataset

Subject   st: summation of values within one column in a panel dataset
Date   Sun, 1 Aug 2010 04:46:34 +0000 (GMT)

I have a panel dataset and I wonder if it is possible to generate in  Stata a 
new variable that is the sum of observations for a  variable for two of my 
panels only (ie it is a summation of values  within one column).

example: my panels are companies A,B,C.... and I have quarterly observations on 
profits, revenues, etc. 

Date    company    profits

comp    profit        date
A             120        2000
A            320      2001
B            102       2000
B            101        2001
C           156        2000
C            136        2001

Since company A and B merged in 1999, I need to use the sum of their profits for 
my analysis in years 2000 and 2001. So I need to build a new variable A+B:

comp    profit        date
A+B       122       2000
A+B       421         2001

Is there a command for panel dataset  in Stata that allows me to do  such data 
manipulation (panels are  unbalanced, btw)? Unfortunately, I couldn't find any 
information in the  manuals and on internet. Many thanks in advance!

Best regards,

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index