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: Two identical observations except one variable = sum up this variable and drop one observation


From   miriam geringer <[email protected]>
To   [email protected]
Subject   Re: st: Two identical observations except one variable = sum up this variable and drop one observation
Date   Sun, 19 Jan 2014 15:57:35 +0100

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





2014/1/19 miriam geringer <[email protected]>:
> Hey guys,
>
> in my dataset, there are some entries (duplicate entries), which are
> identical (all variables have identical values), EXCEPT one variable.
>
> There is one variable, which has different values. All other variables
> have exactly the same variables.
>
> Now, I want to add/sum up these two different values and keep all
> other (identical) variables the same. After adding up the different
> values, I want to keep only one observation with the summed up value.
>
> Example:
>
> This is how it looks:
> PERMNO      dofd (DAILY_ID)           Price            Shares offered
> 123456             1                                     5
>                6
> 123456             1                                     5
>                8
>
> This is how it should be:
> PERMNO       dofd(DAILY_ID)           Price             Shares offered
> 123456              1                                   5
>               14
>
> Can anyone help?
>
> Thanks!
> *
> *   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/


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