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: How to agreggate some specific observation to replace in another observation
From 
 
leila Peltier <[email protected]> 
To 
 
[email protected] 
Subject 
 
st: How to agreggate some specific observation to replace in another observation 
Date 
 
Wed, 21 Aug 2013 09:51:24 +0200 
Dear Stata users,
As I entitled my message I want to replace one observation with the
SUM of some other specific obseration in the best and efficient way.
My original  data are :
VAR1        NACE
                 16_18
                     16
281.1            17
112               18
                     19
423.4             20
.1                   21
                   22_23
1713.9            22
702.1              23
                    24_25
2632.3             24
814.5               25
246.5               26
204.8               27
889.2               28
                     29_30
109.7               29
1.6                   30
                              .... and so on
And I want to have :
VAR1        NACE
 393.1         16_18
                     16
281.1            17
112               18
                     19
423.4             20
.1                   21
 2416           22_23
1713.9            22
702.1              23
 3446.8         24_25
2632.3             24
814.5               25
246.5               26
204.8               27
889.2               28
 111.3            29_30
109.7               29
1.6                   30
so for example 393.1 (NACE=16_18) is the sum of VAR1 if
NACE==16&NACE==17&NACE==18
Thanks for your consideration
Leila Peltier
*
*   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/