Continuous Observations - Panel Data

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

J.Kratochvil-08
Posts: 1
Joined: Wed Aug 19, 2009 3:14 am

Continuous Observations - Panel Data

Postby J.Kratochvil-08 » Wed Aug 19, 2009 3:39 am

To whom it may concern,

I would like to enquire how could I obtain an unbalanced panel of data with at least X (e.g. 5) continuous observations on each group?

To be more precise, I have a panel of 17000 firms with data on 10 variables (dividends, cash flow, etc) for a period of 11 years. I have already manipulated the data in Excel so I have only firms that have complete records on all variables of interest. I also need to impose a restriction that firms with less than 5 years of continuous observations are dropped from my sample. Is there any way I could achieve this using EViews?

Thank you very much for your valued time and I look forward to hearing from you.

Yours sincerely,

J Kratochvil

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13603
Joined: Tue Sep 16, 2008 5:38 pm

Re: Continuous Observations - Panel Data

Postby EViews Gareth » Wed Aug 19, 2009 8:03 am

Tricky, but possible.

Create a series that is equal to a moving observation count. Then create a series that is equal to the maximum moving observation count, by cross-section. Then set the sample so that any cross-section whose maximum moving observation count is greater than, or equal to, 5 is included.

Or, in one line:
smpl if @maxsby(@movobs(x,5),@crossid)>=5

where X is one of your series.

Amber
Posts: 31
Joined: Wed Aug 03, 2011 4:35 am

Re: Continuous Observations - Panel Data

Postby Amber » Mon Nov 28, 2011 6:37 am

Dear Gareth,

I have a similar problem, I also have an unbalanced pool containing 800 firms. I need to extract the firms having obs more than 60 and put them in a new workfile. I am stuck in the programing, will you please help me out?

Thanks so much.

Amber

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13603
Joined: Tue Sep 16, 2008 5:38 pm

Re: Continuous Observations - Panel Data

Postby EViews Gareth » Mon Nov 28, 2011 8:48 am

Are you in a pool or in a panel? (panel is much much easier).

Amber
Posts: 31
Joined: Wed Aug 03, 2011 4:35 am

Re: Continuous Observations - Panel Data

Postby Amber » Mon Nov 28, 2011 10:23 am

Dear Gareth, I can re-structure them in a panel. So panel.
Again I really appreciate your time.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13603
Joined: Tue Sep 16, 2008 5:38 pm

Re: Continuous Observations - Panel Data

Postby EViews Gareth » Mon Nov 28, 2011 10:28 am

From a panel, the easiest thing to do make a copy of the current page (easiest way is to drag the page icon at the bottom of the workfile to the right until you get the little "+" symbol, or use the pagecopy command). Then make a series that contains the number of observations by firm:

Code: Select all

series nobs = @obsby(Y, FIRM)
where Y is the name of your data series, and FIRM is the name of your series containing firm names (or identifiers).

Then contract that new page (Proc->Contract current page), using a sample of "if nobs>60".

Amber
Posts: 31
Joined: Wed Aug 03, 2011 4:35 am

Re: Continuous Observations - Panel Data

Postby Amber » Mon Nov 28, 2011 10:54 am

Dear Gareth, you are absolutely brilliant! It works perfectly, thanks so much! :D


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests