Plot marginal effect plots (= response curves if covariates are continuous) for all species in a community (multi-species) occupancy model. Takes into account species-specific intercepts (if any). Currently only supports continuous covariates, not categorical covariates.
# S4 method for commOccu
plot_effects(
object,
mcmc.list,
submodel = "state",
response = "occupancy",
draws = 1000,
outdir,
level = 0.95,
keyword_quadratic = "_squared",
...
)
A list of ggplot objects (one list item per covariate).
commOccu
object
mcmc.list. Output of fit
called on a commOccu
object
character. Submodel to get plots for. Can be "det"
(detection submodel) or "state"
(occupancy submodel)
character. response type on y axis. Only relevant for submodel = "state"
. Default is "occupancy"
, can be set to "abundance"
for Royle-Nichols models
integer. Number of draws from the posterior to use when generating the plots. If fewer posterior samples than specified in draws
are available, all posterior samples are used.
character. Directory to save plots to (optional)
numeric. Probability mass to include in the uncertainty interval.
character. A suffix in covariate names in the model that indicates a covariate is a quadratic effect of another covariate which does not carry the suffix in its name (e.g. if the covariate is "elevation", the quadratic covariate would be "elevation_squared").
additional arguments for ggsave
- only relevant if outdir
is defined
Users who wish to create their own visualizations can use the data stored in the ggplot output. It is accessed via e.g. output$covariate_name$data