When using the GEE or GENMOD procedure to fit a Generalized Estimating Equations model, the displayed results produced by the procedure include a "GEE Model Information" table. This table indicates the number of clusters and the maximum and minimum cluster sizes. Note that the reported number of clusters is determined before any observations are omitted for various reasons, such as invalid response value or missing value in any variable involved in the model fit. So, the number of clusters reported in this table is the number of clusters read rather than the number used.
Additional information that can be useful in understanding the fitted model or any problem in fitting the model is the number of clusters that contributed to the analysis and a summary of the sizes of the contributing clusters, where the cluster size is the number of observations used in the cluster. In some cases, it can also be helpful to see a list of the individual clusters used that shows the size of each. The following illustrates how this information can be obtained.
The DATA step that follows generates some example data with a continuous response, Y, that will be modeled using the gamma distribution. Note that only positive values are valid for the gamma distribution, so observations with negative or zero values do not contribute. For each subject, ID, two observations are created. Predictors in the model are GROUP, which does not change within subjects, and X1 and X2, which can change:
data a;
id+1;
input group @;
do i=1 to 2;
input x1 x2 y @;
drop i; output;
end;
datalines;
1 . 0 . . 0 1
2 1 1 1 2 2 1
2 1 0 1 2 0 111
1 1 0 . 2 0 .
2 1 0 0 2 1 0
1 1 0 7 2 1 3
2 1 1 8 2 1 66
1 1 1 11 2 1 6
1 1 2 1 2 2 .
2 1 0 12 2 0 8
2 1 1 . 2 0 0
1 1 1 20 2 0 0
2 1 1 5 2 0 1
1 1 1 0 2 2 5
2 1 1 0 2 1 .
1 1 1 1 2 1 1
;
proc print;
id id;
title "Example data";
run;
In the displayed data, note that some observations have missing predictors or missing or invalid (zero) response. Specifically, for ID=1, both observations are missing on predictor X1, so this subject's cluster cannot contribute to the model. In the ID=4 cluster, both responses are missing so it cannot contribute any information. The next cluster, ID=5, also cannot contribute since the zero responses in its observations are invalid for the gamma distribution. Clusters 11 and 15 each have one observation with a missing response and one with an invalid (zero) response, so they cannot contribute. So, five clusters (1, 4, 5, 11, and 15) cannot contribute to fitting a gamma GEE model. Several other observations can contribute only one observation because of either a missing or invalid response:
The following statements fit the gamma GEE model using the typical log link. In order to obtain the additional information described above, it is necessary to use the cluster diagnostic statistics that are available in the OUTPUT statement in PROC GENMOD. Because PROC GEE does not make the cluster diagnostics available, it cannot be used.
Most of the cluster diagnostics cannot be computed for observations with a missing predictor value or invalid response. This makes them useful for determining which observations contributed to fitting the GEE model. The cluster index variable, CLUSTER=, is all that is needed, but in order for that variable to be created, additional cluster diagnostics must be requested. The cluster diagnostics, CLUSTERDFIT= and CLEVERAGE=, are also specified in this example:
proc genmod data=a; class id group; model y = group x1 x2 / dist=gamma link=log; repeated subject=id; output out=out cluster=CLNum clusterdfit=CFit cleverage=CLev; run; proc print data=out; where id<=6; id id; title "Cluster diagnostics"; run;
Displayed below is the GEE Model Information table produced by PROC GENMOD that shows the number of clusters read from the data (16). As shown above, there are 16 total clusters in the data before any observations are omitted due to invalid or missing values. The reported Clusters With Missing Values (8) is the number of clusters that contain at least one missing value or invalid response value, such as zero for this gamma analysis. However, some of these clusters might still contribute if they contain an observation with no missing or invalid values. As shown above, only 5 of the 8 do not contribute, so 3 clusters contribute partially. The Minimum Cluster Size is 0 because, in some clusters, both observations are omitted due to missing values or invalid response.
The Cluster diagnostics table shows the cluster indices (CLNum), cluster leverage values (CLev), and standardized Cook distances (CFit) for the first six clusters. The cluster index and Cook distance are missing in each observation that did not contribute to the model. The cluster leverage can be computed even when the response is missing or invalid as long as all predictors are nonmissing:
Using the cluster index variable, CLNum, these statements count the number of observations that each cluster contributed to the model. In the data, each subject could contribute up to two observations, but might contribute only one or none depending on whether that subject's observations contained missing or invalid values. Contribution of a cluster is indicated by its CLNum index appearing. CLNum values for clusters not contributing any observations do not appear in the data set created by this step:
proc freq data=out; table CLNum / noprint out=cls(where=(CLNum ne .)); run; proc print data=cls; id CLNum; var count; title "List of all contributing clusters and their sizes"; run;
The results show the indices of all clusters that contribute to the model. COUNT shows the number of observations that could be used in each contributing cluster. This identifies the three partially contributing clusters of size 1 mentioned above:
The NLEVELS option in the following statements counts the number of clusters that contributed at least one observation to the model:
proc freq data=cls nlevels; table CLNum / noprint; title "Number of clusters used"; run;
The result shows that 11 clusters contributed information to the model, consistent with the number read, 16, minus the number noted above to have no usable observations, 5:
These statements display a table that shows the distinct cluster sizes observed among the clusters contributing to the model. Since there are at most two observations per cluster, then there are two possible sizes, 1 and 2:
proc freq data=cls; table count; title "Number of contributing clusters used at each cluster size"; run;
The results show that 3 clusters (subjects) of size 1 and 8 clusters of size 2 contributed to fitting the GEE model: