Thanks for your feedback.
Encoding and labelling works good as well, but I must say just adding the
additional string vars in the -by()- option is most convenient.
- Tom
______________________
Thomas Erdmann
Buetzmattweg 22
79594 Inzlingen
Germany
+ 49 (0) 176 - 24 23 89 34
+ 41 (0) 76 - 592 08 95
[email protected]
-----Urspr�ngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Marcello Pagano
Gesendet: Sonntag, 21. Januar 2007 16:26
An: [email protected]
Betreff: st: Re: simple list of panel data...
> From: Kit Baum <[email protected]>
> Date: January 21, 2007 10:09:17 AM EST
> To: [email protected]
> Subject: simple list of panel data...
>
>
> Tom said
>
> What I still could not solve is how to integrate string variables
> here,
> especially regarding the -collapse- process.
>
> I.e. showing the respective "country" or another variable that is
> filled
> with strings. Sorry if I'm overlooking something obvious.
>
>
> Not a problem:
>
> webuse grunfeld,clear
> lab def comp 1 A 2 B 3 C 4 D 5 E 6 F 7 G 8 H 9 I 10 J
> lab val company comp
> g y50 = (year==1950)
> bys company: gen inv50=sum(y50*invest)
> tsspell,c(invest>L.invest)
> egen nspell=max(_spell),by(company)
> collapse (sum) inv50 (mean) nspell (count) year, by(company)
> list
> outsheet using tom.txt, replace noquote
> type tom.txt
>
> As the company names are tab-delimited, you do not need quotes,
> even if they include commas and spaces in their names.
>
> In order to make a numeric variable out of company name (with its
> name as its label), use -encode-, and use the new variable created
> by encode as the by-variable in the collapse.
>
>
>
> Kit Baum, Boston College Economics
> http://ideas.repec.org/e/pba1.html
> An Introduction to Modern Econometrics Using Stata:
> http://www.stata-press.com/books/imeus.html
>
>
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/