[R-sig-ME] MCMCglmm predict fails on MCMCglmm output generated 11/15/15

Jarrod Hadfield j.hadfield at ed.ac.uk
Mon Sep 12 18:08:21 CEST 2016


Hi,

I had to change how the predict function works in order to accommodate multivariate responses coming from different distributions. If you use:

model$Residual$family<-rep("gaussian", nrow(model$X))

it should run I think (if your response is gaussian).

Cheers,

Jarrod


On 11/09/2016 04:00, Kerry Samerotte wrote:
> Hi mixed modelers,
>
> I could really use some help with the MCMCglmm predict function. It works
> for me on MCMCglmm output that I generated recently, but fails on MCMCglmm
> output that I generated in November of 2015. In the past, the predict
> function worked just fine on the 11/15 data, but now it fails with the
> following error:
>
> Error in if (!grepl("hu|zi|za|multinomial", object$Residual$family[i])) { :
> argument is of length zero
>
> Here is the model I run in MCMCglmm:
> model = MCMCglmm(phen ~ condition, random = ~us(condition):strain,
> rcov=~idh(condition):units, data=data, prior = prior_PE, thin = 15, nitt =
> 30000, burnin = 6000, verbose = FALSE, pr = TRUE)
>
> Then I simply run:
> predictions <- predict(model, marginal = NULL)
>
> And it fails with the above error. This also fails with the same error:
> predictions <- predict(model)
>
> Help is appreciated!
> Thank you
> Kerry
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models


-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



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