SUPPORT / SAMPLES & SAS NOTES
 

Support

Sample 26100: QIC goodness of fit statistic for GEE models

DetailsResultsDownloadsAboutRate It

QIC goodness of fit statistic for GEE models

Contents: Purpose / History / Requirements / Usage / Details / Limitations / Missing Values / References

NOTE: Beginning in SAS 9.2, the QIC statistic is produced by PROC GENMOD. Beginning in SAS 9.4 TS1M2, QIC is available in PROC GEE.

PURPOSE:
The %QIC macro computes the QIC and QICu statistics proposed by Pan (2001) for GEE (generalized estimating equations) models. These statistics allow comparisons of GEE models (model selection) and selection of a correlation structure.
HISTORY:
Version
Update Notes
1.2More adjustment of macro termination criteria.
1.1Updated checks for errors that should terminate the macro. Fixed new version check to work in SAS 8.
1.0Initial coding.
REQUIREMENTS:
Base SAS®, SAS/STAT®, and SAS/IML® software in SAS 8.2 or later.
USAGE:
Follow the instructions in the Downloads tab of this sample to save the %QIC macro definition. Replace the text within quotes in the following statement with the location of the %QIC macro definition file on your system. In your SAS program or in the SAS editor window, specify this statement to define the %QIC macro and make it available for use:
   %inc "<location of your file containing the QIC macro>";

Following this statement, you may call the %QIC macro. See the Results tab for an example.

The parameters available with the %QIC macro are described below. Note that if any parameter argument you wish to specify contains commas or semicolons, you should enclose the argument in %str( ).

Required parameters

The following macro parameters are required. These options directly correspond to same-named options or statements in PROC GENMOD. For more details on their use, see the GENMOD documentation:

class=
Specify the SUBJECT= variable, any CLASS variables in the model, and the WITHIN= variable if specified.
response=
Specify the response variable.
dist=normal | binomial | gamma | poisson | igaussian
Specify the response distribution. Only the distributions listed above are supported.
subject=
Specify the variable or effect that defines the subjects or clusters.
type=     or
logor=
Specify the correlation structure or log odds ratio structure. Specify either type= or logor=, but not both.

Optional parameters

The following macro parameters are optional. All available options are described in the GENMOD documentation.

data=
Specify the data set to analyze. If omitted, the last-created data set is analyzed.
Poptions=
Specify any options needed in the PROC GENMOD statement.
model=
Specify the model. That is, list the effects which would normally appear in the MODEL statement after the response and equal sign. If omitted, an intercept-only model is fitted.
Moptions=
Specify any options needed in the MODEL statement other than DIST=.
within=
Specify the WITHIN= variable or effect.
Roptions=
Specify any options needed in the REPEATED statement other than SUBJECT=, TYPE=, or LOGOR=.
out=
Specify the name of the OUTPUT OUT= data set which will contain predicted values. If omitted the data set is named _OUTR.
p=
Specify the name of the variable containing predicted values in the OUTPUT OUT= data set. If omitted, the variable is named _P.
Ooptions=
Specify any additional statistic keyword options in the OUTPUT statement other than P=.
weight=
Specify a weight variable for the WEIGHT statement if desired.
freq=
Specify a frequency variable for the FREQ statement if desired.
stmts=%str( statements )
Specify any CONTRAST, ESTIMATE, FWDLINK, INVLINK, ASSESS, LSMEANS statements desired. The complete statements should appear within %str( ) as shown. BY, DEVIANCE, and VARIANCE statements are not supported.
outqic=
Names a data set containing the QIC and QICu statistics. If omitted, the data set is named _QIC.
appendto=
Specify the name of the data set to which the current model's QIC statistics should be added.
label=
Specify a label for the current model's QIC statistics when appended to the APPENDTO= data set. The label can be up to 40 characters long. If omitted the default label is structure / model, where structure is the value of the TYPE= or LOGOR= option and model is the value of MODEL=.
QICoptions=NOPRINT | INDMODEL
NOPRINT suppresses all displayed results from the macro. INDMODEL requests that the results of fitting the independence model (its covariance matrix is needed to compute QIC) be displayed.

The version of the %QIC macro that you are using is displayed when you specify version (or any string) as the first argument. For example:

    %QIC(version, data=six,
         class=case city,
         response=wheeze, model=city, dist=bin,
         subject=case, type=ind)
DETAILS:
The QIC (Quasilikelihood under the Independence model Criterion) statistic proposed by Pan (2001) and further discussed by Hardin and Hilbe (2003) is analogous to the familiar AIC (Akaike's Information Criterion) statistic used for comparing models fit with likelihood-based methods. Since the generalized estimating equations (GEE) method is not a likelihood-based method, the AIC statistic is not available.

QIC can be used to find an acceptable working correlation structure for a given model. However, Hardin and Hilbe (2003) recommend the use of QIC only to choose among otherwise equally suitable structures. They provide several guidelines based on the nature of the data for selecting suitable structures that should be applied first.

QIC and the related QICu statistic can be used to compare GEE models — that is, for model selection. QICu approximates QIC when the GEE model is correctly specified. QICu, defined as Q+2p, adds a penalty (2p) to the quasilikelihood (Q), where p is the number of parameters in the model. Models do not need to be nested in order to use QIC or QICu to compare them. Note that QICu should not be used for selecting a working correlation structure.

When using QIC or QICu to compare two structures or two models, the model with the smaller statistic is preferred.

When using the %QIC macro, the following message will appear but can be ignored:

WARNING: Iteration limit exceeded.

This message appears because GENMOD is run with parameters restricted to a set of values and this message is a normal consequence. The message does not indicate a problem.

The %QIC macro attempts to check for a later version of itself. If it is unable to do this (such as if there is no active internet connection available), the macro will issue the following message:

   QIC: Unable to check for newer version

The computations performed by the macro are not affected by the appearance of this message.

LIMITATIONS:
Multinomial models and models with user-defined distributions (via the VARIANCE and DEVIANCE statements) are not supported. BY processing is not supported. For binomial data in which each observation is a single trial, the response variable must be numeric and use the values 1 (for event) or 0 (for nonevent). Note that GENMOD does not impose this restriction.
MISSING VALUES:
Since GENMOD is used within the macro, missing values are handled as described in the GENMOD documentation.
REFERENCES:
Pan, W. (2001), "Akaike's information criterion in generalized estimating equations," Biometrics, 57, 120-125.

Hardin, J.W. and Hilbe, J.M. (2003), Generalized Estimating Equations, Chapman & Hall/CRC: New York.

Thall, P.F. and Vail, S.C. (1990), "Some Covariance Models for Longitudinal Count Data with Overdispersion," Biometrics, 46, 657 - 671.

Ware, J.H., Dockery, Spiro A. III, Speizer, F.E., and Ferris, B.G., Jr. (1984), "Passive Smoking, Gas Cooking, and Respiratory Health of Children Living in Six Cities," American Review of Respiratory Diseases, 129, 366 - 374.




These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.