LOGSELECT Procedure

PROC LOGSELECT Statement

  • PROC LOGSELECT <options>;

The PROC LOGSELECT statement invokes the procedure. Table 1 summarizes the available options in the PROC LOGSELECT statement by function.

Table 1: PROC LOGSELECT Statement Options

Option Description
ALPHA= Specifies a global significance level
APPLYROWORDER Uses group and order information from the input data table
BINEPS= Specifies the precision for computing association and classification statistics
DATA= Specifies the input data table
FITDATA Declares the DATA= table to be the same input data table used to build the model
MAXRESPONSELEVELS= Specifies the maximum number of response levels allowed when you have a polytomous response variable
MULTIPASS= Specifies whether to levelize the data table every time it is read
PAGEOBS= Specifies the maximum number of observations to be computed in each batch
RESTORE= Specifies the input analytic store
SEED= Specifies the random number seed for LS-means and partition fractions
Output Options
ASSOCIATION Produces association statistics
CLB Constructs confidence limits for the parameter estimates
CORRB Displays the "Parameter Estimates Correlation Matrix" table
COVB Displays the "Parameter Estimates Covariance Matrix" table
CTABLE Produces classification (ROC) statistics
ITHIST Displays the "Iteration History" table
LACKFIT Produces the Hosmer-Lemeshow goodness-of-fit test
NOCHECK Disables checking for infinite parameters
NOCLPRINT Limits or suppresses the display of class levels
NOSTDERR Suppresses computation of the covariance matrix and standard errors
NOXPX Suppresses computation of the Hessian matrices
PARTFIT Displays the fit statistics that are produced when your data are partitioned
PLCONV= Controls the convergence criterion for profile-likelihood confidence limits
PLMAXITER= Specifies the maximum number of iterations for profile-likelihood confidence limits
PLSINGULAR= Specifies the singularity tolerance for profile-likelihood confidence limits
STB Displays standardized estimates
TYPE3 Produces the Type 3 or joint tests of effects
USELASTITER Continues computations when the optimization fails
Optimization Options
ABSCONV= Tunes the absolute function convergence criterion
ABSFCONV= Tunes the absolute function difference convergence criterion
ABSGCONV= Tunes the absolute gradient convergence criterion
ABSXCONV= Tunes the absolute parameter convergence criterion
FCONV= Tunes the relative function difference convergence criterion
FCONV2= Tunes the second relative function difference convergence criterion
GCONV= Tunes the relative gradient convergence criterion
GCONV2= Tunes the second relative gradient convergence criterion
INPARMEST= Specifies starting values for the optimization
XCONV= Tunes the relative gradient convergence criterion
MAXFUNC= Specifies the maximum number of function evaluations in any optimization
MAXITER= Specifies the maximum number of iterations in any optimization
MAXTIME= Specifies the upper limit of CPU time (in seconds) for any optimization
MINITER= Specifies the minimum number of iterations in any optimization
NORMALIZE= Specifies whether the objective function is normalized during optimization
TECHNIQUE= Selects the optimization technique
LASSO Options
LASSORHO= Specifies the base regularization parameter for the LASSO method
LASSOSTEPS= Specifies the maximum number of steps for the LASSO method
LASSOTOL= Specifies the convergence criterion for the LASSO method


The optimization options are fully described in the section Optimization Options in Chapter 2, Shared Concepts. The following list describes the other options available in the PROC LOGSELECT statement:

ALPHA=number

specifies a global significance level for the construction of confidence intervals. The confidence level is 1–number. The value of number must be between 0 and 1. You can override the global specification by specifying the ALPHA= option in the OUTPUT statement. By default, ALPHA=0.05.

APPLYROWORDER

uses group and order information from the input data table. You can add this information to the input table by using the partition action in the table action set. For more information, see the section The APPLYROWORDER Option in Chapter 2, Shared Concepts. By default, the APPLYROWORDER option is not enabled. If you specify this option but the table does not contain group and order information, the procedure terminates with an error.

Note: You can use group and order information for a repeated measures analysis if the group information meets certain criteria. For more information, see the section Using a Preexisting Table Order.

ASSOCIATION

displays measures of association between predicted probabilities and observed responses for binary, binomial, and ordinal response models. These measures assess the predictive ability of the model. The displayed statistics are the concordance index c (the area under the ROC curve, AUC), Somers’ D statistic (Gini’s coefficient), the Goodman-Kruskal gamma statistic, and Kendall’s tau-a statistic. These statistics are based on the number of pairs of observations that have different response values, the number of concordant pairs, and the number of discordant pairs. For more information, see the section Association Statistics.

BINEPS=number

specifies the precision to use for the association, classification, and LACKFIT option computations. The predicted probabilities or scores are rounded to the nearest multiple of number, which effectively bins and sorts the observations. You can specify a number between 0 and 1; if number does not evenly divide the unit interval, then it is reduced to a valid value. By default, BINEPS=1E–5. For more information, see the section Classification Table and ROC Curves.

CLB<=WALD | PL>

displays Wald confidence limits for each of the parameter estimates. If you specify CLB=PL, then profile-likelihood confidence limits are also displayed. The confidence level is 0.95 by default; you can change it by specifying the ALPHA= option. This option is not available when you use either LASSO selection or elastic net selection.

CORRB

creates the "Parameter Estimates Correlation Matrix" table. The correlation matrix is computed by normalizing the covariance matrix bold upper Sigma. That is, if sigma Subscript i j is an element of bold upper Sigma, then the corresponding element of the correlation matrix is sigma Subscript i j Baseline slash sigma Subscript i Baseline sigma Subscript j, where sigma Subscript i Baseline equals StartRoot sigma Subscript i i Baseline EndRoot. The option is not available when you use either LASSO selection or elastic net selection.

COVB

creates the "Parameter Estimates Covariance Matrix" table. The covariance matrix is computed as the inverse of the negative of the matrix of second derivatives of the log-likelihood function with respect to the model parameters (the Hessian matrix). The option is not available when you use either LASSO selection or elastic net selection.

CTABLE<(options)>

displays a table for binary or binomial response models that, for a set of probabilities or cutpoints, contains the frequencies of observations that are correctly and incorrectly classified as events and nonevents, and optionally the sensitivity, the 1–specificity, the positive and negative predictive values, the correct classification rate, the error rate, and the lift.

Because the number of cutpoints that are generated from your data can be very large, you can write the classification table to an output data table, or you can specify your own list of cutpoints.

If you specify the PRIOR= option, then the reported predicted probabilities are unchanged, but the statistics that are specified by the keywords PPV, NPV, PC, ACCURACY, MISCLASS, and LIFT are modified.

If you specify a PARTITION statement, then a table is created for each role. If you do not specify the PRIOR= option, then the training proportions are used as the prevalences for computing the statistics that are specified by the keywords PPV, NPV, PC, ACCURACY, MISCLASS, and LIFT for the validation and test data.

You can specify the following options. For more information, see the section Classification Table and ROC Curves.

ALL

requests all the statistics that are listed in Table 2.

CUTPT=number-list

specifies cutpoints to include in the classification table.

NOCOUNTS

suppresses the classification table columns that contain the number of true positives, the number of true negatives, the number of false positives, and the number of false negatives.

OUT=libref.data-table

suppresses the display of the classification table and names the output data table in which to store the classification table. libref.data-table is a two-level name, where libref refers to the library, and data-table specifies the name of the output data table. For more information about this two-level name, see the DATA= option and the section Using CAS Sessions and CAS Engine Librefs.

keyword <=name>

specifies statistics to include in the classification table and optionally names the statistics. If you do not provide a name, the LOGSELECT procedure uses the keyword as the name. Table 2 lists the available keywords.

Table 2: CTABLE Option Keywords

Keyword Description
ACCURACY Requests and names the accuracy
FNF Requests and names the false negative fraction
FPF Requests and names the false positive fraction. Also called 1–specificity.
LIFT Requests and names the lift
MISCLASS Requests and names the misclassification rate. Also called the error rate.
NPV Requests and names the negative predictive value
PC Requests and names the proportion classified correctly
PPV Requests and names the positive predictive value. Also called the precision.
TNF Requests and names the true negative fraction. Also called the specificity.
TPF Requests and names the true positive fraction. Also called the sensitivity or recall.


DATA=libref.data-table

names the input data table for PROC LOGSELECT to use. The default is the most recently created data table. libref.data-table is a two-level name, where

libref

refers to a collection of information that is defined in the LIBNAME statement and includes the library, which includes a path to the data, and a session identifier, which defaults to the active session but which can be explicitly defined in the LIBNAME statement. For more information about libref, see the section Using CAS Sessions and CAS Engine Librefs.

data-table

specifies the name of the input data table.

FITDATA

declares the DATA= table to be the same input data table that is used for building the model, when you also specify the RESTORE= option. The FITDATA option enables you to specify the PARTFIT option to produce more fit statistics, to compute all the statistics from the OUTPUT statement that are available for your model, and to group computations according to the partition roles.

INPARMEST=libref.data-table

names an input data table that contains starting values. libref.data-table is a two-level name, where libref refers to the library, and data-table specifies the name of the output data table. For more information about this two-level name, see the DATA= option and the section Using CAS Sessions and CAS Engine Librefs.

The input data table must contain an Estimate column and a ParmName column, and it can optionally contain your BY variables. You can create a version of this table by using a DISPLAYOUT statement to produce the "Parameter Estimates" table from a PROC LOGSELECT program. For example:

displayout parameterestimates=pe;

You can then modify the parameter estimates in this table and copy them back in by using the following statement:

proc logselect inparmest=mylib.pe;
ITHIST

generates the "Iteration History" table.

LACKFIT<(options)>

performs the Hosmer-Lemeshow goodness-of-fit test for binary and polytomous response models (Hosmer and Lemeshow 2000; Fagerland, Hosmer, and Bofin 2008; Fagerland and Hosmer 2013, 2016). The subjects are divided into at most G groups of approximately the same size. You can specify G as any integer greater than or equal to 5; by default, G = 10. The discrepancies between the observed and expected numbers of observations in these groups are summarized by the Pearson chi-square statistic, which is then compared to a chi-square distribution. The number of degrees of freedom that PROC LOGSELECT uses for this test depends on the specified model; you can override this number by specifying a nonnegative integer, df, and by modifying the reduction, r. A small p-value suggests that the fitted model is not an adequate model. For more information, see the section The Hosmer-Lemeshow Goodness-of-Fit Test.

The following options are available:

CUTPT=value-list

specifies a list of cut points for grouping the subjects.

DF=df

specifies the number of degrees of freedom of the test, where df greater-than-or-equal-to 1. By default, df = Gr.

DFREDUCE=r

specifies the reduction in degrees of freedom. This option is ignored when you specify the DF= option. By default, DFREDUCE=2.

NGROUPS=G

specifies the number of groups in which to divide the subjects. You can specify G greater-than-or-equal-to 5. By default, NGROUPS=10.

NONCENTRALITY=value

requests that a noncentral chi-square test be performed, where value is the noncentrality parameter.

POWERADJ

for binary response data, chooses the number of groups G to maintain the same power as grouping 1,000 observations into 10 groups (Paul, Pennell, and Lemeshow 2013). If you have fewer than 1,000 observations, then G = 10 groups are used. If you have 1,000 to 25,000 observations, then the number of groups that are formed is

max left-parenthesis 10 comma min left-parenthesis StartFraction n Subscript e Baseline Over 2 EndFraction comma StartFraction n Subscript n Baseline Over 2 EndFraction comma 2 plus 8 left-parenthesis StartFraction n Over 1000 EndFraction right-parenthesis squared right-parenthesis right-parenthesis

where n equals n Subscript e Baseline plus n Subscript n is the number of observations, n Subscript e is the number of events, and n Subscript n is the number of nonevents. If you have more than 25,000 observations, then this option is ignored.

LASSORHO=r

specifies the base regularization parameter for the LASSO model selection method. The regularization parameter for step i is rSuperscript i. By default, LASSORHO=0.8.

LASSOSTEPS=n

specifies the maximum number of steps for LASSO model selection. By default, LASSOSTEPS=20.

LASSOTOL=r

specifies the convergence tolerance for the optimization algorithm that solves for the LASSO parameter estimates at each step of LASSO model selection. By default, LASSOTOL=1E–6.

MAXRESPONSELEVELS=value

specifies the maximum number of response levels that are allowed when you have a polytomous response variable. By default, MAXRESPONSELEVELS=100.

MULTIPASS=TRUE | FALSE

specifies when to levelize the data—that is, when to generate the design rows for your model from the data. The default, MULTIPASS=FALSE, levelizes the data once and stores them in a temporary data table, then rereads the data from that table as needed; this method is fast but uses more memory. MULTIPASS=TRUE levelizes the data every time they are read; this method is slower but uses less memory. The MULTIPASS= option does not affect how the OUTPUT statement is processed. When MULTIPASS=TRUE, you can also use the PAGEOBS= option to improve performance.

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.

NOCLPRINT<=number>

suppresses the display of the "Class Level Information" table if you do not specify number. If you specify number, the values of the classification variables are displayed for only those variables whose number of levels is less than number. Specifying number helps to reduce the size of the "Class Level Information" table if some classification variables have a large number of levels.

NOSTDERR

suppresses computation of the covariance matrix and the standard errors of the regression coefficients. When the model contains many variables (thousands), the inversion of the Hessian matrix to derive the covariance matrix and the standard errors of the regression coefficients can be time-consuming. The CORRB, COVB, and TYPE3 options, and the OUTPUT statement options for confidence limits, are not available when the NOSTDERR option is specified. This option also disables the quasi-complete separation check; for more information, see the section Existence of Maximum Likelihood Estimates.

NOXPX

suppresses Hessian and computations and invokes the NOSTDERR option. When the model contains many variables (thousands), computing the Hessian matrix during model fitting can be time-consuming. The CLB, CORRB, COVB, and TYPE3 options, the REPEATED statement, the OUTPUT statement options that rely on the covariance, and confidence limits for the parameters and for the ODDSRATIO, OUTPUT, RISK, and LSMEANS statements are not available when you specify the NOXPX option. The forward, backward, and stepwise selection methods are not available; however, you can specify the LASSO and elastic net methods. This option invokes the TECHNIQUE=LBFGS option by default, and the NEWRAP, NRRIDG, and TRUREG optimization techniques are not available. Because the method of identifying linearly dependent variables relies on the matrix, some parameters that should be assigned 0 degrees of freedom can be missed. This option also disables the quasi-complete separation check; for more information, see the section Existence of Maximum Likelihood Estimates.

PAGEOBS=number | AUTO
MAXOPTBATCH=number | AUTO

specifies the maximum number of observations to be included in a batch. During the optimization, the LOGSELECT procedure reads at most number observations from the data table into memory, performs the appropriate log-likelihood, gradient, and Hessian computations on that batch of observations, then discards those observations and reads in the next batch of data for processing. Generally, a smaller number decreases memory usage but might lead to longer computation times, whereas a larger number might lead to shorter computation times but increases memory usage. The default PAGEOBS=AUTO option determines whether the entire data table can be conveniently held in memory; if it cannot, then number is set to 256. The PAGEOBS= option has the most benefit when you also specify the MULTIPASS=TRUE option; however, it can adversely affect performance when the default MULTIPASS=FALSE option is in effect. For more information, see the section Memory Usage.

PARTFIT

displays fit statistics in the "Fit Statistics" table that are usually produced when your data are partitioned. This option is not required when you specify a PARTITION statement.

The additional statistics include the R-square, the adjusted R-square, McFadden’s R-square, the average square error (Brier score), the misclassification rate, the null-model log likelihood, and the difference in means.

PLCONV=value

controls the convergence criterion for computing profile-likelihood confidence intervals. The value is a positive number. By default, PLCONV=1E–4. This option has no effect if you do not request profile-likelihood confidence intervals.

PLMAXITER=number

specifies the maximum number of iterations for profile-likelihood confidence interval searches. By default, PLMAXITER=25. If you do not reach convergence in number iterations, the confidence limit is set to missing. This option has no effect if you do not request profile-likelihood confidence intervals.

PLSINGULAR=value

specifies the tolerance for testing the singularity of the Hessian matrices that are computed during the profile-likelihood confidence interval searches. The test requires that a pivot for sweeping this matrix be at least the value times a norm of the matrix, where value is greater than 0. By default, value is the machine epsilon times 1E7, which is approximately 1E–9. This option has no effect if you do not request profile-likelihood confidence intervals.

RESTORE=libref.data-table

specifies the name of the analytic store that contains the context and results of a model that is selected and stored from a previous statistical analysis. The analytic store is created by a STORE statement from a previous PROC LOGSELECT call or by a store parameter that is specified in a previous logistic action call.

The displayed output can include the following content:

  • information about the analytic store

  • notes that are stored by the TEXT= option of the STORE statement

  • a Replay section, consisting of tables that are produced when the stored model is fit

  • a Restore section, consisting of tables that are produced by applying the stored model to a specified input data table

See Example 18.7 for further discussion of these outputs.

You can specify the STB and CLB options in the PROC LOGSELECT statement to modify the "Parameter Estimates" table; you can specify the CORRB, COVB, and TYPE3 options to display those tables; you can specify the CODE statement to produce SAS code for scoring; you can specify LSMEANS statements to compute least squares means; and you can specify ODDSRATIO statements to compute odds ratios. If you specify a DATA= data table, then you can also specify the ASSOCIATION, CTABLE, LACKFIT, and PARTFIT options, and you can score that data table by specifying the OUTPUT statement.

If the analytic store is created using BY-group processing, then the results are displayed according to each BY group. If you specify a DATA= input data table, then you must also specify the same BY statement that was used to create the store.

If a PARTITION statement is used to create the stored model, then the Replay section displays only information that is computed from the original training data. For the Restore section, if you create the partition for the stored model by using a ROLE variable and also specify the FITDATA option, then the ROLE variable must exist in the DATA= table and the Restore section displays results according to the roles. However, if the partitions for the stored model are created using a FRACTION option, then the roles are ignored because the roles cannot be reliably re-created; this means that output statistics that rely on the input data are not computed.

Because the selected model from a previous analysis is stored, statements and options specific to model specification, selection, and optimization are not available. In particular, the CLASS, EFFECT, FREQ, MODEL, PARTITION, REPEATED, SELECTION, STORE, and WEIGHT statements are not available to be used with the RESTORE= option, and the MULTIPASS= option is always set to TRUE.

libref.data-table is a two-level name, where libref refers to the library, and data-table specifies the name of the input data table. For more information about this two-level name, see the DATA= option and the section Using CAS Sessions and CAS Engine Librefs.

SEED=number

specifies an integer to be used to start the pseudorandom number generator for the LSMEANS statement’s ADJUST=SIMULATE option and for the PARTITION statement’s FRACTION option. If you do not specify a seed, or if you specify a number less than or equal to 0, the seed is generated by reading the time of day from the computer’s clock.

STB

displays the standardized estimates of the parameters in the "Parameter Estimates" table. The standardized estimate of beta Subscript i is given by ModifyingAbove beta With caret Subscript i Baseline slash left-parenthesis s slash s Subscript i Baseline right-parenthesis, where s Subscript i is the total sample standard deviation for the ith explanatory variable and

StartLayout 1st Row  s equals StartLayout Enlarged left-brace 1st Row 1st Column pi slash StartRoot 3 EndRoot 2nd Column LOGIT and GLOGIT links 2nd Row 1st Column 1 2nd Column PROBIT link 3rd Row 1st Column pi slash StartRoot 6 EndRoot 2nd Column CLOGLOG and LOGLOG links EndLayout EndLayout

The sample standard deviations for parameters that are associated with CLASS variables are computed using their codings. The standardized estimates are not computed for the intercept parameters.

TYPE3

computes Wald statistics for Type 3 contrasts for each effect that you specify in the MODEL statement. This option is not available when you specify a REPEATED statement. The option is also not available when you use either LASSO selection or elastic net selection. For more information, see the section Joint Tests and Type 3 Tests.

USELASTITER

continues to perform computations by using the last iteration of the optimization when the optimization fails. By default, computations cease when a failure occurs.

Last updated: June 22, 2026