Count within Cross-sectional identifiers

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

tchaithonov
Posts: 168
Joined: Mon Apr 13, 2009 7:39 am
Location: New York City

Count within Cross-sectional identifiers

Postby tchaithonov » Wed Jun 17, 2009 8:27 am

Hi Everybody,

I am trying to do a count of the number of cross sections within my pooled OLS model, and I have "market" as my cross-section ID. How should I do it? Please share your thoughts. Thanks.

Tchaithonov

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

Re: Count within Cross-sectional identifiers

Postby EViews Gareth » Wed Jun 17, 2009 9:14 am

Assuming you're working with a Pool object, you can do:

scalar count = poolname.@ncrossest

where poolname is the name of your pool object.
Follow us on Twitter @IHSEViews

tchaithonov
Posts: 168
Joined: Mon Apr 13, 2009 7:39 am
Location: New York City

Re: Count within Cross-sectional identifiers

Postby tchaithonov » Wed Jun 17, 2009 10:11 am

I am actually not working on a pool object. I have a stacked dataset with a cross section identifier (mkt) and a time series identifier (week), and now I have set it up as a balanced panel. As I was told, I should be running panel (so, using LS instead of POOL) for the large numbers of cross sections I have. So, my series are not "pooled" together. Is there still a way to do so? Please let me know. Thanks.

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

Re: Count within Cross-sectional identifiers

Postby EViews Gareth » Wed Jun 17, 2009 10:22 am

Yep, you can use:

equation_name.@ncross
Follow us on Twitter @IHSEViews

tchaithonov
Posts: 168
Joined: Mon Apr 13, 2009 7:39 am
Location: New York City

Re: Count within Cross-sectional identifiers

Postby tchaithonov » Wed Jun 17, 2009 10:37 am

I tried it, but eviews keeps complaining that it has a syntax error for the @ncross line. I could find @ncoef and @regobs in the manual/help file, but not @ncross.

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

Re: Count within Cross-sectional identifiers

Postby EViews Gareth » Wed Jun 17, 2009 10:49 am

What's the version number and build date of your copy of EViews (both available from Help->About EViews)
Follow us on Twitter @IHSEViews

tchaithonov
Posts: 168
Joined: Mon Apr 13, 2009 7:39 am
Location: New York City

Re: Count within Cross-sectional identifiers

Postby tchaithonov » Wed Jun 17, 2009 10:59 am

I tried this on an Eviews 6 Apr 20 2007 build and an Eviews 5 Jan 20 2006 build.

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

Re: Count within Cross-sectional identifiers

Postby EViews Gareth » Wed Jun 17, 2009 11:05 am

Update your EViews 6.
Follow us on Twitter @IHSEViews

tchaithonov
Posts: 168
Joined: Mon Apr 13, 2009 7:39 am
Location: New York City

Re: Count within Cross-sectional identifiers

Postby tchaithonov » Wed Jun 17, 2009 11:19 am

Neat! It works now. Thanks for your help.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 55 guests