Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: selecting consecutive years, panel data


From   Amy Dunbar <Amy.Dunbar@business.uconn.edu>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
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" <martin.weiss1@gmx.de>
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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index