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

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

allPartialResPlots(fit, ...)

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`

Value

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

Functions

  • allPartialResPlots(): Cycle through all partial residual plots

Author

David Banks, Tom Elliott.

Examples

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))


# }