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]

st: summing and reshaping the data


From   Sara Neto Machado <[email protected]>
To   [email protected]
Subject   st: summing and reshaping the data
Date   Tue, 11 Mar 2014 14:55:43 +0000

Dear all,

company--workers----V1
10---------------6---------10
10---------------3---------10
10---------------1---------10
11---------------3----------3
15--------------10---------21
15--------------11---------21
18---------------5----------5

What I pretend to do is to sum up the number of workers for each
company but without any values repeating, namely, company numbers
should not repeat. To do the sum I have computed this straigthforward
comand:

egen V1 = sum (workers), by (company)

the latter generated the column V1 but I do not manage to find a way
to not repeat the number of company and the V1 numbers that refer to
the same company. For instance, company 10 continues to have 3
separated lines saying the same total. How do you manage to this two
simultaneous things? What is the most efficient way to not repeat
number of company and the correspondent lines in the V1 column?

thanks in advance for whom responds to this inquiry
Regards,
Sara
*
*   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