Description Usage Arguments Value Source See Also Examples
Applies fitted model from comp_bayes_lm()
and
returns posterior predicted values.
1 2 |
object |
Output of |
newdata |
A data frame of type |
... |
Currently ignored—only included for consistency with generic. |
A vector of predictions with length equal to the input data.
Closed-form solutions of Bayesian linear regression doi: 10.1371/journal.pone.0229930.s004
Other modeling functions:
comp_bayes_lm()
,
create_bayes_lm_data()
,
run_cv()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | library(dplyr)
library(sf)
library(ggplot2)
# Load in posterior parameter example
# and growth data to compare to
data(comp_bayes_lm_ex, growth_ex)
predictions <- focal_vs_comp_ex %>%
mutate(growth_hat = predict(comp_bayes_lm_ex, focal_vs_comp_ex))
predictions %>%
ggplot(aes(growth, growth_hat)) +
geom_point() +
geom_abline(slope = 1, intercept = 0)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.