The GLIMMIX Procedure

OUTPUT Statement

  • OUTPUT <OUT=SAS-data-set><keyword<(keyword-options)> <=name>> …<keyword<(keyword-options)> <=name>> </ options>;

The OUTPUT statement creates a data set that contains predicted values and residual diagnostics, computed after fitting the model. By default, all variables in the original data set are included in the output data set.

You can use the ID statement to select a subset of the variables from the input data set as well as computed variables for adding to the output data set. If you reassign a data set variable through programming statements, the value of the variable from the input data set supersedes the recomputed value when observations are written to the output data set. If you list the variable in the ID statement, however, PROC GLIMMIX saves the current value of the variable after the programming statements have been executed.

For example, suppose that data set Scores contains the variables score, machine, and person. The following statements fit a model with fixed machine and random person effects. The variable score divided by 100 is assumed to follow an inverse Gaussian distribution. The (conditional) mean and residuals are saved to the data set igausout. Because no ID statement is given, the variable score in the output data set contains the values from the input data set.

proc glimmix;
   class machine person;
   score = score/100;
   p = 4*_linp_;
   model score = machine  / dist=invgauss;
   random int / sub=person;
   output out=igausout pred=p resid=r;
run;

On the contrary, the following statements list explicitly which variables to save to the OUTPUT data set. Because the variable score is listed in the ID statement, and is (re-)assigned through programming statements, the values of score saved to the OUTPUT data set are the input values divided by 100.

proc glimmix;
   class machine person;
   score = score / 100;
   model score = machine  / dist=invgauss;
   random int / sub=person;
   output out=igausout pred=p resid=r;
   id machine score _xbeta_ _zgamma_;
run;

You can specify the following syntax elements in the OUTPUT statement before the slash (/).

OUT=SAS-data-set

specifies the name of the output data set. If the OUT= option is omitted, the procedure uses the DATAn convention to name the output data set.

keyword<(keyword-options)> <=name>

specifies a statistic to include in the output data set and optionally assigns the variable the name name. You can use the keyword-options to control which type of a particular statistic to compute. The keyword-options can take on the following values:

BLUP

uses the predictors of the random effects in computing the statistic.

ILINK

computes the statistic on the scale of the data.

NOBLUP

does not use the predictors of the random effects in computing the statistic.

NOILINK

computes the statistic on the scale of the link function.

The default is to compute statistics by using BLUPs on the scale of the link function (the linearized scale). For example, the following OUTPUT statements are equivalent:

output out=out1  pred=predicted lcl=lower;
output out=out1  pred(blup noilink)=predicted
                 lcl (blup noilink)=lower;

If a particular combination of keyword and keyword options is not supported, the statistic is not computed and a message is produced in the SAS log.

A keyword can appear multiple times in the OUTPUT statement. Table 17 lists the keywords and the default names assigned by the GLIMMIX procedure if you do not specify a name. In this table, y denotes the observed response, and p denotes the linearized pseudo-data. See the section Pseudo-likelihood Estimation Based on Linearization for details on notation and the section Notes on Output Statistics for further details regarding the output statistics.

Table 17: Keywords for Output Statistics

Keyword Options Description Expression Name
PREDICTED Default Linear predictor ModifyingAbove eta With caret equals bold x prime ModifyingAbove bold-italic beta With caret plus bold z prime ModifyingAbove bold-italic gamma With caret Pred
NOBLUP Marginal linear predictor ModifyingAbove eta With caret Subscript m Baseline equals bold x prime ModifyingAbove bold-italic beta With caret PredPA
ILINK Predicted mean g Superscript negative 1 Baseline left-parenthesis ModifyingAbove eta With caret right-parenthesis PredMu
NOBLUP ILINK Marginal mean g Superscript negative 1 Baseline left-parenthesis ModifyingAbove eta With caret Subscript m Baseline right-parenthesis PredMuPA
STDERR Default Standard deviation of linear predictor StartRoot normal upper V normal a normal r left-bracket ModifyingAbove eta With caret minus bold z prime bold-italic gamma right-bracket EndRoot StdErr
NOBLUP Standard deviation of marginal linear predictor StartRoot normal upper V normal a normal r left-bracket ModifyingAbove eta With caret Subscript m Baseline right-bracket EndRoot StdErrPA
ILINK Standard deviation of mean StartRoot normal upper V normal a normal r left-bracket g Superscript negative 1 Baseline left-parenthesis ModifyingAbove eta With caret minus bold z prime bold-italic gamma right-parenthesis right-bracket EndRoot StdErr
NOBLUP ILINK Standard deviation of marginal mean StartRoot normal upper V normal a normal r left-bracket g Superscript negative 1 Baseline left-parenthesis ModifyingAbove eta With caret Subscript m Baseline right-parenthesis right-bracket EndRoot StdErrMuPA
RESIDUAL Default Residual r equals p minus ModifyingAbove eta With caret Resid
NOBLUP Marginal residual r Subscript m Baseline equals p Subscript m Baseline minus ModifyingAbove eta With caret Subscript m ResidPA
ILINK Residual on mean scale r Subscript y Baseline equals y minus g Superscript negative 1 Baseline left-parenthesis ModifyingAbove eta With caret right-parenthesis ResidMu
NOBLUP ILINK Marginal residual on mean scale r Subscript y m Baseline equals y minus g Superscript negative 1 Baseline left-parenthesis ModifyingAbove eta With caret Subscript m Baseline right-parenthesis ResidMuPA
PEARSON Default Pearson-type residual r slash StartRoot ModifyingAbove normal upper V normal a normal r With caret left-bracket p vertical-bar bold-italic gamma right-bracket EndRoot Pearson
NOBLUP Marginal Pearson-type residual r Subscript m Baseline slash StartRoot ModifyingAbove normal upper V normal a normal r With caret left-bracket p Subscript m Baseline right-bracket EndRoot PearsonPA
ILINK Conditional Pearson-type mean residual r Subscript y Baseline slash StartRoot ModifyingAbove normal upper V normal a normal r With caret left-bracket upper Y vertical-bar bold-italic gamma right-bracket EndRoot PearsonMu
STUDENT Default Studentized residual r slash StartRoot ModifyingAbove normal upper V normal a normal r With caret left-bracket r right-bracket EndRoot Student
NOBLUP Studentized marginal residual r Subscript m Baseline slash StartRoot ModifyingAbove normal upper V normal a normal r With caret left-bracket r Subscript m Baseline right-bracket EndRoot StudentPA
LCL Default Lower prediction limit for linear predictor LCL
NOBLUP Lower confidence limit for marginal linear predictor LCLPA
ILINK Lower prediction limit for mean LCLMu
NOBLUP ILINK Lower confidence limit for marginal mean LCLMuPA
UCL Default Upper prediction limit for linear predictor UCL
NOBLUP Upper confidence limit for marginal linear predictor UCLPA
ILINK Upper prediction limit for mean UCLMu
NOBLUP ILINK Upper confidence limit for marginal mean UCLMuPA
VARIANCE Default Conditional variance of pseudo-data ModifyingAbove normal upper V normal a normal r With caret left-bracket p vertical-bar bold-italic gamma right-bracket Variance
NOBLUP Marginal variance of pseudo-data ModifyingAbove normal upper V normal a normal r With caret left-bracket p Subscript m Baseline right-bracket VariancePA
ILINK Conditional variance of response ModifyingAbove normal upper V normal a normal r With caret left-bracket upper Y vertical-bar bold-italic gamma right-bracket Variance_Dep
NOBLUP ILINK Marginal variance of response ModifyingAbove normal upper V normal a normal r With caret left-bracket upper Y right-bracket Variance_DepPA


Studentized residuals are computed only on the linear scale (scale of the link), unless the link is the identity, in which case the two scales are equal. The keywords RESIDUAL, PEARSON, STUDENT, and VARIANCE are not available with the multinomial distribution. You can use the following shortcuts to request statistics: PRED for PREDICTED, STD for STDERR, RESID for RESIDUAL, and VAR for VARIANCE. Output statistics that depend on the marginal variance normal upper V normal a normal r left-bracket upper Y Subscript i Baseline right-bracket are not available with METHOD=LAPLACE or METHOD=QUAD.

Table 18 summarizes the options available in the OUTPUT statement.

Table 18: OUTPUT Statement Options

Option Description
ALLSTATS Computes all statistics
ALPHA=alpha Determines the confidence level (1 minus alpha)
CPSEUDO Changes the way in which marginal residuals are computed
DERIVATIVES Adds derivatives of model quantities to the output data set
NOMISS Outputs only observations used in the analysis
NOUNIQUE Requests that names not be made unique
NOVAR Requests that variables from the input data set not be added to the output data set
OBSCAT Writes statistics to output data set only for the response level corresponding to the observed level of the observation
SYMBOLS Adds computed variables to the output data set


You can specify the following options in the OUTPUT statement after a slash (/).

ALLSTATS

requests that all statistics are computed. If you do not use a keyword to assign a name, the GLIMMIX procedure uses the default name.

ALPHA=number

determines the coverage probability for two-sided confidence and prediction intervals. The coverage probability is computed as 1 – number. The value of number must be between 0 and 1; the default is 0.05.

CPSEUDO

changes the way in which marginal residuals are computed when model parameters are estimated by pseudo-likelihood methods. See the section Notes on Output Statistics for details.

DERIVATIVES
DER

adds derivatives of model quantities to the output data set. If, for example, the model fit requires the (conditional) log likelihood of the data, then the DERIVATIVES option writes for each observation the evaluations of the first and second derivatives of the log likelihood with respect to _LINP_ and _PHI_ to the output data set. The particular derivatives produced by the GLIMMIX procedure depend on the type of model and the estimation method.

NOMISS

requests that records be written to the output data only for those observations that were used in the analysis. By default, the GLIMMIX procedure produces output statistics for all observations in the input data set.

NOUNIQUE

requests that names not be made unique in the case of naming conflicts. By default, the GLIMMIX procedure avoids naming conflicts by assigning a unique name to each output variable. If you specify the NOUNIQUE option, variables with conflicting names are not renamed. In that case, the first variable added to the output data set takes precedence.

NOVAR

requests that variables from the input data set not be added to the output data set. This option does not apply to variables listed in the BY statement or to computed variables listed in the ID statement.

OBSCAT

requests that in models for multinomial data statistics be written to the output data set only for the response level that corresponds to the observed level of the observation.

SYMBOLS
SYM

adds to the output data set computed variables that are defined or referenced in the program.

Last updated: December 09, 2022