R/corrRanef.R

Defines functions corrRanef

Documented in corrRanef

corrRanef <-
function(model) {
  obj <- correction(model)
    if (inherits(obj, "try-error") == F) {
  rnames <- names(ranef(model))
  L <- length(ranef(model))
  lranef <- lapply(1:L, function(i) {
    as.data.frame(as.matrix((ranef(model)[[i]])) %*%
                    as.matrix(correction(model)[[i]]))
  })
  names(lranef) <- rnames}
  else {
  cat(paste("the correction of random effects cannot be made, random effects without correction are computed", "\n"))
  lranef <-ranef(model)}
  return(lranef)
}

Try the qape package in your browser

Any scripts or data that you put into this service are public.

qape documentation built on Aug. 21, 2023, 5:07 p.m.