Chapter 16, Section 16.5

 

Crossover Trial on Cerebrovascular Deficiency

Marginal Logistic Regression Model

 

library(foreign)

ds <- read.dta("c:/ecg.dta")

attach(ds)

 

library(geepack)

summary(geeglm(y ~ trt + period, data=ds, id = id, waves=period,

+    family=binomial("logit"), corstr="exch", std.err="san.se"))

 

Call:

geeglm(formula = y ~ trt + period, family = binomial("logit"), 

    data = ds, id = id, waves = period, corstr = "exch", std.err = "san.se")

 

 Coefficients:

            Estimate Std.err   Wald Pr(>|W|)    

(Intercept)  -1.2348  0.2978 17.195 3.37e-05 ***

trt           0.5689  0.2365  5.788   0.0161 *  

period        0.2950  0.2352  1.574   0.2096    

---

Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 

 

Estimated Scale Parameters:

            Estimate Std.err

(Intercept)   0.9975 0.09558

 

Correlation: Structure = exchangeable  Link = identity 

 

Estimated Correlation Parameters:

      Estimate Std.err

alpha   0.6243  0.1246

Number of clusters:   67   Maximum cluster size: 2

 

 

Mixed Effects Logistic Regression Model (Random Intercept)

 

library(lme4)

summary(glmer(y ~ trt + period + (1 | id), family=binomial, nAGQ=75)) 

 

Generalized linear mixed model fit by the adaptive Gaussian Hermite approximation 

Formula: y ~ trt + period + (1 | id) 

 AIC BIC logLik deviance

 177 188  -84.4      169

Random effects:

 Groups Name        Variance Std.Dev.

 id     (Intercept) 15.6     3.95    

Number of obs: 134, groups: id, 67

 

Fixed effects:

            Estimate Std. Error z value Pr(>|z|)    

(Intercept)   -3.820      0.848   -4.50  6.7e-06 ***

trt            1.503      0.654    2.30    0.022 *  

period         0.803      0.653    1.23    0.219    

---

Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 

 

Correlation of Fixed Effects:

       (Intrtrt   

trt    -0.548       

period -0.529  0.203