Plot predictor coefficients
plot_coefficients.RdPlots coefficients of continuous, categorical, or ordinal predictors on occupancy or detection submodels.
Arguments
- fit
A fitted model object from
occARU().- submodel
character. Predictors of submodel to plot. One of"detection"(default) or"occupancy".- component
character. Whether to plot"site"(default) or"survey"predictors. If"survey",submodelmust be"detection".- type
character. Type of predictors to plot. One of"continuous"(default),"categorical", or"ordinal".- level
character. For multi-species models, whether to plot species-specific ("species", default) or mean coefficients ("mean").- facet_by
character. Whether to useggplot2::facet_wrap()orggh4x::facet_grid2()to facet by"predictor"(default) or"species". Only used iflevelis"species".- species
character. Vector of species to plot. IfNULL(default), all species are plotted. Must be one ofattr(occARU_data, "species").- unconditional
logical. IfTRUE, plot the unconditional regression coefficients, e.g., \(\boldsymbol{\beta} + (\boldsymbol{X}^\prime \boldsymbol{X})^{-1} \boldsymbol{X}^\prime \boldsymbol{\iota}\), which attribute variance shared between the fixed and random effects back to the covariates. IfFALSE(default), plot the conditional coefficients \(\boldsymbol{\beta}\).- ordinal_categories
logical. IfFALSE(default), plots coefficients associated with maximum category (full effect). IfTRUE, plots realised coefficient associated with each ordered category, where the first is used as the reference.- ...
Additional arguments passed to
ggdist::stat_pointinterval().
Value
A ggplot object with occARU-specific attributes attached:
plot_dataThe tibble used to produce the plot.
Details
occARU accommodates three types of predictors: continuous, categorical, and ordinal (ordered categorical). Categorical predictors are modeled as zero-sum Gaussians, and coefficients are plotted for each level in each predictor. Ordinal predictors are modeled with a simplex decomposition of the category differences. Ordinal coefficients can be plotted as the overall effect (coefficient when the ordinal predictor has the maximum value) or plotted for each level.