 

I would like to ask how to exactly apply that fix to lme4 and pedigreemm
packages.
As I understand i need to call edit(lmer) and edit(pedigreem) to be able
to fix the problem. 
Please indicate exactly where in the lmer and pedigreemm function codes
I need to place the solution given below. 

Here is a somewhat crude fix; it adds an additional parameter
(checklevels) to the lmer_finalize and glmer_finalize functions in
lme4 that turns off the unwanted sanity check. The default is
checklevels=TRUE, which maintains the previous behavior. The
pedigreemm function is then changed to set checklevels=FALSE before
calling the appropriate finalizing function. I'm running these
changes locally and they seem to work fine.

Comments or suggestions are welcome, as is consideration of this
change or some variant on it for inclusion in the pedigreemm and lme4
packages.

----- in lmer.R in the lme4 package -----
lmer_finalize <- function(fr, FL, start, REML, verbose,
checklevels=TRUE)
{
...
### This checks that the number of levels in a grouping factor < n
### Only need to check the first factor because it is the one with
### the most levels.
 IF (CHECKLEVELS & !(LENGTH(LEVELS(DM$FLIST[[1]])) < LENGTH(Y)))
...

glmer_finalize <- function(fr, FL, glmFit, start, nAGQ, verbose,
checklevels=TRUE)
{
...
### This checks that the number of levels in a grouping factor < n
### Only need to check the first factor because it is the one with
### the most levels.
 if (checklevels & !(length(levels(dm$flist[[1]])) < ncol(dm$Zt)))
...

----- in pedigree.R in the pedigreemm package -----
pedigreemm <-
 function(formula, data, family = NULL, REML = TRUE, pedigree = list(),
...
 lmf$checklevels <- FALSE;
 ans <- do.call(if (!is.null(lmf$glmFit)) lme4:::glmer_finalize
else lme4:::lmer_finalize, lmf)
...

-- 
Aaron Rendahl, Ph.D.
Statistical Consulting Manager
School of Statistics, University of Minnesota

NEW OFFICE (as of June 2009):
48C McNeal Hall, St. Paul Campus
612-625-1062
www.stat.umn.edu/consulting

-- 
Yours sincerely, 
----------------
Witold Proskura, M.Sc., Ph.D. student 
West Pomeranian University of Technology, Szczecin
The Laboratory of Molecular Cytogenetics
6 Dr Judyma Street
Szczecin
71-466
Poland
 
	[[alternative HTML version deleted]]

