Hi there,

I have relative abundance data for 13 mammal species that I collected at 
various sites that ranged in road density. I'm trying to determine the effect 
of road density on animal abundance across body sizes. For most species, I have 
data that was collected in one year but for a few species I have two years of 
complete data, and would like to use both. Since I have count data, I'm trying 
to use Poisson regression and incorporate random effects for body size using 
lmer. I would like to run 4 models and use AIC to select the best model 
amongst:  a) fixed effect for road density, 2)  randoms intercepts for body 
size, 3)  random slopes for body size, and 4) random slopes and intercepts for 
body size. Since I have two years of data for some species however, I would 
like to treat each year separately so I believe I need to account for this by 
nesting year (as a factor) within body size (also a factor). My first question 
is whether or not the code below is correct for the models outli!
 ned above?

data= (mixed)

fBodySize <- factor(mixed$BodySize) 
fYear<-factor(mixed$Year)


groupedData(ABUNDANCE~RoadDensity | fBodySize/fYear, data = mixed) 

#random intercept
m1<-lmer(ABUNDANCE~RoadDensity +(1|fBodySize/fYear), family=poisson(log), data 
= mixed)


# random slope

m2<-lmer(ABUNDANCE~RoadDensity +(-1 + RoadDensity |fBodySize/fYear), 
family=poisson(log), data = mixed)


#random slope and intercept
m3<-lmer(ABUNDANCE~RoadDensity +(1+RoadDensity |fBodySize/fYear), 
family=poisson(log), data = mixed)

And secondly, I do have slightly overdispersed data, but since I would like to 
compare models, I believe using a quasi-Poisson model won't work since it does 
not provide a likelihood function, therefore I cannot do a model comparison 
using AIC?? However, a negative binomial may be appropriate but I'm having 
trouble figuring out the code for the same models above but using the glmmADMB 
library (which I believe can handle neg. bin family with random effects??). Can 
help with the code for the same models above but using neg. bin regression?

Thanks very much,
Bob


                                          
_________________________________________________________________


        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to