Partial regression plots are also called added variable plots. The 'car' library has some nice functions to do these for you.
Code:> # Make some test data > x1 <- 1:30 > x2 <- rnorm(30) > y <- x1 + x2 + rnorm(30) > library(car) > dat <- data.frame(y = y, x1 = x1, x2 = x2) > > # Fit the model > o <- lm(y ~ x1 + x2, data = dat) > # Get the added variable plots > avPlots(o)





Reply With Quote

