[R-sig-ME] Error using MCMCglmm

Kamal Atmeh k@m@|@@tmeh @end|ng |rom hotm@||@com
Mon Dec 27 21:30:42 CET 2021


Dear all,

I have shared the data with Ben and Jarrod and the code works for Ben 
(please see below his answer). I decided to go for the old 
uninstall-reinstall of the MCMCglmm package and the code works now. 
Thank you again all for your help and time with this problem.

Cheers,

Kamal


-------- Message transféré --------
Sujet : 	Re: [R-sig-ME] Error using MCMCglmm
Date : 	Mon, 27 Dec 2021 15:08:28 -0500
De : 	Ben Bolker <bbolker using gmail.com>
Pour : 	Kamal Atmeh <kamal.atmeh using hotmail.com>
Copie à : 	Jarrod Hadfield <j.hadfield using ed.ac.uk>



Your data + code runs for me, although with a warning:

Warning message:
In MCMCglmm(y ~ x * x2 + x3 + x4 + x5 + x6 + x7 + x8, random = ~r + :
some fixed effects are not estimable and have been removed. Use 
singular.ok=TRUE to sample these effects, but use an informative prior!

The trace plots of the fixed effects look mediocre but not awful, 
presumably fixable by the old brute force run-it-much-longer strategy (I 
assume you kept the runs short here for troubleshooting efficiency ...)

mod_tau_mc <- readRDS("mod_tau_mc.rds")
library(coda)
library(lattice)
ss <- mod_tau_mc$Sol
ff <- as.mcmc(ss[,startsWith(colnames(ss), "x")])
library(coda)
library(lattice)
xyplot(ff)



Results attached.

Slightly redacted sessionInfo():

R Under development (unstable) (2021-12-11 r81355)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Pop!_OS 21.04

Matrix products: default
BLAS: /usr/local/lib/R/lib/libRblas.so
LAPACK: /usr/local/lib/R/lib/libRlapack.so

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] MCMCglmm_2.32 ape_5.6 coda_0.19-4 Matrix_1.4-0

loaded via a namespace (and not attached):
[1] cubature_2.0.4.2 compiler_4.2.0 tools_4.2.0 corpcor_1.6.10
[5] parallel_4.2.0 Rcpp_1.0.7 nlme_3.1-153 grid_4.2.0
[9] tensorA_0.36.2 lattice_0.20-45
 >

[I'm cc'ing Jarrod; it would actually be best to have as much of this 
discussion in public/on the list as possible, in case we discover 
something of general interest, and it's definitely best to keep both me 
and Jarrod in the loop so that we don't duplicate effort -- we're both 
pretty busy ...]

cheers
Ben Bolker


On 12/27/21 2:55 PM, Kamal Atmeh wrote:
> Hi Ben,
>
> Thank you for your answer. I shared the data with Jarrod and I will 
> share it with you too. Please find it attached in the email. I 
> anonymized the data since it is a collaboration with multiple labs and 
> it would be better for confidentiality.
>
> Please find below the code that I am running.
>
> Cheers,
>
> Kamal
>
> library(MCMCglmm)
>
> prior1<-list(G = list(G1 = list(V = 1, nu = 0.02)
>                     ,G2 = list(V = 1, nu = 0.02)
>                     ,G3 = list(V = 1, nu = 0.02)
>                     ,G4 = list(V = 1, nu = 0.02)),
>              R = list(V = 1, nu = 0.02)
>              )
>
> mod_tau_mc <- MCMCglmm(y ~ x*x2 +
>                          x3+
>                          x4+
>                          x5+
>                          x6+
>                          x7 +
>                          x8
>                        , random = ~r+r2+r3+r4
>                        , family = "gaussian"
>                        , ginverse = list(r4 = phylo) # include a 
> custom matrix for argument phylo
>                        , prior = prior1
>                        , data = dataKamal
>                        , nitt = 22e+03 # number of iteration after burnin
>                        , burnin = 2000 # number of iteration before 
> beginning sample
>                        , thin = 100 # nb of iteration between sample
>                        , pr = TRUE) #save random posterior distribution
>
>
> Le 27/12/2021 à 20:18, Ben Bolker a écrit :
>>   Good point. If that doesn't work, though, we're going to hit the 
>> rapidly-diminishing-returns part of the remote-debugging cycle. Can 
>> you post a reproducible example (possibly with data posted elsewhere 
>> as the list doesn't support large messages or attachments, possibly 
>> fuzzed/anonymized if you're worried about data confidentiality)?
>>
>>   Ben Bolker
>>
>> On 12/27/21 2:13 PM, Walid Crampton-Mawass wrote:
>>> Hey Kamal,
>>>
>>> one possible solution is to run the same code in a new session where you
>>> only call the MCMCglmm package and input your data and phylogenetic
>>> pedigree as dataframes. That way you can figure out if there were any
>>> conflicts in the attached packages in your session.
>>>
>>> Cheers
>>>
>>
>> _______________________________________________
>> R-sig-mixed-models using r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

-- 
Dr. Benjamin Bolker
Professor, Mathematics & Statistics and Biology, McMaster University
Director, School of Computational Science and Engineering
Graduate chair, Mathematics & Statistics

	[[alternative HTML version deleted]]



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