diagnose | R Documentation |
Graphically diagnose model residuals.
diagnosemodel, fit_type = 'response', residual_type = 'response', point_color = 'black', line_color = 'black', pch = 1, lwd = 1)
model |
An lm, glm, or nls object. |
fit_type |
String. Default is "response". Type of fitted values to use based on options in predict(). |
residual_type |
String. Default is "response". Type of residuals values to use based on options in resid(). |
point_color |
Color of the points and fill color of the histograms. If left to defaults, fill of the histogram is white. |
line_color |
Color of the smoothed line. |
pch |
Point type. Same settings as Base R pch in plot(). |
lwd |
Width of the smoothed line. |
2x2 charts similar to plot(model.lm): 2 scatter plots and 2 histograms of residuals and residuals
https://github.com/robertschnitman/diagnoser
# OLS case model.lm <- lm(data = mtcars, formula = mpg ~ wt + gear) diagnose(model.lm) # defaults diagnose(model.lm, point_color = '#00BFC4', line_color = '#F8766D', pch = 16, lwd = 2) # NLS case model.nls <- nls(Ozone ~ theta0 + Temp^theta1, airquality) diagnose(model.nls)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.