[ ] a suggested code or documentation change, improvement to the code, or feature request
The summary method has a hard coded variable name x. This is problematic: x is quite commonly used as the name for a predictor variable when teaching regression. If we have x as a predictor, the summary method incorrectly selects the predictors as the predicted value and vice versa.
Put your code here:
## load package
library("prediction")
## code goes here
set.seed(12345)
N <- 200
x <- rnorm(N)
y <- x+rnorm(N)
m1 <- lm(y ~ x)
p1 <- prediction(m1, at=list(x=-3:3))
summary(p1)
## session info for your system
sessionInfo()
Please specify whether your issue is about:
The summary method has a hard coded variable name x. This is problematic: x is quite commonly used as the name for a predictor variable when teaching regression. If we have x as a predictor, the summary method incorrectly selects the predictors as the predicted value and vice versa.
Put your code here: