Hi List,
 
I’ m analysing the selectivity of resting site use by forest carnivores through mixed modelling techniques!
My data consist on 3358 observations (daily checking of different animals in a resting site) belonging to 21 different animals!
I have repeated observations with an animal in the same resting site several times but in different days (sometimes consecutive ones)!

Response variable is TREE_01 (binomial) that means animal present in a tree hollow (1) rather than other resting type (0) (dens and nests)...

One of the final models that I trying to fit is like this:

M_RSITE <- gamm(TREE_01 ~ s(X, Y, fx = TRUE) + s(SHRUB_CV, bs = "cr", k = 5) + 
T_MAX + FOREST_PP + D_RIPARIAN, random = list(fAnimal =~ 1), method = "REML", 
control = lmc, cor = corAR1(form = ~1 | fAnimal/fDayc), 
family = binomial, data = RSITE)
summary(M_RSITE$gam)


Where I am using the "s(X, Y, fx = TRUE)" part as a spatial effect (to account for spatial correlation) and the "cor = corAR1(form = ~1 | fAnimal/fDayc)" part to account for temporal correlation but I´m getting the following error:

fDayc  - number of days since the begining of the study...

Error in `*tmp*`[[k]] : attempt to select less than one element


 and some times this one:


Error in Initialize.corAR1(X[[2L]], ...) : 
  covariate must have unique values within groups for "corAR1" objects

Does the random effect part (Animal) do not match the corAR1 part? I´m using the Dayc to avoid similar covariate values among animals...

Any idea? 

Thanks a lot!
Best regards!
 
Filipe Carvalho, MSc, PhD student.
Unidade de Biologia da Conservação (UBC) e
Centro de Investigação em Biodiversidade e 
Recursos Genéticos (CIBIO),
Universidade de Évora,
Casa Cordovil, 2º Andar, Rua Dr. 
Joaquim Henrique da Fonseca, 
7000-890 Évora, (PORTUGAL)
Telefone: + 351266759350


Filipe Carvalho, MSc, PhD student.
Conservation Biology Unit (UBC) and
Research Center in Biodiversity and 
Genetic Resources (CIBIO),
University of Évora,
Casa Cordovil, 2º Andar, Rua Dr. 
Joaquim Henrique da Fonseca, 
7000-890 Évora, (PORTUGAL)
Phone: + 351266759350

	[[alternative HTML version deleted]]

