[R-sig-ME] random regression with MCMCglmm

Celine Teplitsky teplitsky at mnhn.fr
Thu Jun 24 12:32:06 CEST 2010


Hi Jarrod,

actually they both are. Here is a list of the columns in the data frame

  [1] "ID"                "Mate"              "Hf"
  [4] "Hm"                "AgeFemale"         "AgeMale"
  [7] "Year"              "DayRecovered"      "StatusBreeding"
[10] "Bonding"           "LD"                "Af"
[13] "Am"                "Afc"               "Amc"
[16] "Food.availability" "mFood"             "stFood"
[19] "st2Food"           "Quant"             "Q2"
[22] "animal"            "Cat"


Cat is 1 to 4 but as a factor. I tried a simpler version with Q2: only 2 
environments and coded as A/B but I get the same error message. The 
model runs very well when I try without error structure, but problems 
arise when I specify rcov.

Thanks a lot for your help!

Cheers

Celine

> Hi Celine,
>
> The most likely reason is that Cat or st2Food are not present in your 
> data frame.  If this is not the case, then let me know and I'll take a 
> more detailed look.
>
> Cheers,
>
> Jarrod
>
>
> On 23 Jun 2009, at 16:07, Celine Teplitsky wrote:
>
>> Dear all,
>>
>> I would like to fit a random regression using MCMCglmm. The problem 
>> is I don't manage to include heterogeneous residual variance (when I 
>> use just one residual variance the model is running). I have created 
>> a factor (Cat) grouping the environments into 4 food qualities from 
>> good to bad, so the model looks like:
>> priorA<-list(G=list(G1=list(V=diag(2), n=2)),R=list(V=diag(4), n= 2))
>>
>> MCMCglmm(LD ~ Age+stFood , random=~us(1+st2Food):ID, rcov = 
>> ~us(Cat):units, data=Data,prior=priorA, family = 
>> c("gaussian"),nitt=120000, burnin=20000, thin=100)
>>
>> but I get this error message, and I really don't know how to fix the 
>> problem:
>>
>> Error in `[.data.frame`(data, , components[[1]]) :
>>  undefined columns selected
>>
>> Many thanks in advance for any help
>>
>> Celine
>>
>> -- 
>>
>> Celine Teplitsky
>> Département Ecologie et Gestion de la Biodiversité UMR 7204
>> Unité Conservation des Espèces, Restauration et Suivi des Populations
>> Case Postale 51
>> 55 rue Buffon 75005 Paris
>>
>> Webpage : http://www2.mnhn.fr/cersp/spip.php?rubrique96
>> Fax : (33-1)-4079-3835
>> Phone: (33-1)-4079-3443
>>
>> _______________________________________________
>> R-sig-mixed-models at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>>
>
>


-- 

Celine Teplitsky
Département Ecologie et Gestion de la Biodiversité UMR 7204
Unité Conservation des Espèces, Restauration et Suivi des Populations
Case Postale 51
55 rue Buffon 75005 Paris

Webpage : http://www2.mnhn.fr/cersp/spip.php?rubrique96
Fax : (33-1)-4079-3835
Phone: (33-1)-4079-3443




More information about the R-sig-mixed-models mailing list