Skip to contents

The Mod_Heatmap_Beta() and Mod_Heatmap_Omega() functions generate heatmaps using ggplot2 to visualize parameter estimates or posterior support values for species' environmental responses (beta parameters, which describes how species (Y) respond to various covariates (X); see Hmsc::plotBeta) and residual associations (omega parameter), respectively.

Usage

Mod_Heatmap_Beta(
  Path_Model = NULL,
  SupportLevel = 0.95,
  PlotWidth = 25,
  PlotHeight = 35
)

Mod_Heatmap_Omega(
  Path_Model,
  SupportLevel = 0.95,
  PlotWidth = 26,
  PlotHeight = 22.5
)

Arguments

Path_Model

Character. Path to the fitted Hmsc model object.

SupportLevel

Numeric. The posterior support threshold for determining which values are considered significant in the heatmap. Defaults to 0.95, indicating 95% posterior support. Values above this threshold (or below 1 - threshold for negative associations) are considered significant and will be plotted (see Hmsc::plotBeta).

PlotWidth, PlotHeight

Integer. The width and height of the generated heatmaps in centimeters. Defaults to 26×22.5 for omega; 25×35 for beta.

Value

Both functions do not return a value but saves heatmap plots as JPEG files in the Model_Postprocessing/Parameters_Summary subdirectory.

Details

The functions exports three types of visualizations (see Hmsc::plotBeta):

  • Mean: posterior mean estimate,

  • Support: statistical support level, measured by the posterior probability for a positive or negative response,

  • Sign: indicates whether the response is positive, negative, or neither of these based on the chosen SupportLevel.

For the omega parameter, the Mod_Heatmap_Omega() function generates two JPEG files: signs and mean values. While for the beta parameter, the Mod_Heatmap_Beta() function generates four JPEG files : support, signs, mean values (including and excluding the intercept).

Author

Ahmed El-Gabbas. The Mod_Heatmap_Beta() function is adapted from Hmsc::plotBeta