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: Re: st: Two identical observations except one variable = sum up this variable and drop one observation
From
miriam geringer <[email protected]>
To
[email protected]
Subject
Re: Re: st: Two identical observations except one variable = sum up this variable and drop one observation
Date
Sun, 19 Jan 2014 19:47:49 +0100
Thanks! This worked fine for me :)
2014/1/19 Red Owl <[email protected]>:
> Miriam,
>
> Try this:
>
> egen newshares = total(Shares), by(PERMNO date Price)
> bysort PERMNO date Price newshares: keep if _n==_N
> drop Shares
>
>
> Red Owl
> [email protected]
>
>
>> miriam geringer <[email protected]> wrote:
>>
>> This is how it looks:
>> PERMNO date Price Shares offered
>> 123456 1 5 8
>> 123456 1 5 6
>>
>> This is how it should look like:
>> PERMNO date Price Shares offered
>> 123456 1 5 14
> *
> * For searches and help try:
> * http://www.stata.com/help.cgi?search
> * http://www.stata.com/support/faqs/resources/statalist-faq/
> * http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/