Learn R Programming

iNZightRegression (version 1.3.5)

partialResPlot: Partial residual plot of continuous variable

Description

This function draws partial residual plots for a continuous explanatory variables in a given model.

Usage

partialResPlot(
  fit,
  varname,
  showBootstraps = nrow(fit$model) >= 30 & nrow(fit$model) < 4000,
  use.inzightplots = FALSE,
  env = parent.frame()
)

allPartialResPlots(fit, ...)

Value

No return value, called for side-effect of producing a plot.

Arguments

fit

an lm, glm or svyglm object.

varname

character, the name of an explanatory variable in the model

showBootstraps

logical, if TRUE, bootstrap smoothers will overlay the graph. By default this is TRUE if there are between 30 and 4000 observations in the model, otherwise it is FALSE.

use.inzightplots

logical, if TRUE, the iNZightPlots package will be used for plotting.

env

environment where the data is stored for bootstrapping

...

additional arguments passed to `partialResPlot`

Functions

  • allPartialResPlots(): Cycle through all partial residual plots

Author

David Banks, Tom Elliott.

Examples

Run this code
m <- lm(Sepal.Length ~ Sepal.Width + Petal.Width, data = iris)
partialResPlot(m, "Sepal.Width")

# \donttest{
allPartialResPlots(lm(Sepal.Length ~ Sepal.Width + Petal.Width, data = iris))
# }

Run the code above in your browser using DataLab