gdprdif: Compare predictions for two groups using prvalue
---------------------------------------------------------

The SPOST -prvalue- command is used to computed predicted probabilities
for both groups and group differences in probabilities. -prvalue-
used the information held in globals created by -gdset- and -gdxis-
to make it easier to specify the levels of variables.

The prediction for group 0 is computed first and saved; then the prediction
for group 1 is computed. The difference reported is:

    Pr(y|group 1) - Pr(y|group 0).

SYNTAX

gdprdif, [ cis(string) INTeract GROUPmean QUIetly debug
    MATrix(string) cval(string) rownm(string) title(string)
    print skip NOVal NOSig Bounds ]

OPTIONS

cis(string)     Level of control variable for use with x();
                    for example, cis(k5=2). This allows you to set values
                    for the RHS variables that will override values that
                    are contained in the gd global variables.

constant        Computations assume a model has a constant term plus a
                    dummy variable to indicate group membership, rather
                    than no constant and two indicators of group membership
                    which is estimated by -logit- with the -nocon- option.

NOINTeract      Computations assume a model without interations. Group
                    membership is only included with the dummy variable
                    that was set as gvar(). By default, a fully
                    interactive model is assumed.

GROUPmean       Use within group means; by default grand means from the
                    combined groups are used.

QUIetly         Suppress output from -prvalue-.

debug           Print details to help debug program or verify output.

KEY POINT

The strings created by -gdxis- and specified by the -cis- option in -gdprdif-
are used in a pair of -prvalue- commands called by -gdprdif-. The first
-prvalue- computes predictions with variables at these values:

    x($gisg0 $xis0 $cis0) rest(zero)

Then, a difference is computed at the values:

    x($gisg1 $xis1 $cis1) rest(zero)

In the x() option to -prvalue-, values of variables specified later
override those specified earlier. For example,

    prvalue, x(a=1 b=2 a=0)

will set a=0, thus overriding the initial a=1. Accordingly, the -cis-
option lets you specify values that override the mean values contained
in the globals created by -gdxis-.

OPTIONS PASSED TO -gdaccum-

The -gdprdif- command automatically sends results to -gdaccum- which stores the
predictions. These options are passed to -praccum-:

matrix(string)     Name of matrix to hold accumulated results.

cval(string)       Value of the control variable; if not specified, the
                       value of the control variable is listed as missing,

rownm(string)      Name to label matrix row for current set of results.

title(string)      Title to label matrix when printed.

print              Print matrix.

skip               Skip a row in the matrix after recording this information.

noval              Do not print the values column.

nosig              Do not print the column indicating if a differences is
                       significant.

bounds             Print upper and lower bounds for predictions for each
                       groups. Note bounds are save to matrix even when
                       they are not printed.
reset              Start with a new matrix if the matrix already exists;
                       if not specified, results are added to the end
                       of the matrix.

GLOBALS

Program uses globals created by -gdset- and -gdxis-.

NOTE

The program -gdprdif- computes the difference between group 0 and group 1. That is, it computes:

    Pr(Y=1|group 1) - Pr(Y=1|group 0).


EXAMPLE

use group_ten01, clear
gdset2, gvar(male) g0var(f0) g1var(m1) ///
    g0label(women) g1label(men) details
gdgen2 year art prestige, details
gdxis2 year art prestige, details label(TEST)

logit tenure $rhsg0 $rhsg1, nocon nolog
* at grand means
gdprdif2, matrix(tenure) rownm(M3intGrand)
* at group means
gdprdif2, matrix(tenure) rownm(M3intGroup) group
* at art=10 year=7 prestige=3
local cis "art=10 year=7 prestige=3"
gdprdif2, cis(`cis') matrix(tenure) rownm(M3_10_7_3) debug

HISTORY

2008-01-26

exit