Hi!
A little question: how do I easily add a cross section to a panel? Suppose you have a panel structured as pagestruct @date(date) isocode, and that you want to extend the workfile in order to add a new isocode identifier, say "EGY", for Egypt. Is there a quick command to do this?
Thank you very much in advance.
Regards,
Matías Cabello
Easily add a cross section
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13586
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Easily add a cross section
It is actually really quite difficult, if you're not bringing data in from a foreign source, rather you're just adding a new empty cross-section. The following code will do it, assuming your panel is balanced:
Code: Select all
!obs = @obsrange 'total number of observations
series t = @trend
!timepers = @max(t) 'number of time periods
!newobs = !obs + !timepers 'new total number of observations
pagestruct(freq=u, start=1, end=!newobs) 'remove the panel structure, and add new observations to the workfile page
smpl if @trend >= !obs 'set the sample to be just the newly added observations
isocode = "EGY" 'set crossid
date = date(-!timepers) 'set dateid
smpl @all
pagestruct @date(dateid) isocode
Re: Easily add a cross section
Gareth, thank you for the quick reply! Sad that there is no easy command as it is the case with adding more observations.
Regards,
Matías Cabello
Regards,
Matías Cabello
Re: Easily add a cross section
Is there anyway that this could be adapted to an Unbalanced Structure?
Thanks,
Thanks,
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13586
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Easily add a cross section
Not really. Adding an arbitrary unbalanced cross-section is very difficult.
Who is online
Users browsing this forum: No registered users and 2 guests
