prior specification for multinomial model MCMCglmm
Dear Vincenzo, My guess is they are referring to the MCMCglmm tutorial from the Ecologist?s guide to the animal model, check whether it fits: http://www.wildanimalmodels.org/tiki-download_wiki_attachment.php?attId=24 Best, Gabi
On 6 Apr 2017, at 20:44, Vincenzo Ellis <vincenzoaellis at gmail.com<mailto:vincenzoaellis at gmail.com>> wrote:
Dear list members, I'm wondering if someone could give me some guidance on how to set up the priors, specifically regarding random effects, for a multinomial model in MCMCglmm. The response variable has three levels. The model has an intercept, but no explanatory variables and it has three nested random effects. The point of the model is to partition variance in the response variable among the three random effect terms. Following the course notes for the package, I think I have the R structure right for the prior, but I'm finding very little information online to help with specifying the G structure--both what kind of prior is appropriate in this case and how to code it. There is at least one worked example ( https://hlplab.wordpress.com/2009/05/07/multinomial-random-effects-models-in-r/) but it cites a tutorial for most of the explanations that I cannot find. Any advice would be much appreciated. Data and code (with the prior specification incomplete) follow. Thanks! Vincenzo ## load data library(gsheet) dat <- gsheet2tbl(' https://docs.google.com/spreadsheets/d/1qVABAjNSBIlsoG3FYjREejBKyGkJvjaPiIJ_T_bzO_Y/edit?usp=sharing ') ## group taxonomic categories into unique categories for MCMCglmm for use as nested random effects dat$Family.Genus <- paste0(dat$Family, dat$Genus) dat$Family.Genus.Species <- paste0(dat$Family, dat$Genus, dat$Species) ## make variables factors...they come out as characters in the download dat <- as.data.frame(unclass(dat)) ## set up model library(MCMCglmm) ## k = number of categories in response variable k <- length(levels(dat$Nest.Type)) ## I and J are matrices that will set up constraints on the residuals of the model I <- diag(k-1) J <- matrix(1, k-1, k-1) ## set up prior; how to set up the G structure? prior1 <- list(R = list(V = (1/k)*(I + J), fix = 1)) ## model mod <- MCMCglmm(Nest.Type ~ trait - 1, rcov = ~us(trait):units, random = ~us(trait):Family + us(trait):Family.Genus + us(trait):Family.Genus.Species, prior = prior1, data = dat, family = "categorical") _______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-mixed-models/attachments/20170410/3da5a6bd/attachment.ksh>