Skip to content
Prev 59084 / 398502 Next

lme, two random effects, poisson distribution

Hello all,

I think that with the help of Mark Irwin, we solved the problem:

We fit the model using glmmPQL and instead of using variable,
'state', we model the independent fixed-effect 'state' as
I(x>10); i.e. it's 0 for resting time slots and 1 for
excited times slots.

Here is the code:
=================
slugs.lmedata <- groupedData(y ~ I(x>10) | slugs/batch,
data=as.data.frame(data.slugs))

csnew <- corAR1(form = ~ x | slugs/batch)

res.glmm <- glmmPQL(pumps ~ I(x>10), random = ~1|slugs/batch, family
= poisson, data=slugs.lmedata, correlation=csnew)

The summary of the model looks like this:
=========================================
Linear mixed-effects model fit by maximum likelihood
 Data: slugs.lmedata
       AIC      BIC    logLik
  1265.934 1288.157 -626.9672

Random effects:
 Formula: ~1 | slugs
        (Intercept)
StdDev:   0.6959097

 Formula: ~1 | batch %in% slugs
        (Intercept) Residual
StdDev:    1.138034 1.304958

Correlation Structure: AR(1)
 Formula: ~x | slugs/batch
 Parameter estimate(s):
       Phi
-0.2820534
Variance function:
 Structure: fixed weights
 Formula: ~invwt
Fixed effects: y ~ I(x > 10)
                   Value Std.Error  DF   t-value p-value
(Intercept)   -0.5004731 0.2006282 142 -2.494531  0.0138
I(x > 10)TRUE  1.2553644 0.2494294 142  5.032944  0.0000
 Correlation:
              (Intr)
I(x > 10)TRUE -0.32

Standardized Within-Group Residuals:
       Min         Q1        Med         Q3        Max
-2.0856605 -0.5439464 -0.3606277  0.1855235  5.7606962

Number of Observations: 300
Number of Groups:
           slugs batch %in% slugs
              25              157

*******************************************************

I think this is the right model. But I am interested very much in
your opinions. I do not use mixed-effect modelling very often.

Thank your for all your help.

Martina

Quoting "Martina Pavlicova, PhD" <mp2370 at columbia.edu>: