On Sat, 18 Apr 2020, Sven Schreiber wrote:
Am 17.04.20 um 21:47 schrieb Allin Cottrell:
> On Fri, 17 Apr 2020, Sven Schreiber wrote:
>
>> Yes, your example works. I think I found out the problem:
>>
>> - with bjg.gdt open, in the GUI choose shorter sample
>>
>> - Add/sample range dummy, don't change the setting (equal to active
>> sample), choose name "d"
>>
>> - restore full sample
>>
>> - go to Sample/restrict based on criterion
>>
>> -> no radio button
>>
>> It seems the dummy isn't allowed to contain missing values. Wouldn't it
>> make sense to treat missings as zeros in this context?
>
> I see your point, but my inclination here would be to revise the
> behavior of "Add observations range dummy". I think this should be
> exempt from the usual rule that we write values for newly generated
> series only within the current sample range -- otherwise this dummy
> becomes kinda useless. We should write zeros for observations outside
> of the current sample, not NAs.
>
> Anyone see a reason why not?
>
Is there a scripting / hansl analogue of this action that would be affected?
Not really. There's no variant of "smpl" that offers to create a
dummy representing the current sample range. If you want to do that
via hansl you could do any of the following:
# (a)
smpl full
series d = obs >= <lower> && obs <= <upper>
smpl <lower> <upper>
# (b)
smpl full
series d = 0
smpl <range>
d = 1
# (c)
smpl <range>
series d = 1
smpl full
s = misszero(d)
Allin