At the beginning of August I reported a problem that I had
encountered with use of the smpl and setobs commands inside
functions. From the change log for Version 1.7.7 (items 4 & 5) I had
understood that this problem had been corrected in the new version,
but I have not had time to test it before now. Sadly, my test
scripts still fail in the same way as before.
To recap briefly. My function is designed to deal with unbalanced
panel data, whereas Gretl's standard panel functions insist on
balanced panel data. It proceeds as follows: (a) check that the data
supplied is panel data, (b) extract the panel & time ids to new
variables, (c) define the data as cross section and drop cases with
missing values, (d) carry out the function estimation, (e) attempt to
reset sample to the full data supplied (smpl full), (f) redefine the
data as panel data using the panel & time ids extracted in step (b).
This works as intended when it is supplied with my full test
dataset. However, the program falls over in this final step,
reporting that missing values were encountered, when the sample is
restricted before the function is called. The reason is that the
full data contains 91 panels containing up to 14 time periods in each
panel with 1274 cases in total. Before executing the function I have
dropped all panels with panel_id > 9 (smpl id < 10
--restrict). However, after the "smpl full" command in the function
is run the dataset has reverted to 1274 cases instead of the 126
cases supplied - the first 126 cases correspond to the original cases
but cases 127 onwards consist entirely of missing values because the
function does not know about them. I may be able to deal with this
by dropping cases with missing values for the panel & time ids, but I
understand that "smpl full" should not work in this way.
I can provide my test programs and data but I have had problems in
uploading Zip archives in the past so I would prefer to send them
direct to someone's e-mail address rather than to the mailing list.
Gordon