Hi,

I have some difficulty in figuring out whether I am doing correct or not. 


A brief introduction about the work: It is a light/dark choice test 
conducted in insect larvae.  The response is binary (0- present in dark 
area, 1-present in light area) and the experiment is run for 15 min, so 
there are 15 repeated measurements per individual larva at 1 min 
intervals.  The factors which affect this study are Strain (2 levels-G 
and S),  wavelength of light (4 levels-blue, green, UV, red), and 
starting response at 0 min (two levels- animal present in dark-D or 
light-L).  This is how I think it is nested.  Strain nested inside 
Wavelength, Subject (individual) nested within strain, Starting response within subject, and time within Starting response.   The data looks like this:      

         Number              Wavelength     Strain             Subject           Startingresponse              time (min)
                1                        Red              G                   1                          L                               1
                2                        Red              G                   1                          L                               2
            ---------------------------------------------------------------------------------------------------------------
        ---------------------------------------------------------------------------------------------------------------------
              20                      
 Red              G                     1                         L                                20
               21                      Red              G                      2                        D                                1
                22                      Red               G                    2                        D                                2

            ---------------------------------------------------------------------------------------------------------------

    -----------------------------------------------------------------------------------------------------------------------
             
 40                      Red               G                      2      
                   D                             20
              
 -----------------------------------------------------------------------------------------------------------------
             ----------------------------------------------------------------------------------------------------------------
 
           121                     Green             G                  
   7                           D                             1
            122                    Green              G                    7                           D                             2
   ------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------
             
The model I used was:


(fm2 <-lmer(Response~Wavelength+Startingresponse+Strain+ time + (time|Subject),family=binomial, data=Behavdat)) 

I am not sure how to specify the nested structures within the
 model.  

Any help will be appreciated.
Thanks.
	[[alternative HTML version deleted]]

