2015-01-20 4 views
1

Wheng perfoming glmer.nb, 우리가 오류 메시지perfom의 glmer.nb()는 오류 메시지 (maxstephalfit) PIRLS : (maxstephalfit) PIRLS 스텝 halvings는

> glm1 <- glmer.nb(Jul ~ scale(I7)+ Maylg+(1|Year), data=bph.df) 

오류가 pwrssUpdate에서 일탈을 줄이기 위해 실패 단계 이분법은 pwrssUpdate의 편차를 줄이지 못했습니다. 경고 메시지 : theta.ml (Y, mu, sum (w), w, limit = 제어 $ maxit, trace = 제어 $ trace> : 반복 횟수에 도달했습니다.

누구에게 도움을 줄 수 있습니까? 대단히 감사합니다.

내 데이터는 아래에 나열되어 있습니다.

Year Jul A7 Maylg L7b 
331 1978 1948 6 1.322219 4 
343 1979 8140 32 2.678518 2 
355 1980 106896 26 2.267172 2 
367 1981 36227 25 4.028205 2 
379 1982 19085 18 2.752816 2 
391 1983 26010 32 2.086360 3 
403 1984 1959 1 2.506505 4 
415 1985 8025 18 2.656098 0 
427 1986 9780 20 1.939519 0 
439 1987 48235 29 4.093912 1 
451 1988 7473 30 2.974972 2 
463 1989 2850 25 2.107210 2 
475 1990 10555 18 2.557507 3 
487 1991 70217 30 4.843563 0 
499 1992 2350 31 1.886491 2 
511 1993 3363 32 2.956649 4 
523 1994 5140 37 1.934498 4 
535 1995 14210 36 2.492760 1 
547 1996 3644 27 1.886491 1 
559 1997 9828 29 1.653213 1 
571 1998 3119 41 2.535294 4 
583 1999 5382 10 2.472756 3 
595 2000 690 5 1.886491 2 
607 2001 871 13  NA 2 
619 2002 12394 27 0.845098 5 
631 2003 4473 36 1.342423 2 

답변

2

당신은, 무엇보다도이 데이터 세트와 함께 많은 문제를 가지고 당신이 관찰 수준 임의 효과를 가지고 있기 때문에 시도를 (만 Year 당 하나의 데이터 포인트를)거야 음 이항 모델에 적합합니다. 그것은 본질적으로 동시에 두 가지 다른 방법으로과 분산을 맞추려고한다는 것을 의미합니다.

Poisson 모델에 적합하다면, 결과는 강하게 입니다 (Poisson 모델의 경우 남은 편차는 잔여 자유도와 거의 같아야 함).

library("lme4") 
glm0 <- glmer(Jul ~ scale(A7)+ Maylg+(1|Year), data=bph.df, 
       family="poisson") 
print(glm0) 
Generalized linear mixed model fit by maximum likelihood (Laplace 
    Approximation) [glmerMod] 
Family: poisson (log) 
Formula: Jul ~ scale(A7) + Maylg + (1 | Year) 
    Data: bph.df 
     AIC  BIC logLik deviance df.resid 
526.4904 531.3659 -259.2452 518.4904  21 
Random effects: 
Groups Name  Std.Dev. 
Year (Intercept) 0.9555 
Number of obs: 25, groups: Year, 25 
Fixed Effects: 
(Intercept) scale(A7)  Maylg 
    7.3471  0.3363  0.6732 
deviance(glm0)/df.residual(glm0) 
## [1] 0.0003479596 

또는 대안 :

library("aods3") 
gof(glm0) 
## D = 0.0073, df = 21, P(>D) = 1 
## X2 = 0.0073, df = 21, P(>X2) = 1 

glmmADMB

가 맞게 관리 않지만, 나는 결과를 신뢰하는 것이 얼마나 모른다 (분산 매개 변수는 모델을 가지고 있음을 나타내는 매우 큰 어쨌든 포아송 분포로 수렴 됨).

bph.df <- na.omit(transform(bph.df,Year=factor(Year))) 
glmmadmb(Jul ~ scale(A7)+ Maylg+(1|Year), data=bph.df, 
     family="nbinom") 
GLMM's in R powered by AD Model Builder: 

    Family: nbinom 
    alpha = 403.43 
    link = log 

Fixed effects: 
    Log-likelihood: -259.25 
    AIC: 528.5 
    Formula: Jul ~ scale(A7) + Maylg + (1 | Year) 
(Intercept) scale(A7)  Maylg 
    7.3628472 0.3348105 0.6731953 

Random effects: 
Structure: Diagonal matrix 
Group=Year 
      Variance StdDev 
(Intercept) 0.9105 0.9542 

Number of observations: total=25, Year=25 

결과는 본질적으로 위의 lme4의 포아송 모델과 동일합니다.