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]

st: RE: RE: selecting consecutive years, panel data


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: RE: RE: selecting consecutive years, panel data
Date   Sat, 25 Sep 2010 17:09:07 +0200

<>

Make the last line of the first example

***********
di in red "Number of Firms: `r(max)'"
***********


HTH
Martin


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Martin Weiss
Sent: Samstag, 25. September 2010 17:00
To: [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

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Biljana Dlab
Sent: Samstag, 25. September 2010 16:52
To: [email protected]
Subject: st: selecting consecutive years, panel data

Hi,


I have runs of consecutive observations (following instructions in FAQ,
bellow) - Now how do I drop runs of consecutive observations if the
number of consecutive observations is less than 4?

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 in
the panel and how many firms with currency CAD / USD I have in panel
(the currency is defined as string)?

Thank you.

Biljana


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Nick Cox
Sent: 22 September 2010 16:20
To: '[email protected]'
Subject: st: RE: RE: selecting consecutive years timeseries

This is an FAQ 

FAQ     . . . . . . Identifying runs of consecutive observations in
panel data
        . . . . . . . . . . . . . . . . . . . . . . . N. J. Cox and V.
Wiggins
        8/02    How do I identify runs of consecutive observations
                in panel data?
                http://www.stata.com/support/faqs/data/panel.html

Nick 
[email protected] 

Martin Weiss

ssc d tsspell

by NJC may help.

Biljana Dlab

I have period from 1980-1995 and about 50 firms. For some firms
there is date for all year for other firms not.

Now I need to select those firm-years that are at least 4 consecutive
years long. 

Any ideas and tips how to do that?

*
*   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/

*
*   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/

*
*   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/

*
*   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