 Dear R project Team,

 I am graduae student at Purdue University and a newbie to world of R.
First of all, I thank every one of you very much for the windows version of
lme4 package having lmer function that can take argument to account for
poisson modeling. I am currently trying to read more on poisson regression
modeling of repeated measures data  to model the data set I generated from
my experiment. I have some questions on this aspect as explained below.


I conducted a lab experiment to study the metapopulation dynamics of a
stored grain beetle (insect) in a 4 patch micro - landscape (or labscape) to
understand the effect of *Resource* (constant =1 and dimnishing = 0) ,
*Connectivity
*(High =1 and Low =0) and manipulating the spatial configurartion of the
resource patches termed *Config* (fixed = 1 and alternating =0) on the
population dynamics. With three factors at two levels,I have eight
treatments, each with *three replicates*. Each replication represnet a
particular subject [ landscape] under a corresponding treatment. The
response variables measured include the number of adult beetles present live
and dead in and out of the patches (from which we can calculate the total
live adults in the landscape). Also I have data on the total live larvae and
pupape in each of the 4 patches in a landscape.  The measurements were taken
once in three weeks and I have data for  each landscape  (that consist of
four patch each) about *18 time steps*, qualifying the data to call repeated
measures.

I am interested in fitting a poisson regression model to my data and is
interested in analysing the effect of each of the three factors in my
experiment on the population dynamics of the organism under study.  Provided
below is  the structure of data ( with data  at two time steps - time step 0
[ baseline] and time step 7).

       *Timestep* Treatment *Connect* *Resource* *Config* *Replicn*
TotalAdults LivingAdults TotalAdultsOut LivingAdultsOut PatchDeadAdults
OutDeadAdults TotalDeadAdults Larvae 0 1 1 1 1 1 24 24 0 0 0 0 0 18 0 1 1 1
1 2 24 24 0 0 0 0 0 18 0 1 1 1 1 3 24 24 0 0 0 0 0 18 0 2 1 1 0 1 24 24 0 0
0 0 0 18 0 2 1 1 0 2 24 24 0 0 0 0 0 18 0 2 1 1 0 3 24 24 0 0 0 0 0 18 0 3 1
0 1 1 24 24 0 0 0 0 0 18 0 3 1 0 1 2 24 24 0 0 0 0 0 18 0 3 1 0 1 3 24 24 0
0 0 0 0 18 0 4 1 0 0 1 24 24 0 0 0 0 0 18 0 4 1 0 0 2 24 24 0 0 0 0 0 18 0 4
1 0 0 3 24 24 0 0 0 0 0 18 0 5 0 1 1 1 24 24 0 0 0 0 0 18 0 5 0 1 1 2 24 24
0 0 0 0 0 18 0 5 0 1 1 3 24 24 0 0 0 0 0 18 0 6 0 1 0 1 24 24 0 0 0 0 0 18 0
6 0 1 0 2 24 24 0 0 0 0 0 18 0 6 0 1 0 3 24 24 0 0 0 0 0 18 0 7 0 0 1 1 24
24 0 0 0 0 0 18 0 7 0 0 1 2 24 24 0 0 0 0 0 18 0 7 0 0 1 3 24 24 0 0 0 0 0
18 0 8 0 0 0 1 24 24 0 0 0 0 0 18 0 8 0 0 0 2 24 24 0 0 0 0 0 18 0 8 0 0 0 3
24 24 0 0 0 0 0 18 1 - - - - - - - - - - - - - 1 - - - - - - - - - - - - -
  - - - - - - - - - - - - -
  - - - - - - - - - - - - -


       7 1 1 1 1 1 29 23 11 7 6 4 10 48 7 1 1 1 1 2 17 13 6 3 4 3 7 46 7 1 1
1 1 3 28 22 11 7 6 4 10 38 7 2 1 1 0 1 35 30 10 6 5 4 9 58 7 2 1 1 0 2 22 14
11 7 8 4 12 37 7 2 1 1 0 3 26 18 13 5 8 8 16 19 7 3 1 0 1 1 11 8 3 1 3 2 5 9
7 3 1 0 1 2 10 7 1 0 3 1 4 11 7 3 1 0 1 3 8 6 0 0 2 0 2 38 7 4 1 0 0 1 6 4 1
0 2 1


Here is the code I wrote to model the data using lmer function (lme4
library). Am I specifying the code correctly? How can I model the
correlation structure of the data ? And How does the analysis differ when we
specify the random factor in two different ways (see *red bold* part in 2
models ).

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

Fourpatchnew<-read.csv(file="Fourpatchnew.csv",header =T)

model1<-lmer(OutDeadAdults~Resource*Connect*Config +
*(Timestep|Replicn)*,data= Fourpatchnew, family = poisson, method=
"REML")

summary(model1)





Fourpatchnew<-read.csv(file="Fourpatchnew.csv",header =T)

model2<-lmer(OutDeadAdults~Resource*Connect*Config + *(1|Replicn)* ,data=
Fourpatchnew, family = poisson, method= "REML")

summary(model2)

*anova (model1, model2)*
*******************************************************************************

  I sincerely appreciate it if any one of you could answer my questions and
guide me if I have done something wrong with specifying the code. Any
suggestions are greatly welcome !

Sincerely
Byju



-- 
Byju N Govindan
Graduate Research Assistant
Forestry and Natural Resources
Purdue University
715 W State Street
West Lafayette IN 47907-2061
(765) 496-2845

	[[alternative HTML version deleted]]


