Tuesday, January 23, 2007

F lmer

Hi Marie,
do you really need to use the quasibinomial distribution? Is there evidence of overdispersion in the maximal model you fit?

If not, then you can use the binomial distribution.
That allows you to use likelihood-ratio tests for the fixed and random effects.
using
anova(model,modelsimplified,test="Chisq")

If there is clear overdispersion, then I guess the best thing to do would be resampling according to the model, if that works for the quasibinomial "distribution". You need to use mcmcsamp() for that.
Otherwise, it will become hand-work to get some of those hotly debated F-ratios out....
Cheers, Tom

Tuesday, January 16, 2007

Longitudinal Data

Finally, the participants in the course Longitudinal and Incomplete Data have been invited. Transcripts for R of the SAS code presented during the course will be added to the weblog soon.
Cheers, Tom

Loglinear models

Hi Nicola,
the best manual is http://www.statslab.cam.ac.uk/~pat/Splusdiscrete2.pdf, based on the book by Agresti.
You can basically use glm with a poisson link for log-linear models, I guess it is also discussed in the Venables and Ripley book.
Good luck, Tom

Friday, January 05, 2007

lmer, random effect with four levels

Dear Amir,
the "place" random effect in your dataset has only four levels, and they are nested within plants. The error which is returned states that the variance covariance matrix is singular, meaning that variation in intercept, slope and their covariance cannot be fitted. If you fit the random effect as (1|place), you will read that the random effect variance is effectively zero.
It does not make sense to include place both as fixed and as random, as in you second to fourth models. Since the number of levels of the random effects is very low, you could even just model them as fixed, using glm. The idea of random effects is that they are a representative sample from a large population, which is hard to defend with just two levels sampled per group!
More importantly, the distribution of your data does not look poisson at al. There are many zero observations. I would convert the counts to presence/absence data and analyse those as bernoulli probabilities. That works to some extent:

b<-ifelse(Predators.Allspecies.>0,1,0)
model<-lmer(b~julian.date+offset(log.time)+(1|place),family=binomial)

I've added you models to your post, so other visitors to this blog can also read and respond to your question,
all the best, Tom