Number of cross sections in panel data
Posted: Sat Sep 29, 2012 3:30 pm
by Quant
Is there any way to find the number of cross-sections for a sample in a panel worksheet with unbalanced data? Eviews reports the number of observations in the upper part near the sample but not the associated cross-sections. A simple way is to regress a key variable on a constant and from the reg window I can get the required data. Is there another way? Thanks in advance.
Re: Number of cross sections in panel data
Posted: Sat Sep 29, 2012 4:38 pm
by EViews Gareth
Do a one-way tabulation on the cross-section identifier, and see how many categories there are. In a program:
Code: Select all
series temp = @crossid
freeze(temp2, mode = overwrite) temp.freq
%temp = temp2(5,1)
string b = %temp
%temp2 = @mid(%temp, 23)
string a = %temp2
scalar n_cross_sections = @val(%temp2)
Re: Number of cross sections in panel data
Posted: Sun Sep 30, 2012 11:15 am
by Quant
Thanks a lot for the prompt reply!!!