. use "ecg.dta"
. tsset id period
panel variable: id (strongly balanced)
time variable: period, 0 to 1
delta: 1 unit
. xtgee y trt period, family(binomial) link(logit) corr(unstr) robust
Iteration 1: tolerance = .01591855
Iteration 2: tolerance = .00048302
Iteration 3: tolerance = .00002151
Iteration 4: tolerance = 6.380e-07
GEE population-averaged model Number of obs = 134
Group and time vars: id period Number of groups = 67
Link: logit Obs per group: min = 2
Family: binomial avg = 2.0
Correlation: unstructured max = 2
Wald chi2(2) = 8.26
Scale parameter: 1 Prob > chi2 = 0.0161
(Std. Err. adjusted for clustering on id)
------------------------------------------------------------------------------
| Semirobust
y | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
trt | .5688666 .2344814 2.43 0.015 .1092915 1.028442
period | .2950148 .2328697 1.27 0.205 -.1614015 .7514311
_cons | -1.2348 .3016183 -4.09 0.000 -1.825961 -.6436393
------------------------------------------------------------------------------
. xtcorr
Estimated within-id correlation matrix R:
c1 c2
r1 1.0000
r2 0.6243 1.0000
Mixed Effects Logistic Regression Model (Random Intercept)
. xtmelogit y trt period || id:, intpoints(100)
Refining starting values:
Iteration 0: log likelihood = -76.707955
Iteration 1: log likelihood = -68.780976
Iteration 2: log likelihood = -68.316879
Performing gradient-based optimization:
Iteration 0: log likelihood = -68.316879
Iteration 1: log likelihood = -68.130264
Iteration 2: log likelihood = -68.130169
Iteration 3: log likelihood = -68.130169
Mixed-effects logistic regression Number of obs = 134
Group variable: id Number of groups = 67
Obs per group: min = 2
avg = 2.0
max = 2
Integration points = 100 Wald chi2(2) = 4.25
Log likelihood = -68.130169 Prob > chi2 = 0.1193
------------------------------------------------------------------------------
y | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
trt | 1.863051 .9269169 2.01 0.044 .0463269 3.679775
period | 1.037561 .8188658 1.27 0.205 -.5673866 2.642508
_cons | -4.081569 1.671067 -2.44 0.015 -7.3568 -.8063381
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
id: Identity |
sd(_cons) | 4.943218 1.906526 2.321207 10.52702
------------------------------------------------------------------------------
LR test vs. logistic regression: chibar2(01) = 27.63 Prob>=chibar2 = 0.0000