gdgen: generate interactions for group comparisons
--------------------------------------------------

-gdgen- generates indicator variables for group membership and group by
rhs variable interactions for estimating a model that allows the effects
of all rhs variable to vary by group.

SYNTAX

gdgen <varnames>, [ Details ]

OPTIONS

varlist     Independent (RHS) variables for which to create interactions.
details     List details of what is done.

NOTE

-gdgen- uses globals created by -gdset- to determine which variable defines
the groups, which group indicator variables to generated, and the prefixes
to use when creating interactions. For example, if:

    varnames: x, z
    g1var:    f
    g0var:    m

Then, these variables are generated:

    f       = 1 if group 1
    f*x     = f by x interaction
    f*z     = f by z interaction
    m       = 1 if group 0
    m*x     = m by x interaction
    m*z     = m by z interaction

GLOBALS

No globals are created.

EXAMPLE - 2008-01-26

. gdaccum2, matrix(PrTenure) reset

    - output omitted -

. gdset2, gvar(male) g0var(f0) g1var(m1) ///
>     g0label(women) g1label(men) details

    - output omitted -

. gdgen2 year art prestige, details

These variables were generated:

Variable     Obs Unique      Mean  Min   Max  Label
--------------------------------------------------------------------------------
m1          2945      2  .6193548    0     1  (male==1)
f0          2945      2  .3806452    0     1  (male==0)
f0year      2945     23  1.723939    0    22  (male==0)*year
m1year      2945     21  2.605772    0    20  (male==1)*year
f0articles  2945     45  2.876061    0    73  (male==0)*articles
m1articles  2945     39  4.333107    0    49  (male==1)*articles
f0prestige  2945     72  1.006757    0   4.8  (male==0)*prestige
m1prestige  2945     83  1.627217    0  4.64  (male==1)*prestige
--------------------------------------------------------------------------------
HISTORY

2008-01-26

exit