~ubuntu-branches/ubuntu/raring/lme4/raring

« back to all changes in this revision

Viewing changes to tests/agq.R

  • Committer: Package Import Robot
  • Author(s): Dirk Eddelbuettel
  • Date: 2012-06-23 13:55:52 UTC
  • mfrom: (1.1.27) (2.2.15 sid)
  • Revision ID: package-import@ubuntu.com-20120623135552-ftarnupvw0k973hh
Tags: 0.999999-0-1
* New upstream release

* debian/control: Set Build-Depends: to current R version
* debian/control: Change Depends to ${R:Depends}
* debian/control: Set Standards-Version: to current version 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
library(lme4)
 
2
 
 
3
## test AGQ=10 against glmmML results
 
4
g1 <- glmer(cbind(incidence, size - incidence) ~ period + (1 | herd),
 
5
                         family = binomial, data = cbpp, nAGQ=10)
 
6
getinfo.merMod <- function(m) c(fixef(m),deviance=deviance(m))
 
7
 
 
8
i1 <- getinfo.merMod(g1)
 
9
 
 
10
if (FALSE) {
 
11
    ## comment to avoid R CMD check complaints
 
12
    ## library(glmmML)
 
13
    getinfo.glmmML <- function(m) c(coef(m),deviance=deviance(m))
 
14
    i2 <- getinfo.glmmML(glmmML(cbind(incidence, size - incidence) ~ period,
 
15
                                family = binomial,
 
16
                                cluster=herd,
 
17
                                method="ghq",
 
18
                                n.points=10,
 
19
                                data = cbpp))
 
20
}
 
21
i2 <- structure(c(-1.39924138019006, -0.991381753243723, -1.12782730029348, 
 
22
                  -1.57948092000465, 100.010029977086), .Names = c("(Intercept)", 
 
23
                                                        "period2", "period3", "period4", "deviance"))
 
24
 
 
25
stopifnot(all.equal(i1,i2,tol=1e-6))
 
26
 
 
27