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
Continuous Observations - Panel Data
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Continuous Observations - Panel Data
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.
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.
Re: Continuous Observations - Panel Data
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
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
Are you in a pool or in a panel? (panel is much much easier).
Re: Continuous Observations - Panel Data
Dear Gareth, I can re-structure them in a panel. So panel.
Again I really appreciate your time.
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
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:
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".
Code: Select all
series nobs = @obsby(Y, FIRM)
Then contract that new page (Proc->Contract current page), using a sample of "if nobs>60".
Re: Continuous Observations - Panel Data
Dear Gareth, you are absolutely brilliant! It works perfectly, thanks so much! :D
Who is online
Users browsing this forum: No registered users and 1 guest
