Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: RE: merging observations in one dataset


From   Austin Nichols <[email protected]>
To   [email protected]
Subject   Re: st: RE: merging observations in one dataset
Date   Tue, 31 Aug 2010 15:46:36 -0400

David Kehrl <[email protected]>:
Read the FAQ before you post; attachments are not allowed.
Give your examples in Stata-ese:

clear all
input id quarter assets capital str1 co
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
egen long ca=sum(assets), by(co quarter)
bys co quarter: g long ck=sum(capital)
by co quarter: replace ck=ck[_N]
l, noo sepby(co)
collapse (sum) assets capital, by(co quarter)
l, noo sepby(co)


On Tue, Aug 31, 2010 at 3:36 PM, David Kehrl <[email protected]> wrote:
> sorry again here is the before and after example
>
>
> 2010/8/31 David Kehrl <[email protected]>:
>> 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 <[email protected]>:
>>> 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
>>> [email protected]
>>>
>>> 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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index