Skip to content
Prev 11418 / 20628 Next

pedigreemm number of levels per grouping factor

On Mon, 10 Feb 2014, Ben Bolker wrote:

            
It is a pure pedigreemm problem.  I was making a smaller example for the 
maintainers, which has been sent.

x <- data.frame(id=c(1,2,3,4), sire=c(NA,NA,1,1),
                 dam=c(NA,NA,2,2), y=c(NA,NA,3,4))
library(pedigreemm)
p <- pedigree(x$sire, x$dam, x$id)
pedigreemm(y ~ (1|id), pedigree=list(id=p), data=x,
            control=lmerControl(check.nobs.vs.nlev="ignore"))
Error in .sortCsparse(.Call(dtCMatrix_sparse_solve, a, b)) :
   Dimensions of system to be solved are inconsistent

5: .sortCsparse(.Call(dtCMatrix_sparse_solve, a, b))
3: solve(t(as(ped, "sparseMatrix")), as(factor(labs, levels = ped at label),
        "sparseMatrix"))
2: relfactor(pedigree[[i]], rownames(Zt)[rowsi])

  t(as(ped, "sparseMatrix"))
4 x 4 sparse Matrix of class "dtCMatrix" (unitriangular)
      1 2    3    4
[1,] 1 . -0.5 -0.5
[2,] . 1 -0.5 -0.5
[3,] . .  1.0  .
[4,] . .  .    1.0

  as(factor(labs, levels = ped at label), "sparseMatrix")
2 x 2 sparse Matrix of class "dgCMatrix"

3 1 .
4 . 1

Cheers, David Duffy

(who doesn't have time at the moment to work out a fix ;))

| David Duffy (MBBS PhD)
| email: David.Duffy at qimrberghofer.edu.au  ph: INT+61+7+3362-0217 fax: -0101
| Genetic Epidemiology, QIMR Berghofer Institute of Medical Research
| 300 Herston Rd, Brisbane, Queensland 4006, Australia  GPG 4D0B994A