## expected value of 'mpg' conditional on fitted model and predictor values in
## first observation of mtcars, evaluated for a range of 'wt' values.
data(mtcars)
model <- lm(mpg ~ ., data = mtcars)
plotxs(xs = mtcars[, "wt", drop = FALSE],
y = mtcars[, "mpg", drop = FALSE],
xc.cond = mtcars[1, ],
model = list(model))
Run the code above in your browser using DataLab