The MODEL statement defines the statistical model in terms of a response or target, model effects that are constructed from variables in the input data table, and model-options. An intercept is included in the model by default. You can remove the intercept by specifying the NOINT option.
Three forms of the response can be specified. For the first form, single-trial syntax, you can specify a single response variable that contains your response values. Single-trial syntax is used when each observation in the DATA= data table contains information about only a single trial, such as a single subject in an experiment, and is applicable to binary, ordinal, and nominal response data.
The second form, events/trials syntax, is applicable to binomial response data, 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 (trials – events) must be nonnegative and the value of trials must be positive.
The third form, multinomial-trial syntax, is used when each observation contains information about multiple trials, and you have one variable (response-level1) that contains the number of responses in the first level, another variable (response-level2) that contains the number of responses in the second level, and so on. The last level in the response-level list is the reference level. Multinomial-trial syntax is applicable to binomial, ordinal, and nominal response data. Note that the values of the response-level1 through response-levelJ variables must be nonnegative.
There are two sets of options in the MODEL statement. The response-options determine how the LOGSELECT procedure models probabilities for binary and multinomial data when you use single-trial syntax. The model-options control other aspects of model formation and inference. Table 7 summarizes these options.
Response variable options determine how the LOGSELECT procedure models probabilities for binary and multinomial response data when you specify single-trial syntax. You can specify the following response-options by enclosing them in parentheses after the response or trials variable. These options are not available with multinomial-trial syntax.
DESCENDING
DESC
reverses the order of the response categories.
If you specify both the DESCENDING and ORDER= options, PROC LOGSELECT 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 LOGSELECT models the probability of the event category. The EVENT= option has no effect when there are more than two response categories.
You can specify one of the following:
'category'
specifies the value (formatted, if a format is applied) of the event category in quotation marks.
FIRST
designates the first ordered category as the event.
LAST
designates the last ordered category as the event.
By default, EVENT=FIRST.
For example, the following statements specify that observations with the formatted value '1' represent events in the data. The probability that the LOGSELECT procedure models is thus the probability that the variable def takes on the (formatted) value '1'.
proc logselectdata=mylib.MyData;class A B C;
model def(event ='1')= A B C x1 x2 x3;run;
specifies the sort order for the levels of the response variable. When ORDER=FORMATTED 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 LOGSELECT run or in the DATA step that created the data table), the levels are ordered by their internal (numeric) value. The following table shows how to interpret the ORDER= keywords:
ORDER=
Levels Sorted By
FORMATTED
External formatted value, except for numeric variables with no explicit format, which are sorted by their unformatted (internal) value; the sort order is machine-dependent.
FREQ
Descending frequency count (levels with the most observations come first in the order)
INTERNAL
Unformatted value; the sort order is machine-dependent.
By default, ORDER=FORMATTED.
You can also specify a particular order for the response variable by listing the levels in quotes in the desired order. For example:
model pet(order ='dog''cat')=...;
Any level of the pet variable that you do not specify is added to the end of the list in formatted order.
The ORDER= option does not apply to missing values, which are always ordered first.
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. You can specify one of the following:
'category'
specifies the value (formatted, if a format is applied) of the reference category in quotation marks.
FIRST
designates the first ordered category as the reference.
LAST
designates the last ordered category as the reference.
By default, REF=LAST.
Model Options
CENTER
requests that continuous main effects be centered and scaled internally. (Continuous main effects are centered and scaled to aid in computing maximum likelihood estimates.) Parameter estimates and related statistics are always reported on the original scale. This option has no effect if you specify the LASSO model selection method or the elastic net selection method; instead, you should specify the CENTERLASSO option.
CENTERLASSO<=TRUE | FALSE>
specifies whether all effects, including categorical effects, are centered and scaled internally for the LASSO model selection method or the elastic net selection method. (Effects are centered and scaled to aid in model selection by the LASSO method and the elastic net method.) Parameter estimates and related statistics are always reported on the original scale. By default, CENTERLASSO=TRUE.
CLB
displays Wald confidence limits for each of the parameter estimates. The confidence level is 0.95 by default; you can change it by specifying the ALPHA= option. The CLB option is not available when you use either LASSO selection or elastic net selection.
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 INCLUDE=(effect-list), then the specified effects are forced into all models. The effects that you specify in this option must be explanatory effects that are specified in the MODEL statement before the slash (/). This option is not available if you use elastic net selection.
INFORMATIVE
models missing values by using extra model effects. These effects consist of dummy variables that take the value 1 when the value of a continuous model variable involved in the effect is missing, and take the value 0 otherwise. The missing value in the original model effect is replaced by the average value of the effect for the nonmissing values. For continuous-by-class effects, such as A*x, where A is a classification variable and x is a continuous variable, informative missingness creates multiple dummy columns and substitutes the effect mean of x that corresponds to the respective level of A. Missing values for classification variables are treated as valid levels. For more information about informative missingness, see the section Informative Missingness in Chapter 2, Shared Concepts.
LINK=keyword
specifies the link function for the model. The default link is the logit. The keywords and the associated link functions are shown in Table 8.
Table 8: Built-In Link Functions of the LOGSELECT Procedure
Keyword
Link Function
CLOGLOG | CLL
Complementary log-log
GLOGIT
Generalized logit
LOGIT
Logit
LOGLOG
Log-log
PROBIT
Probit
For the probit and cumulative probit links, denotes the quantile function of the standard normal distribution.
If the response variable has more than two categories, the LOGSELECT procedure fits a model that has a cumulative link function that is based on the specified link. However, if you specify LINK=GLOGIT, the procedure assumes a generalized logit model for nominal (unordered) data.
NOINT
requests that no intercept be included in the model. An intercept is included by default. The NOINT option is not available for 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 that have missing values for the offset variable are excluded from the analysis.
PRIOR=number | number-list
specifies prior probabilities (prevalences) that are used for computing posterior predicted probabilities. When you know what percentage of the population has a rare event and you oversample that rare event, specifying the prior probabilities as the prevalence of events in your population enables you to produce posterior probabilities that reflect the population, not the data. The priors do not affect the model-fitting process.
If you specify a number-list that has the same number of entries as there are response levels, then these values are scaled to sum to 1. If you specify a number-list that has one entry less than there are response levels, then the specified values should sum to less than 1, and the last response level is assigned the remaining value. For binary and binomial response models, you can thus specify the probability of an event as a single number. The scaled priors are displayed in the ResponseProfile table.
If your response Y takes values that have observed empirical training probabilities , you specify priors , and your model predicted probabilities are , then the posterior predicted probabilities are computed as
The POST= option in the OUTPUT statement writes the posterior to the output data table. If your priors are identical to the empirical probabilities, then the posteriors are identical to the model-predicted probabilities.
The priors adjust the "Classification" table statistics PPV, NPV, adequacy, percentage correct, misclassification rate, and lift as discussed in the section Classification Table and ROC Curves. If you specify a PARTITION statement, then the posterior probabilities and the preceding statistics for the validation and test data also use the specified priors.
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 START=(effects), 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 (/). This option is not available when you specify METHOD=BACKWARD in the SELECTION statement or when you specify METHOD=ELASTICNET in the SELECTION statement.
TYPE3
computes Wald statistics for Type 3 contrasts for each effect that is specified in the MODEL statement. This option is not available when you specify a REPEATED statement. For more information, see the section Joint Tests and Type 3 Tests.