I use Eviews 12 March 22 2021 build.
I am wondering about the behaviour of @sumsby in the example code below. I would expect that the optional sample literal in by-group statistics (like @sumsby @meansby, etc,) makes the statistics being computed using the sample literal rather than the pre-selected page sample but it doesn't seem to be the case with panel data.
This behavior can certainly be circumvented by correspondingly preselecting the page sample. Nevertheless, it is a source of unexpected, potentially misleading results and can be considered a bug in view of the documention of the statsby function which says: "By default, EViews will use the workfile sample when computing the descriptive statistics. You may provide the optional sample s as a literal (quoted) sample expression or a named sample."
Best, mamo
Code: Select all
wfcreate a 2001 2010 2
series x=(@trend+1)*10^(crossid-1)
smpl 2001 2001 if crossid=1
' The following line shows "9 1 1" while the expected result should be "9 99 9"
show @sumsby(x, crossid, "2009 2009") @sumsby(x,"2009 2009") @sumsby(x,"2009 2009 if crossid=1")