Trying to post this for the first time. Hoping the text shows...
I'm trying to add the values from one variable for one observation to another observation. I have the following:
obs;. char_state; char_county; yr; num_days
51015; 51; 015; 2010; 2
51017; 51; 017; 2010; 1
51019; 51; 019; 2010; 3
51021; 51; 021; 2010; 5
.... .. ... .... .
51515; 51; 515; 2010; 2
I want to add the num_days value from 51515 (2) to the num_days value for 51019 (3) and 51017 (1) and get the new total of 5 for observation number 51019 and 3 for observation number 51017 and delete 51515, so I'd end up with:
obs.; char_state; char_county; yr; num_days
51015; 51; 015; 2010; 2
51017; 51; 017; 2010; 3 (new total)
51019; 51; 019; 2010; 5 (new total)
51021; 51; 021; 2010; 5
.... .. ... ... .
51515 deleted from the table.
Thanks!
I'm trying to add the values from one variable for one observation to another observation. I have the following:
obs;. char_state; char_county; yr; num_days
51015; 51; 015; 2010; 2
51017; 51; 017; 2010; 1
51019; 51; 019; 2010; 3
51021; 51; 021; 2010; 5
.... .. ... .... .
51515; 51; 515; 2010; 2
I want to add the num_days value from 51515 (2) to the num_days value for 51019 (3) and 51017 (1) and get the new total of 5 for observation number 51019 and 3 for observation number 51017 and delete 51515, so I'd end up with:
obs.; char_state; char_county; yr; num_days
51015; 51; 015; 2010; 2
51017; 51; 017; 2010; 3 (new total)
51019; 51; 019; 2010; 5 (new total)
51021; 51; 021; 2010; 5
.... .. ... ... .
51515 deleted from the table.
Thanks!
Comment