LOGSELECT Procedure

REPEATED Statement

  • REPEATED SUBJECT=<subject-effect> / <repeated-options>;

The REPEATED statement performs a repeated measures analysis by using generalized estimating equations (GEEs). GEE analysis is available for binomial and binary response models. GEE analysis is not supported when you perform model selection or when you perform a partitioned analysis.

The repeated-options specify the working correlation structure, output options, and controls for the iterative fitting algorithm.

Table 11 summarizes the repeated-options in the REPEATED statement by function.

Table 11: REPEATED Statement Options

Option Description
Basic Options
SUBJECT= Identifies subjects in the input data
TYPE= Specifies the working correlation type
WITHIN= Specifies a within-subject effect
Options Related to Output
CORRB Produces both the model-based and empirical estimated regression parameter correlation matrices
CORRW Produces the working correlation matrix
COVB Produces both the model-based and empirical estimated regression parameter covariance matrices
ECORRB Produces the estimated regression parameter empirical correlation matrix
ECOVB Produces the estimated regression parameter empirical covariance matrix
MCORRB Produces the estimated regression parameter model-based correlation matrix
MCOVB Produces the estimated regression parameter model-based covariance matrix
MODELSE Produces a parameter estimates table that displays and uses the model-based standard errors
PRINTMLE Produces a parameter estimates table that displays the maximum likelihood estimates


Basic Options

SUBJECT=subject-effect

identifies subjects in the input data set. A subject-effect is required; it can contain a single variable, an interaction effect, a nested effect, or a combination of these. Each variable that the subject-effect contains must be listed in the CLASS statement. Each distinct level of the effect identifies a different subject. Responses from different subjects are assumed to be independent, but responses within subjects are assumed to be correlated.

You can specify the following options after a slash (/):

TYPE=<type>

specifies the working correlation type that is used in the repeated measures analysis. The working correlation structure describes the way that a subject’s repeated measures are assumed to correlate with each other.

You can specify one of the following working correlation types:

AR | AR(1)

specifies the autoregressive-1 working correlation.

CS | EXCH

specifies the exchangeable working correlation.

IND

specifies the independence working correlation.

MDEP(m) | TOEP(m)

specifies the m-dependent working correlation. By default, m = 1.

UN | UNSTR | UNSTRUCTURED

specifies the unstructured working correlation.

By default, TYPE=IND.

WITHIN=within-effect
WITHINSUBJECT=within-effect

specifies a within-subject effect for the repeated measures model. This effect must be composed of CLASS variables. The purpose of the within-subject effect is to define an order for the repeated measures that correspond to each subject. This definition can be critical for reproducibility when you use an order-sensitive correlation structure.

If you do not specify a within-subject effect, the order of the repeated measures is determined by the order in which they are read. This order can vary, depending on your computing resources. Therefore, a within-subject effect is required when you specify the autoregressive, m-dependent, or unstructured working correlation type. When you use one of these working correlation types, the levels of the within-subject effect must be unique within each subject.

If you use multiple variables to define the within-subject effect, the specification of the variables within this effect will have an impact on the analysis if the working correlation type depends on the ordering of the repeated measures. The autoregressive, m-dependent, and unstructured working correlation types use the levelization of the within-subject effect to locate observations within the correlation matrix, and depend on the order that is produced by the levelization.

In particular, if you define the within-subject effect by using the interaction of two or more variables, then the hierarchy of levelization and the resulting ordering of the repeated measures will depend on the order in which you list the variables in the CLASS statement.

For example, assume that you are using the interaction of the variables w1 and w2 as the within-subject effect in a repeated measures analysis. Furthermore, assume that w1 takes the values 'A' and 'B' and w2 takes the values 'L' and 'H'. The following statements list these variables in the order w2, w1 in the CLASS statement:

proc logselect data=mylib.health;
   class subject w2 w1;
   model outcome(event='1') = x1 x2;
   repeated subject=subject / type=mdep(2) within=w1*w2;
run;

In this case, the order of the variables in the CLASS statement results in a levelization in which the value of w1 changes faster than the value of w2. Table 12 shows this levelization.

Table 12: Levelization Order When Variable Order Is w2, w1

Value of w1 Value of w2 Levelization Order
A L 0
B L 1
A H 2
B H 3


If you reverse the order of the variables in the CLASS statement, the levelization has a different hierarchy. In this hierarchy, the value of w2 changes faster than the value of w1. Table 13 shows that the levelization order that is assigned to each unique combination of the variables does not match the levelization order shown in Table 12.

Table 13: Levelization Order When Variable Order Is w1, w2

Value of w1 Value of w2 Levelization Order
A L 0
B L 2
A H 1
B H 3


Because the specified working correlation structure (m-dependent) relies on this ordering, the parameter estimates differ from those that are produced by the ordering shown in Table 12. The autoregressive and unstructured working correlation structures also result in different parameter estimates for the different orderings.

If you use two variables to define the within-subject effect, you can use a nested effect to enforce a specific levelization hierarchy. However, the best practice is to use a single variable in the within-subject effect.

Options Related to Output

CORRB

produces both the model-based and empirical estimated regression parameter correlation matrices.

CORRW

produces the estimated working correlation matrix. This matrix shows the estimated correlation between pairs of repeated measurements.

COVB

produces both the model-based and empirical estimated regression parameter covariance matrices.

ECORRB

produces the empirical estimated regression parameter correlation matrix.

ECOVB

produces the empirical estimated regression parameter covariance matrix.

MCORRB

produces the model-based estimated regression parameter correlation matrix.

MCOVB

produces the model-based estimated regression parameter covariance matrix.

MODELSE

produces a table that displays the parameter estimates from the repeated measures analysis, but using the model-based standard error estimates. By default, only a table that uses the empirical standard error estimates is shown.

PRINTMLE

produces a table that displays the parameter estimates and standard errors from maximum likelihood estimation, assuming no within-subject correlation. This table corresponds to the "Parameter Estimates" table that the procedure produces when you do not request a repeated measures analysis.

Last updated: June 22, 2026