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: row wise summation in panel data for particular IDs


From   Eric Booth <[email protected]>
To   "<[email protected]>" <[email protected]>
Subject   Re: st: row wise summation in panel data for particular IDs
Date   Sun, 9 Jan 2011 22:22:00 +0000

<>

On Jan 9, 2011, at 4:13 PM, <[email protected]>  wrote:

> Forgot to add what I have already tried.
> I used:
> 
> ***
> gen c=0
> replace c=1 if id==1 | id==2
> collapse (sum) var1, by (c year)
> egen newid=group(id)
> ***
> 
> But, last line does not run, as old 'id' is already cleard. And, other variables, var2, var3...etc also do not show up any more.
> 
<snip>

Any variables not specified in the -collapse- clist is removed from the dataset. 




- Eric

__
Eric A. Booth
Public Policy Research Institute
Texas A&M University
[email protected]
Office: +979.845.6754


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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