Skip to content

pedigreemm number of levels per grouping factor

4 messages · David Duffy, Ben Bolker, Wilson, Alastair

#
On Fri, 7 Feb 2014, Wilson, Alastair wrote:

            
OK, runs fine with older versions of pedigreemm and lmer

Linear mixed model fit by REML
Formula: size ~ sex + forage + (1 | ID)
    Data: pheno
   AIC  BIC logLik deviance REMLdev
  1160 1180 -574.8     1143    1150
Random effects:
  Groups   Name        Variance Std.Dev.
  ID       (Intercept) 0.35597  0.59663
  Residual             0.73231  0.85575
Number of obs: 400, groups: ID, 400

Fixed effects:
             Estimate Std. Error t value
(Intercept)  5.29569    0.24255  21.833
sex          0.14436    0.09604   1.503
forage       0.88907    0.30644   2.901

Correlation of Fixed Effects:
        (Intr) sex
sex    -0.594
forage -0.717  0.000

The newest version of pedigreemm is failing in pedigreemm::relfactor(), 
which is supposed to produce the Cholesky factor of the relationship 
matrix, where the error arises in:

solve(t(as(ped,"sparseMatrix")),
       as(factor(labs, levels = ped at label),"sparseMatrix"))

specifically in your exampe, NRM is 500*500 but labs is 400*1 (100 
unphenotyped founders)

Cheers, David Duffy.

| 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
1 day later
#
David Duffy <David.Duffy at ...> writes:
[snip]
I'm not following this particularly carefully, but if this turns out
to be an issue on the lme4 end (or something that could be alleviated
on the lme4 end, even if it's not an lme4 bug per se), please let the
maintainers know/consider posting an issue at https://github.com/lme4/lme4
...

   Ben Bolker
#
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
1 day later