Skip to content
Back to formatted view

Raw Message

Message-ID: <17a5babf-0fd4-5cb0-b6cd-b29e4e1031bb@ed.ac.uk>
Date: 2016-09-12T16:08:21Z
From: Jarrod Hadfield
Subject: MCMCglmm predict fails on MCMCglmm output generated 11/15/15
In-Reply-To: <CAPD5L3B2v1x5i+CVyMtoKCLaeSz_=VFXm_BEQjZqhLbZYjUXsQ@mail.gmail.com>

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.