Hi r-gurus!
 
Im trying to fit a nested model on my data. This data is about birds feeding nestlings. Besides the breeding pair, helpers feed the nestlings. These helpers are sometimes related, and sometimes not. Therefore, we have 5 types of birds feeding the nestlings (5 levels), 1=breeding female, 2=breeding male, 3=unrelated helper, 4= helper but relatedness unknown and 5=related helper (this is called in the factor STATUS). We have monitorred feeding of nestlings from the moment they were born, till the moment they fledge (~10days), thus multiple rows per nest per bird that feeds (see below).
 
Every bird has a birdid. The same birds might feed at different nests. Knowing this, i THINK the nested structure i need to nest: age within birdid within nest (and in R it thus looks like: ,random=~1|nest/birdid/age). I THINK i need to specify my lowest level (is 'age') too, right???
 
To start with, i want to see if birds of different statuses feed the nestlings differently in the amount of food they bring to the nestlings (TFoodhrC ; Total food per hour per chick). Therefore, i have ONE row per bird that feeds per age per nest.
 
The data looks like this:
 
nest	 birdid	 STATUS 	       age	      age2	 TFoodhrC	
LUC2	 ID101	 3	 3	 9	 35	
LUC2	 ID101	 3	 5	 25	 45	
LUC2	 ID101	 3	 6	 36	 50	
LUC2	 ID101	 3	 7	 49	 70	
LUC2	 ID102	 1	 1	 1	 50	
LUC2	 ID102	 1	 2	 4	 60	
LUC2	 ID102	 1	 4	 16	 90	
LUC2	 ID102	 1	 5	 25	 90	
LUC2	 ID102	 1	 6	 36	 115	
LUC2	 ID102	 1	 7	 49	 120	
LUC2	 ID102	 1	 9	 81	 120	
...	 ...	 ...	 ...	 ...	 ...	
...	 ...	 ...	 ...	 ...	 ...	
(when the same bird feeds at different nests, it might have a different relatedness status)
 
 
I made the relevant variables into factors:
 
> str(r)    
'data.frame'   : 352 obs. of  6 variables:
 $ nest        : Factor w/ 9 levels "LUC2","LUC4",..: 7 7 7 7 7 7 7 7 7 7 ...
 $ birdid      : Factor w/ 58 levels "ID101","ID102",..: 29 42 43 43 43 43 ...
 $ STATUS      : Factor w/ 5 levels "1","2","3","4","5": 3 3 3 3 3 3 NA NA NA ...
 $ age         : int  8 5 6 7 8 10 3 4 5 6 ...
 $ age2        : int  64 25 36 49 64 100 9 16 25 36 ...
 $ TFoodhrC    : num   2.5 50.0 92.5 90.0 85.6 ...
 
so, a first simple model i think i have to run (but please say so if you disagree), is this:
 
model1<-lme(TFoodhrC ~ age + age2 + STATUS ,random=~1|nest/birdid/age, method="ML", data=r))
# I used the method="ML" to be able to compare models using anova(model1, model2)
# Model1  fits a non-linear effect of age with an additive effect of status
 
 
 
Here we expect both age and age2 to have 1 df and each STATUS-group will have 1 df as well (which makes 4 df for the factor STATUS with its 5 levels)... right?
This is the model result:
 
Linear mixed-effects model fit by maximum likelihood
 Data: r 
       AIC      BIC    logLik
  3966.394 4008.894 -1972.197
Random effects:
 Formula: ~1 | nest
        (Intercept)
StdDev:  0.01260764
 Formula: ~1 | birdid %in% nest
        (Intercept)
StdDev:    54.65041
 Formula: ~1 | age %in% birdid %in% nest
        (Intercept) Residual
StdDev:    54.44147 5.118744
Fixed effects: TFoodhrC ~ age + age2 + STATUS 
                 Value Std.Error  DF   t-value p-value
(Intercept)   37.09982  33.13856 266  1.119536  0.2639
age           50.78117   9.21400 266  5.511305  0.0000
age2          -2.80368   0.72525 266 -3.865815  0.0001
STATUS2      -38.68363  28.13522  71 -1.374918  0.1735
STATUS3     -184.44241  28.18808  71 -6.543277  0.0000
STATUS4     -160.85014  26.05734  71 -6.172929  0.0000
STATUS5     -188.41773  22.34673  71 -8.431555  0.0000
 Correlation: 
        (Intr) age    age2   STATUS2 STATUS3 STATUS4
age     -0.788                                      
age2     0.757 -0.988                               
STATUS2 -0.421 -0.001  0.001                        
STATUS3 -0.422  0.000  0.000  0.497                 
STATUS4 -0.451 -0.002 -0.002  0.537   0.536         
STATUS5 -0.524 -0.001 -0.006  0.627   0.625   0.678 
Standardized Within-Group Residuals:
        Min          Q1         Med          Q3         Max 
-0.41909637 -0.05154464 -0.01063845  0.04163088  0.40097660 
Number of Observations: 352
Number of Groups: 
                     nest          birdid %in% nest age %in% birdid %in% nest 
                        9                        84                       352 

 
Both age and age2 have 266 df here and STATUS even 71 each! I dont know what is going wrong here. 
 
Can anyone see what goes wrong here?
 
Many many thanks in advance!
 
Luc te Marvelde
 
 

	[[alternative HTML version deleted]]


