Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | miriam geringer <miriam.geringer@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
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 <rh.redowl@liu.edu>: > Miriam, > > Try this: > > egen newshares = total(Shares), by(PERMNO date Price) > bysort PERMNO date Price newshares: keep if _n==_N > drop Shares > > > Red Owl > redowl@liu.edu > > >> miriam geringer <miriam.geringer@gmail.com> 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/