The code is similar to that which was used with thextgeecommand except that the
link()andfamily()options found with thextgeecommand are unnecessary with the
xtlogitcommand as it is understood that a logistic regression is requested. Thepa
option (for population averaged) inxtlogitrequests that a GEE model be run. Theor
option (for odds ratios) requests that the parameter estimates be exponentiated.
We have seen that thextlogitcommand with thepaoption requests a GEE model. If
instead thefeoption is used (for fixed effects) then thextlogitcommand requests a
conditional logistic regression to be run. Next, we consider a model with fixed effects
(dummy variables) for the cluster variable. The model is stated as follows:
logit PðOUTCOME¼ 1 jXÞ¼b 0 þb 1 BIRTHWGTþb 2 GENDERþb 3 DIARRHEA
þ~
135
i¼ 1
giVi
Vi¼
(
1 ifith matched triplet
0 otherwise
i¼ 1 ; 2 ;...; 135
The indicator variables in this model are fixed effects. The code to run this model is
shown two ways: first with thextlogitcommand and then, for comparison, with the
clogitcommand that was previously shown in the section on conditional logistic
regression.
xtlogit outcome birthwgt gender diarrhea, fe or
clogit outcome birthwgt gender diarrhea, strata(idno) or
Both commands yield the same output. We show the output from thextlogitcom-
mand with thefeoption:
note: 115 groups (1019 obs) dropped because of all positive or all negative
outcomes.
note: birthwgt omitted because of no within–group variance.
note: gender omitted because of no within–group variance.
Iteration 0: log likelihood¼64.410959
Iteration 1: log likelihood¼64.409171
Iteration 2: log likelihood¼64.409171