broom package and MCMCglmm estimates
There is an MCMCglmm method in my fork of broom :
devtools::install_github("bbolker/broom")
library(broom)
library(MCMCglmm)
data(PlodiaPO)
model1 <- MCMCglmm(PO~1, random=~FSfamily, data=PlodiaPO,
verbose=FALSE, nitt=1300, burnin=300, thin=1)
tidy(model1)
## effect term estimate std.error
## 1 fixed (Intercept) 1.162818 0.01656339
I make no claims as to its completeness, but am happy to accept issues
or pull requests. Eventually the stuff in my fork will get migrated to
a separate "broom.mixed" (or some such) package.
On 17-10-24 05:56 PM, dani wrote:
Hello Pierre, Thank you so much for your prompt response, I will follow your advice and report back. best, daniNm
________________________________
From: Pierre de Villemereuil <pierre.de.villemereuil at mailoo.org>
Sent: Tuesday, October 24, 2017 1:47 PM
To: r-sig-mixed-models at r-project.org
Cc: dani
Subject: Re: [R-sig-ME] broom package and MCMCglmm estimates
Hi,
As far as I can see, there is no method to tidy up MCMCglmm output in broom. You can see that by looking at the "tidiers" functions in broom using:
library(help = broom) #No MCMCglmm
However, MCMCglmm output contains "mcmc" class objects that can be tidied up using tidyMCMC():
- fixed effects: tidyMCMC(model$Sol)
- random effects: tidyMCMC(model$VCV)
Look up ?tidyMCMC for more options. I'm afraid it's difficult to get the pMCMC back though. You can get 95% credible intervals are a replacement for those (set conf.int = TRUE).
I have also seen that Ben Bolker is working on a fork/split of broom for mixed models especially, maybe he plans on having a specific tidier for MCMCglmm?
Best,
Pierre.
On Tuesday, 24 October 2017 20:13:53 NZDT dani wrote:
Hi everyone,
I would like to visualize the estimates from a MCMC glmm model and I tried using broom but I received the following message:
Error in as.data.frame.default(mj) :
cannot coerce class ""MCMCglmm"" to a data.frame
I was wondering what should I do about this?
Thank you in advance for all your help!
Best,
DaniNM
[[alternative HTML version deleted]]
_______________________________________________
R-sig-mixed-models at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
R-sig-mixed-models Info Page - stat.ethz.ch<https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models>
stat.ethz.ch
Your email address: Your name (optional): You may enter a privacy password below. This provides only mild security, but should prevent others from messing ...
[[alternative HTML version deleted]]
_______________________________________________
R-sig-mixed-models at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models