View source: R/plot_null_distribution.R
plot_null_distribution | R Documentation |
Provides a wrapper for plotting a model for the null distribution of a test statistic comparing two linear models.
plot_null_distribution(statistics, show.pvalue = FALSE)
statistics |
result of a call to |
show.pvalue |
boolean indicating whether the p-value region should
be drawn on the graphic. If |
The compare_models
function returns an attribute that
contains a random sample from the null distribution of the test statistic.
This is extracted and used to construct a graphic summarizing this
distribution.
ggplot2
object.
compare_models
fit1 <- lm(mpg ~ hp, data = mtcars)
fit0 <- lm(mpg ~ 1, data = mtcars)
null_distn <- compare_models(fit1, fit0,
assume.constant.variance = TRUE,
assume.normality = FALSE)
plot_null_distribution(null_distn,
show.pvalue = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.