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, **statalist.org** is already up and running.

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

From |
Eric Booth <ebooth@ppri.tamu.edu> |

To |
"<statalist@hsphsun2.harvard.edu>" <statalist@hsphsun2.harvard.edu> |

Subject |
Re: st: RE: merging observations in one dataset |

Date |
Tue, 31 Aug 2010 19:51:25 +0000 |

<> See http://www.stata.com/support/faqs/res/statalist.html#toask about attachments being prohibited. In your ods example2, you are adding together the assets and capital for by quarter and company (that is, you add together bank1 and bank3 in quarter1 because they are both owned by companyX), but you apply the summed assets and capital to Bank1 even though this is not just Bank1's assets/capital. I suspect that Bank is meaningless at this point, so you can drop it after you sum by quarter & company, so: **********! clear inp Bank Quarter Assets Capital_Holding str2(company) 1 1 324532 8768 x 1 2 433243 787686 x 1 3 34234 7686 x 2 1 643363 67867 y 2 2 465346 68678 y 2 3 54363 76868 y 3 1 4636436 7678768 x 3 2 463346 7686876 x 3 3 5325345 788768 x end foreach v in Assets Capital_Holding { bys company Quarter: egen `v'2 = total(`v') drop `v' rename `v'2 `v' } drop Bank duplicates drop **********! ~ Eric On Aug 31, 2010, at 2:36 PM, David Kehrl wrote: > sorry again here is the before and after example > > > 2010/8/31 David Kehrl <davidkehrl@googlemail.com>: >> sorry,here an example, >> what i want now is to sum all balance sheet variables (in this case >> assets and capital) at the holding company level.Hope this is more >> clear. >> >> >> >> Bank ID Assets Securities Quarter Holding >> >> 2010/8/31 Nick Cox <n.j.cox@durham.ac.uk>: >>> Merge, aggregate, sum: You are sending conflicting signals. I suggest a worked example showing exactly what you want, before and after. It can be hypothetical; all that is needful is that it be clear. >>> >>> Nick >>> n.j.cox@durham.ac.uk >>> >>> David Kehrl >>> >>> I am working with a panel data set containing quarterly data on >>> balance sheet items for all american banks. I am trying to aggregate >>> the bank level data for banks with common ownership . I have a string >>> variable indicating the highest holding company level. my question is >>> how is it possible to sum those banks with common ownership. >>> >>> * >>> * For searches and help try: >>> * http://www.stata.com/help.cgi?search >>> * http://www.stata.com/support/statalist/faq >>> * http://www.ats.ucla.edu/stat/stata/ >>> >> > <example2.ods> * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**References**:**st: merging observations in one dataset***From:*David Kehrl <davidkehrl@googlemail.com>

**st: RE: merging observations in one dataset***From:*Nick Cox <n.j.cox@durham.ac.uk>

**Re: st: RE: merging observations in one dataset***From:*David Kehrl <davidkehrl@googlemail.com>

**Re: st: RE: merging observations in one dataset***From:*David Kehrl <davidkehrl@googlemail.com>

- Prev by Date:
**Re: st: Re: Fortran** - Next by Date:
**st: interrupted time series** - Previous by thread:
**Re: st: RE: merging observations in one dataset** - Next by thread:
**st: interrupted time series** - Index(es):