SCM

SCM Repository

[matrix] Diff of /pkg/R/lmer.R
ViewVC logotype

Diff of /pkg/R/lmer.R

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 720, Mon May 9 01:32:44 2005 UTC revision 721, Mon May 9 02:13:25 2005 UTC
# Line 175  Line 175 
175                val[-length(val)]                val[-length(val)]
176            })            })
177    
178    setMethod("fixef", signature(object = "glmer"),
179              function(object, ...) {
180                  object@fixed
181              })
182    
183  setMethod("VarCorr", signature(x = "lmer"),  setMethod("VarCorr", signature(x = "lmer"),
184            function(x, REML = TRUE, useScale = TRUE, ...) {            function(x, REML = TRUE, useScale = TRUE, ...) {
185                val <- .Call("lmer_variances", x, PACKAGE = "Matrix")                val <- .Call("lmer_variances", x, PACKAGE = "Matrix")
# Line 196  Line 201 
201            function(object, ...)            function(object, ...)
202            new("summary.lmer", object, useScale = TRUE, showCorrelation = TRUE))            new("summary.lmer", object, useScale = TRUE, showCorrelation = TRUE))
203    
204    ## FIXME: glmm-s with scale not handled
205    setMethod("summary", signature(object = "glmer"),
206              function(object, ...)
207              new("summary.lmer", object, useScale = FALSE, showCorrelation = TRUE))
208    
209    
210  setMethod("show", signature(object = "lmer"),  setMethod("show", signature(object = "lmer"),
211            function(object)            function(object)
212            show(new("summary.lmer", object, useScale = TRUE,            show(new("summary.lmer", object, useScale = TRUE,
213                     showCorrelation = FALSE))                     showCorrelation = FALSE))
214            )            )
215    setMethod("show", signature(object = "glmer"),
216              function(object)
217              show(new("summary.lmer", object, useScale = FALSE,
218                       showCorrelation = FALSE))
219              )
220    
221  setMethod("show", "summary.lmer",  setMethod("show", "summary.lmer",
222            function(object) {            function(object) {
# Line 690  Line 706 
706            ## multiple). This would automatically call bhat() and hence            ## multiple). This would automatically call bhat() and hence
707            ## have the 'correct' random effects in reducedObj.            ## have the 'correct' random effects in reducedObj.
708    
709            loglik <- devLaplace(optpars)            loglik <- -devLaplace(optpars)
710            ##print(loglik)            ##print(loglik)
711            ff <- optpars[1:(responseIndex-1)]            ff <- optpars[1:(responseIndex-1)]
712            names(ff) <- names(fixef(obj))            names(ff) <- names(fixef(obj))
# Line 699  Line 715 
715    
716  ###      }  ###      }
717    
718            obj            ##obj
719    
720              new("glmer", obj,
721                  family = family,
722                  glmmll = loglik,
723                  method = method,
724                  fixed = ff)
725        })        })
726    
727    
# Line 728  Line 750 
750                val                val
751            })            })
752    
753    setMethod("logLik", signature(object="glmer"),
754              function(object, ...) {
755                  val <- object@glmmll
756                  nc <- object@nc[-seq(a = object@Omega)]
757                  attr(val, "nall") <- attr(val, "nobs") <- nc[2]
758                  attr(val, "df") <- nc[1] + length(ccoef(object))
759                  ## attr(val, "REML") <- REML
760                  class(val) <- "logLik"
761                  val
762              })
763    
764  setMethod("anova", signature(object = "lmer"),  setMethod("anova", signature(object = "lmer"),
765            function(object, ...)            function(object, ...)
766        {        {
# Line 857  Line 890 
890                object@deviance[[ifelse(REML, "REML", "ML")]]                object@deviance[[ifelse(REML, "REML", "ML")]]
891            })            })
892    
893    
894    setMethod("deviance", "glmer",
895              function(object, ...) {
896                  -2 * object@glmmll
897              })
898    
899  setMethod("chol", signature(x = "lmer"),  setMethod("chol", signature(x = "lmer"),
900            function(x, pivot = FALSE, LINPACK = pivot) {            function(x, pivot = FALSE, LINPACK = pivot) {
901                x@status["factored"] <- FALSE # force a decomposition                x@status["factored"] <- FALSE # force a decomposition

Legend:
Removed from v.720  
changed lines
  Added in v.721

root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge