[R] singular convergence with lmer function i lme4

Arild Husby arildhus at stud.ntnu.no
Mon Nov 21 14:24:50 CET 2005


Dear Sundar,

Thank you for your reply.


The posted dataset is just a subset from the entire dataset.

I found that it is clutch size 5 that causes the model to fail, since
whenever I try to include it the model fails to converge.. Hence, I only
included this subset into the mail.

However, my original dataset is the following (only needed variables
extracted);

tab2 <- cbind(numbrec,sexratio,fclutsize,LNRREIR)
> tab2
      numbrec  sexratio fclutsize      LNRREIR
 [1,]       1 0.6000000         2 199320100313
 [2,]       1 0.7500000         1 199327102511
 [3,]       1 0.2500000         1 199327202911
 [4,]       1 0.6666667         3 199327203011
 [5,]       3 1.0000000         1 199328100411
 [6,]       1 0.2500000         1 199329100511
 [7,]       2 0.2500000         1 199329100711
 [8,]       1 0.7500000         1 199329101211
 [9,]       1 0.5000000         1 199420100411
[10,]       1 0.8000000         2 199427100412
[11,]       1 0.6666667         3 199427100511
[12,]       1 0.8000000         2 199427202112
[13,]       2 0.5000000         1 199427206011
[14,]       1 0.2000000         2 199428100611
[15,]       1 1.0000000         2 199428101011
[16,]       1 0.8000000         2 199428101111
[17,]       2 0.5000000         3 199428101211
[18,]       0 0.5000000         1 199526200811
[19,]       0 1.0000000         1 199526201111
[20,]       0 0.2500000         1 199527100211
[21,]       0 0.8000000         2 199527103011
[22,]       2 0.5000000         1 199527200212
[23,]       1 0.6000000         2 199527200711
[24,]       0 0.2500000         1 199527201111
[25,]       0 0.8000000         2 199527202411
[26,]       0 0.6000000         2 199529100412
[27,]       1 0.5000000         1 199529100712
[28,]       0 0.7500000         1 199626200911
[29,]       1 0.2000000         2 199626201111
[30,]       1 0.2500000         1 199626201211
[31,]       2 0.8000000         2 199627200612
[32,]       1 0.4000000         2 199628100111
[33,]       4 0.7500000         1 199628100911
[34,]       0 0.8333333         3 199628101011
[35,]       1 0.7500000         1 199628101411
[36,]       1 0.8000000         2 199628101511
[37,]       3 0.3333333         3 199628101711
[38,]       1 0.4000000         2 199726200212
[39,]       1 0.2000000         2 199726202111
[40,]       1 0.6000000         2 199727101411
[41,]       2 0.6000000         2 199727106911
[42,]       2 0.7500000         1 199727209811
[43,]       2 0.6000000         2 199728100212
[44,]       0 0.5000000         3 199728100612
[45,]       1 0.5000000         1 199729100611
[46,]       0 0.4000000         2 199820100811
[47,]       3 0.0000000         1 199826102111
[48,]       1 0.8000000         2 199826200611
[49,]       1 0.0000000         1 199826200711
[50,]       3 0.2500000         1 199826203111
[51,]       1 0.2500000         1 199826203412
[52,]       1 0.5000000         1 199827103011
[53,]       2 0.6000000         2 199827203811
[54,]       1 0.5000000         1 199828100512
[55,]       0 0.5000000         1 199828100612
[56,]       0 0.7500000         1 199928101611
[57,]       1 0.3333333         3 199928102511
[58,]       0 0.5000000         1 200028101211
[59,]       1 0.7500000         1 200028101212
[60,]       2 0.2500000         1 200038100111
[61,]       2 1.0000000         2 200038109911
[62,]       3 0.7500000         1 200126101211
[63,]       0 0.6000000         2 200126202511
[64,]       0 0.4000000         2 200226100311
[65,]       1 0.6000000         2 200226100411
[66,]       1 0.4000000         2 200226100611
[67,]       1 0.4000000         2 200226126011
[68,]       0 0.7500000         1 200226202111
[69,]       1 0.4000000         2 200226203712
[70,]       0 0.5000000         3 200227120711
[71,]       1 0.5000000         1 200227120713
[72,]       3 0.7500000         1 200227170311
[73,]       1 0.6666667         3 200227220111
[74,]       0 0.5000000         1 200227220311
[75,]       0 0.5000000         1 200227220312
[76,]       2 0.6000000         2 200227220313
[77,]       0 0.7500000         1 200228101511
[78,]       1 0.2500000         1 200228102511
[79,]       1 0.2500000         1 200238103111


tab2 <- data.frame(tab2) #convert to data frame.

Where numbrec is number of recruits, ant fclutsize is the clutch size
(factor from 4 to 6) and LNRREIR which is a unique number given to a brood
(consisting of year, island number etc..)

So each LNRREIR is a unique number, however we want to include this as a
random factor to account for non independence among nestlings within brood
(Krackow & Tcladek 2001). Furthermore, a mother might have more than one
brood per year or might have broods between years that we want to control
for.

What we want to check is to see if number of recruits is dependent on the
sex ratio or if there is any interaction with clutch size.
And my model is;

obj1 <- lmer(numbrec~sexratio*fclutsize + (1|LNRREIR), family=poisson,
data=tab2)

summary(obj1)


Which gives me the same error message as I posted earlier.

> Error in devAGQ(PQLpars, 1) : Unable to invert singular factor of
downdated
> X'X
> In addition: Warning messages:
> 1: optim or nlminb returned message singular convergence (7) 
>  in: LMEopt(x = mer, value = cv) 
> 2: optim or nlminb returned message singular convergence (7) 
>  in: LMEopt(x = mer, value = cv) 
> 3: optim or nlminb returned message singular convergence (7) 
>  in: LMEopt(x = mer, value = cv) 
> 4: optim or nlminb returned message singular convergence (7) 
>  in: LMEopt(x = mer, value = cv) 
> 5: optim or nlminb returned message singular convergence (7) 
>  in: LMEopt(x = mer, value = cv) 
> 6: optim or nlminb returned message singular convergence (7) 
>  in: LMEopt(x = mer, value = cv) 
> 7: IRLS iterations for PQL did not converge
> 



If I understood your email correctly the problem is the use of LNRREIR as a
random factor as this is unique for each nest... Hence we should perhaps
include the identity of the mother as random factor (although this will
reduce the sample size considerably..).

Best regards, 

Arild




More information about the R-help mailing list