View source: R/observed_vs_theoretical.R
observed_vs_theoretical | R Documentation |
Plot observed vs predicted distribution of a fitted model
observed_vs_theoretical(model)
model |
A statistical model. |
Has been tested with stats::lm()
and stats::glm()
models. It may work
with other types of models, but without any warranty.
A ggplot2
plot.
# a linear model
mod <- lm(Sepal.Length ~ Sepal.Width + Species, data = iris)
mod |> observed_vs_theoretical()
# a logistic regression
mod <- glm(
as.factor(Survived) ~ Class + Sex,
data = titanic,
family = binomial()
)
mod |> observed_vs_theoretical()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.