| |
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: re: simple list of panel data for output
Tom said:
A rather basic question, but I have tried around with -table-, -list-
and
-collapse- and did not really arrive at the output I want.
For my panel data (200 firms, monthly observations, panelvar=ISIN,
timevar=yrm (i.e. 2005m12)) I want to create a simple summary list like
Name ISIN country free-float #month #spells ...
Company1 2323 GER 0.4 60
1
Company2 9023 UK 0.7 82
2
I would limit the sample by -e(sample)- but have problems with
combining the
different data types, i.e. company name, ISIN and country are the
same over
all observations, free-float should be equal to the value of the
variable at
one point of time (say 2005m12), #month should count the number of
month per
company and #spells obviously present the results from -tsspell- from
ssc.
webuse grunfeld,clear
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
type tom.txt
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/