Am 29.04.18 um 20:53 schrieb Cottrell, Allin
On Sun, Apr 22, 2018 at 12:46 PM, Sven Schreiber
<svetosch(a)gmx.net> wrote:
> Hi,
> shouldn't this work:
>
> <hansl>
> open CEL.gdt
> series d = $unit
> list a = dummify(d) # works
>
> list b = dummify($unit) # fails, datatype mismatch
> </hansl>
>
> I guess the problem is that dummify needs a series name for the labels of
> the dummies? But still...
Not just the labels of the dummies, but also their names. Functions of this
sort (that return a list of series derivative from some original series) require
that the original series be a member of the current dataset, with a name and
ID number.
In the case of $unit (index of panel-data cross-sectional units), however,
there's already an automated way of generating a set of dummy variables
without adding $unit to the dataset under a user-specified name: it's
genr unitdum
Although I think we discussed at some point that those special genr-type commands should
really be cleaned up and replaced...
Cheers
Sven