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: RE: selecting consecutive years, panel data
From
Amy Dunbar <[email protected]>
To
"[email protected]" <[email protected]>
Subject
st: RE: selecting consecutive years, panel data
Date
Sun, 26 Sep 2010 13:51:15 +0000
Also consider unique.
*************
* ssc inst unique
* count unique firms in a panel sample
*************
unique gvkey
Amy Dunbar
UConn
_______________________________________
Date: Sat, 25 Sep 2010 17:00:25 +0200
From: "Martin Weiss" <[email protected]>
Subject: st: RE: selecting consecutive years, panel data
<>
" And how do I count number of observations in panel data - for example
how many firms (the variable is defined as number) in total I have"
***********
egen myfirms=group(firmid)
su myfirms, mean
di in red "Number of Firms: r(max)"
***********
"...how many firms with currency CAD / USD I have in panel
(the currency is defined as string)?"
***********
egen mytag=tag(firmid)
cou if mytag & currency=="CAD / USD "
***********
HTH
Martin
*
* 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/