Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ggerror

Plotting Error of Models


Description

Creates a ggplot geom that can be extended and accept other ggplot layers. Shows residual error from the regression mean for different types of regression models.

Usage

ggerror(model)

Arguments

model

Model to be analyzed. The function will detect what type of family the model is (e.g. linear = "gaussian", logistic = "binomial") and plot the appropriate type of model.

Details

Generate residuals for models. Currently accepts only linear models. Does not account for covariates yet, although may be able to do this in the future.

Value

Returns a ggplot object of geom type, other layers can be added on as seen in example.

Examples

data("twins")
model <- lm(beck_total ~ HR, data = subset(twins, hour == 7))
ggerror(model)

card

Cardiovascular and Autonomic Research Design

v0.1.0
MIT + file LICENSE
Authors
Anish S. Shah [aut, cre, cph] (<https://orcid.org/0000-0002-9729-1558>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.