[R-sig-ME] glmer: object 'd' not found
Ross Boylan
ross at biostat.ucsf.edu
Sat Jul 6 06:58:59 CEST 2013
Working with lme4 built from git today (92498e426de8086e4aef32cfc8c9995b6b2481d2):
> r3b <- glmer(pAnyUAVI~(1|nid)+A5+rac_gay+nPartners+ethnic_sg+HIVTest, data=sp2a, family=binomial(), nAGQ=8)
Error in stopifnot(length(d) == 2, length(sval) == p, diff(sval) <= 0) :
object 'd' not found
Enter a frame number, or 0 to exit
1: glmer(pAnyUAVI ~ (1 | nid) + A5 + rac_gay + nPartners + ethnic_sg + HIVTest
2: eval(mc, parent.frame(1))
3: eval(expr, envir, enclos)
4: lme4::glFormula(formula = pAnyUAVI ~ (1 | nid) + A5 + rac_gay + nPartners +
5: rankMatrix(t(reTrms$Zt), method = "qr", sval = min(d))
6: stopifnot(length(d) == 2, length(sval) == p, diff(sval) <= 0)
It looks as if there might be a problem in glFormula (modular.R), which includes this test
## FIXME: adjust test for families with estimated scale parameter:
## useSc is not defined yet/not defined properly?
if (doCheck(cc <- control[[cstr]]) && ## not NULL or "ignore"
!(grepl(cc,"Small") && ## not "*Small" and large Z mat
prod(d <- dim(reTrms$Zt)) > 1e6) &&
(nrow(fr) < (rankZ <- rankMatrix(t(reTrms$Zt), method="qr", sval=min(d))))) ## test
I think the last line is the source of the call for level 5 of the stack.
Theory: the value of the grepl test is false and so prod(d <- ...) is never evaluated, and d is undefined.
I can't definitively confirm this in the debugger:
Selection: 4
Called from: stopifnot(length(d) == 2, length(sval) == p, diff(sval) <= 0)
Browse[1]> class(reTrms$Zt)
[1] "dgCMatrix"
attr(,"package")
[1] "Matrix"
Browse[1]> dim(reTrms$Zt)
[1] 1043 2505
# not sure why there are so many columns
Browse[1]> class(d)
Error during wrapup: object 'd' not found
#seems to indicate d undefined
Browse[1]> prod(dim(reTrms$Zt))
[1] 2612715
# is > 1e6
Browse[1]> cc
[1] "stopSmall"
Browse[1]> grepl(cc, "Small")
[1] FALSE
Selection: 5
Called from: function ()
{
if (.isMethodsDispatchOn()) {
tState <- tracingState(FALSE)
on.exit(tracingState(tState))
...
Browse[1]> sval
Error during wrapup: promise already under evaluation: recursive default argument reference or earlier problems?
# not sure what is going on there. I did previously select 5 and got dumped back in the frame selection list
# so maybe that messed things up.
I think this exact same call worked with an earlier version of lme4 on Windows.
Current environment R 2.15.1, Debian wheezy, amd64. R and some packages are from the Debiain archive,
many other dependencies of lme4 built from CRAN source, and lme4 from git.
names(sp2a)
[1] "pAnyUAVI" "studyidx" "A5" "ethnic_sg" "HIVTest" "rac_gay"
[7] "nPartners" "1" "nid"
Note the "1" which is a column of 1's. Perhaps that causes trouble with the (1|nid) specification? But, again, I think this was
working earlier.
Ross Boylan
More information about the R-sig-mixed-models
mailing list