[Lme4-commits] r1735 - pkg/lme4/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed May 16 05:08:12 CEST 2012


Author: dmbates
Date: 2012-05-16 05:08:11 +0200 (Wed, 16 May 2012)
New Revision: 1735

Modified:
   pkg/lme4/R/nbinom.R
Log:
Fix starting eta in refitNB.  I had forgotten that generating a new object resets eta to zero.


Modified: pkg/lme4/R/nbinom.R
===================================================================
--- pkg/lme4/R/nbinom.R	2012-05-16 01:48:04 UTC (rev 1734)
+++ pkg/lme4/R/nbinom.R	2012-05-16 03:08:11 UTC (rev 1735)
@@ -12,10 +12,13 @@
 setNBdisp <- function(object,theta) {
   ## assign(".Theta",theta,envir=environment(object at resp$family$aic))
   ff <- setdiff(names(getRefClass("glmResp")$fields()),c("Ptr","family"))
-  arg1 <- lapply(ff,object at resp$field)
+  rr <- object at resp
+  arg1 <- lapply(ff,rr$field)
   names(arg1) <- ff
   newresp <- do.call(glmResp$new,
                      c(arg1, list(family=negative.binomial(theta=theta))))
+  newresp$setOffset(rr$offset)
+  newresp$updateMu(rr$eta - rr$offset)
   object at resp <- newresp
   object
 }



More information about the Lme4-commits mailing list