The HPLOGISTIC Procedure

MODEL Statement

MODEL response <(response-options)> = <effects> </ model-options> ;

MODEL events / trials <(response-options)> = <effects> </ model-options> ;

The MODEL statement defines the statistical model in terms of a response variable (the target) or an events/trials specification, model effects constructed from variables in the input data set, and options. An intercept is included in the model by default. You can remove the intercept with the NOINT option.

You can specify a single response variable that contains your binary, ordinal, or nominal response values. When you have binomial data, you can specify the events/trials form of the response, where one variable contains the number of positive responses (or events) and another variable contains the number of trials. Note that the values of both events and (trialsevents) must be nonnegative and the value of trials must be positive.

For information about constructing the model effects, see the section Specification and Parameterization of Model Effects of Chapter 3: Shared Statistical Concepts.

There are two sets of options in the MODEL statement. The response-options determine how the HPLOGISTIC procedure models probabilities for binary data. The model-options control other aspects of model formation and inference. Table 5.3 summarizes these options.

Table 5.3: MODEL Statement Options

Option

Description

Response Variable Options

DESCENDING

Reverses the response categories

EVENT=

Specifies the event category

ORDER=

Specifies the sort order

REF=

Specifies the reference category

Model Options

ALPHA=

Specifies the confidence level for confidence limits

ASSOCIATION

Requests association statistics

CL

Requests confidence limits

DDFM=

Specifies the degrees-of-freedom method

INCLUDE=

Includes effects in all models for model selection

LACKFIT

Requests the Hosmer and Lemeshow goodness-of-fit test

LINK=

Specifies the link function

NOCHECK

Suppresses checking for infinite parameters

NOINT

Suppresses the intercept

OFFSET=

Specifies the offset variable

RSQUARE

Requests a generalized coefficient of determination

START=

Includes effects in the initial model for model selection


Response Variable Options

Response variable options determine how the HPLOGISTIC procedure models probabilities for binary and multinomial data.

You can specify the following response-options by enclosing them in parentheses after the response or trials variable.

DESCENDING
DESC

reverses the order of the response categories. If both the DESCENDING and ORDER= options are specified, PROC HPLOGISTIC orders the response categories according to the ORDER= option and then reverses that order.

EVENT=’category’ | FIRST | LAST

specifies the event category for the binary response model. PROC HPLOGISTIC models the probability of the event category. The EVENT= option has no effect when there are more than two response categories.

You can specify the value (formatted, if a format is applied) of the event category in quotes, or you can specify one of the following:

FIRST

designates the first ordered category as the event. This is the default.

LAST

designates the last ordered category as the event.

For example, the following statements specify that observations with formatted value '1' represent events in the data. The probability modeled by the HPLOGISTIC procedure is thus the probability that the variable def takes on the (formatted) value '1'.

proc hplogistic data=MyData;
   class A B C;
   model def(event ='1') = A B C x1 x2 x3;
run;
ORDER=DATA | FORMATTED | INTERNAL
ORDER=FREQ | FREQDATA | FREQFORMATTED | FREQINTERNAL

specifies the sort order for the levels of the response variable. When ORDER=FORMATTED (the default) for numeric variables for which you have supplied no explicit format (that is, for which there is no corresponding FORMAT statement in the current PROC HPLOGISTIC run or in the DATA step that created the data set), the levels are ordered by their internal (numeric) value. The following table shows the interpretation of the ORDER= option:

ORDER=

Levels Sorted By

DATA

Order of appearance in the input data set

FORMATTED

External formatted value, except for numeric variables with no explicit format, which are sorted by their unformatted (internal) value

FREQ

Descending frequency count (levels with the most observations come first in the order)

FREQDATA

Order of descending frequency count; within counts by order of appearance in the input data set when counts are tied

FREQFORMATTED

Order of descending frequency count; within counts by formatted value (as above) when counts are tied

FREQINTERNAL

Order of descending frequency count; within counts by unformatted value when counts are tied

INTERNAL

Unformatted value

By default, ORDER=FORMATTED. For the FORMATTED and INTERNAL orders, the sort order is machine-dependent.

For more information about sort order, see the chapter on the SORT procedure in the Base SAS Procedures Guide and the discussion of BY-group processing in SAS Language Reference: Concepts.

REF=’category’ | FIRST | LAST

specifies the reference category for the generalized logit model and the binary response model. For the generalized logit model, each logit contrasts a nonreference category with the reference category. For the binary response model, specifying one response category as the reference is the same as specifying the other response category as the event category. You can specify the value (formatted if a format is applied) of the reference category in quotes, or you can specify one of the following:

FIRST

designates the first ordered category as the reference

LAST

designates the last ordered category as the reference. This is the default.

Model Options

ALPHA=number

requests that confidence intervals for each of the parameters be constructed with confidence level 1–number. The value of number must be between 0 and 1; the default is 0.05.

ASSOCIATION

displays measures of association between predicted probabilities and observed responses. These measures assess the predictive ability of a model.

Of the $n$ pairs of observations in the data set with different responses, let $n_ c$ be the number of pairs where the observation that has the lower ordered response value has a lower predicted probability, let $n_ d$ be the number of pairs where the observation that has the lower ordered response value has a higher predicted probability, and let $n_ t=n-n_ c-n_ d$ be the rest. Let N be the sum of observation frequencies in the data. Then the following statistics are reported:

\[  \begin{array}{lcl} \mbox{concordance index \textit{C} (AUC)} & =& (n_ c+0.5n_ t)/n \\ \mbox{Somers \textit{D} (Gini coefficient) } & =& (n_ c-n_ d)/n \\ \mbox{Goodman-Kruskal gamma } & =& (n_ c-n_ d)/(n_ c+n_ d) \\ \mbox{Kendalls tau-\textit{a} } & =& (n_ c-n_ d)/(0.5N(N-1)) \end{array}  \]

Classification of the pairs is carried out by initially binning the predicted probabilities as discussed in the section The Hosmer-Lemeshow Goodness-of-Fit Test. The concordance index, C, is an estimate of the AUC, which is the area under the receiver operating characteristic (ROC) curve.

CL

requests that confidence limits be constructed for each of the parameter estimates. The confidence level is 0.95 by default; this can be changed with the ALPHA= option.

DDFM=RESIDUAL | NONE

specifies how degrees of freedom for statistical inference be determined in the Parameter Estimates Table.

The HPLOGISTIC procedure always displays the statistical tests and confidence intervals in the Parameter Estimates tables in terms of a $t$ test and a two-sided probability from a $t$ distribution. With the DDFM= option, you can control the degrees of freedom of this $t$ distribution and thereby switch between small-sample inference and large-sample inference based on the normal or chi-square distribution.

The default is DDFM=NONE, which leads to $z$-based statistical tests and confidence intervals. The HPLOGISTIC procedure then displays the degrees of freedom in the DF column as Infty, the p-values are identical to those from a Wald chi-square test, and the square of the $t$ value equals the Wald chi-square statistic.

If you specify DDFM=RESIDUAL, the degrees of freedom are finite and determined by the number of usable frequencies (observations) minus the number of nonredundant model parameters. This leads to $t$-based statistical tests and confidence intervals. If the number of frequencies is large relative to the number of parameters, the inferences from the two degrees-of-freedom methods are almost identical.

INCLUDE=n
INCLUDE=single-effect
INCLUDE=(effects)

forces effects to be included in all models. If you specify INCLUDE=n, then the first n effects that are listed in the MODEL statement are included in all models. If you specify INCLUDE=single-effect or if you specify a list of effects within parentheses, then the specified effects are forced into all models. The effects that you specify in the INCLUDE= option must be explanatory effects that are specified in the MODEL statement before the slash (/).

LACKFIT<(DFREDUCE=r NGROUPS=G)>

performs the Hosmer and Lemeshow goodness-of-fit test (Hosmer and Lemeshow, 2000) for binary response models.

The subjects are divided into at most G groups of roughly the same size, based on the percentiles of the estimated probabilities. You can specify G as any integer greater than or equal to 5; by default, G=10. Let the actual number of groups created be g. The discrepancies between the observed and expected number of observations in these g groups are summarized by the Pearson chi-square statistic, which is then compared to a chi-square distribution with gr degrees of freedom. You can specify a nonnegative integer r that satisfies gr $\ge $ 1; by default, r=2.

A small p-value suggests that the fitted model is not an adequate model. See the section The Hosmer-Lemeshow Goodness-of-Fit Test for more information.

LINK=keyword

specifies the link function for the model. The keywords and the associated link functions are shown in Table 5.4.

Table 5.4: Built-in Link Functions of the HPLOGISTIC Procedure


For the probit and cumulative probit links, $\Phi ^{-1}(\cdot )$ denotes the quantile function of the standard normal distribution.

If the response variable has more than two categories, the HPLOGISTIC procedure fits a model with a cumulative link function based on the specified link. However, if you specify LINK=GLOGIT, the procedure assumes a generalized logit model for nominal (unordered) data, regardless of the number of response categories.

NOCHECK

disables the checking process that determines whether maximum likelihood estimates of the regression parameters exist. For more information, see the section Existence of Maximum Likelihood Estimates.

NOINT

requests that no intercept be included in the model. An intercept is included by default. The NOINT option is not available in multinomial models.

OFFSET=variable

specifies a variable to be used as an offset to the linear predictor. An offset plays the role of an effect whose coefficient is known to be 1. The offset variable cannot appear in the CLASS statement or elsewhere in the MODEL statement. Observations with missing values for the offset variable are excluded from the analysis.

RSQUARE
R2

requests a generalized coefficient of determination (R square, $R^2$) and a scaled version thereof for the fitted model. The results are added to the Fit Statistics table. For more information about the computation of these measures, see the section Generalized Coefficient of Determination.

START=n
START=single-effect
START=(effects)

begins the selection process from the designated initial model for the FORWARD and STEPWISE selection methods. If you specify START=n, then the starting model includes the first n effects that are listed in the MODEL statement. If you specify START=single-effect or if you specify a list of effects within parentheses, then the starting model includes those specified effects. The effects that you specify in the START= option must be explanatory effects that are specified in the MODEL statement before the slash (/). The START= option is not available when you specify METHOD=BACKWARD in the SELECTION statement.