[ADMB Users] Nested random effects syntax in glmmADMB 0.6.2 alpha

Shawn McCracken frocga at gmail.com
Thu Aug 4 21:52:57 PDT 2011


Today I managed to get the alpha version of glmmADMB 0.6.2 loaded and
running. I am running negative binomial model with nested random effects.

I decided to start with a reduced model of my data, so I began with the
following syntax and R would just hang and I get the pinwheel of death (Mac
OS 10.6.8):

> m1=glmmadmb(Y~X+(1|A/B),data=ecpad5,family="nbinom")

I can't find the exact mailing list message, but somewhere I believe I read
that  +(1|A)+(1|B) is the same as the above syntax in lme4 as long as factor
B is coded with unique individual labels.

I then tried the following model syntax and it worked just fine:

> m2=glmmadmb(Y~X+(1|A)+(1|B),data=ecpad,family="nbinom")
> summary(m2)

Coefficients:
            Estimate Std. Error z value Pr(>|z|)
(Intercept)   -0.841      0.234   -3.59  0.00034 ***
treaty         -0.702      0.311   -2.26  0.02413 *
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Number of observations: total=160, =32, =160
Random effect variance(s):
$tree
            (Intercept)
(Intercept)  2.9858e-09

$trbr
            (Intercept)
(Intercept)      1.2847

Negative binomial dispersion parameter: 403.43 (std. err.: 2.1584)

Log-likelihood: -162.773


My data structure:

A =(randomly selected plot)     B =(randomly selected sub-plot within A)
X =(disturbed=Y or N)     Y =(total count of individuals present)

T01                                             B001
                               N                                   2
T01                                             B002
                               N                                   0
T01                                             B003
                               N                                   0
T01                                             B004
                               N                                   1
T01                                             B005
                               N                                   0
T02                                             B006
                               N                                   0
T02                                             B007
                               N                                   4
T02                                             B008
                               N                                   1
T02                                             B009
                               N                                   0
T02                                             B010
                               N                                   0
.                                                  .
                                     .                                    .
.                                                  .
                                     .                                    .
.                                                  .
                                     .                                    .
T32                                             B156
                               Y                                   3
T32                                             B157
                               Y                                   0
T32                                             B158
                               Y                                   0
T32                                             B159
                               Y                                   1
T32                                             B160
                               Y                                   0

Is glmmADMB treating B as being nested in A like it does in lme4? To the
best of your knowledge do the results look like they should?

I'll have more questions later but gotta get this sorted first.

Thanks for the help,

Shawn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.admb-project.org/pipermail/users/attachments/20110804/9bc1fb7c/attachment.html>


More information about the Users mailing list