broom.mixed (version 0.2.3)

fixef.MCMCglmm: Extract fixed effects from an MCMCglmm object

Description

Function designed to extract the fixed effects from an MCMCglmm model object. Can either extract all samples from the fixed effects posteriors or return the posterior means.

Usage

# S3 method for MCMCglmm
fixef(object, use = c("all", "mean"), ...)

Arguments

object

An MCMCglmm model object to extract the effects from

use

A character string indicating whether to extract all posterior samples or the mean of the posteriors. Defaults to "all".

Arguments passed on to the worker function.

Value

A matrix of the fixed effects

See Also

ranef.MCMCglmm

Examples

Run this code
# NOT RUN {
  # a simple MCMCglmm model
  data(PlodiaPO)
  m <- MCMCglmm(PO ~ 1, random= ~ FSfamily, data=PlodiaPO, verbose=FALSE)

  # only extract average fixed effects
  fixef(m, use = "mean")

  # histogram of posterior samples of fixed effects
  hist(fixef(m))
  # matches the mean
  rowMeans(fixef(m))
# }

Run the code above in your browser using DataCamp Workspace