On Sun, 11 Dec 2011, Sven Schreiber wrote:
I have a mysterious error occurring which has to do with magically
appearing missing values in the course of constructing lists. I'm
putting together a series (no missings) and an existing list (no
missings), but the resulting list suddenly has 95 obs (out of 140)
with missings! How is that possible?
Here's the exact debug code to show the problem (ripped out of a
bigger script, so it's not self-contained, sorry):
A self-contained version will be the "proof of the pudding".
<excerpt>
loop foreach i endolist
# debug
list debuglist = endolist.$i laglist
series anymiss_i = missing(endolist.$i)
series anymiss_l = missing(laglist)
series anymiss = missing(debuglist)
numofmiss_i = sum(anymiss_i)
numofmiss_l = sum(anymiss_l)
numofmiss = sum(anymiss)
printf "Num of missings here lhs: %d\n", numofmiss_i
printf "Num of missings here laglist: %d\n", numofmiss_i
printf "Num of missings here: %d\n", numofmiss
# end debug
</excerpt>
Not sure how relevant it is, but there's an obvious bug in the
above, in that the value "numofmiss_i" is printed as the "Num of
missings" for both endolist and laglist.
Output:
Num of missings here lhs: 0
Num of missings here laglist: 0
Num of missings here: 95
I should add that this happens inside a function, and while 'endolist'
is not a function argument itself, it contains series and lists that
were passed as arguments. I tried both the 'endolist.$i' variant and the
plain '$i', with the same result.
My feeling is that this is a bug, but as always, I may be missing (pun
not intended) something...
I'll see if I can construct an example script to test this... But if
you can supply one, that would be good.
Allin