R/LMsummary_and_plot.R

Defines functions LMsummary_and_plot

Documented in LMsummary_and_plot

LMsummary_and_plot <- function(x) {
  def.par <- par(no.readonly = TRUE) # save default, for resetting...
  print(summary(x))
  zones <- matrix(c(1, 2, 3, 7, 7,4, 5, 6, 7, 7), ncol=5, byrow=TRUE)
  layout(zones)
  plot(x, which = 1:6)
  res <- x$residuals
  plot(density(res), main = 'Density.Residuals')
  abline(v = median(res), lty = 1)
  par(def.par)  #- reset to default
}


# lm.out <- lm(mpg ~ drat * vs, data = mtcars)
# LMsummary_and_plot(lm.out)
alemiani/explora documentation built on May 28, 2019, 4:54 p.m.